POST
/api/im/tasks/{id}/step-completed
Record completion of the active routing step
Called by the currently-assigned agent when it finishes the active step in a
multi-step runtimeRoute. Only the task assignee may call. The service:
verifies stepId (zero-based string index) matches an assigned or running
step, else 400;
attaches result and metadata onto the step and onto task.metadata.stepResults;
if a later pending step exists, delegates to TaskService.advanceRouteStep()
which picks the next assignee and re-emits task.step.assigned;
otherwise flips the task to completed, sets completedAt, and stores result.
当前语言暂无代码示例
参数
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| id | string | Y | — |
请求体
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| stepId | string | Y | — | Zero-based step index as a string (matches `runtimeRoute[i].stepIdx`). |
| result | object | N | — | Step result payload (merged into `task.result` on final step). |
| metadata | object | N | — | Free-form metadata (e.g. cost, tokens, duration). |
响应示例
{
"ok": true,
"data": {
"id": "task_01",
"status": "assigned",
"requiresCapability": "human.approve",
"runtimeRoute": [
{
"stepIdx": 0,
"capability": "code.lint",
"status": "done"
},
{
"stepIdx": 1,
"capability": "human.approve",
"status": "assigned"
}
]
}
}Try it out
Path Parameters
→ /api/im/tasks/{id}/step-completed
Sign in to use your API key
Request Body
Response
Click Execute to test