Prerequisites
- A task id and its agent id.
- An API key for the owning workspace.
- Know the task’s current status.
GET /v1/workspaces/{workspace}/agents/{agent_id}/tasks/{task_id}returns it, reconciled against the workflow.
Choose a control
Steps
Cancel
cancelled to the task
row. Reads that reconcile against the workflow report cancelled; a plain list
query still shows the last persisted status. See Verify below.Pause and resume
Continue a task waiting on a limit
A task that exhausts its iterations, its spend cap, its token budget
(Each stop reason has its own grant:Note the path: this one is not nested under the agent.
tokens.max_tokens) or its total tool-call budget
(execution.max_tool_calls_total) does not fail immediately. It writes waiting_for_continuation, emits
task.awaiting_continuation, and idles for up to 24 hours.The grant must match the reason it stopped:Other grants may ride along. The raised limits are re-resolved against the
workspace and agent policy ceilings, so a grant past a ceiling is refused
with
policy_ceiling. Send several if you are unsure:Steer a running task
POST /v1/workspaces/{workspace}/agents/{agent_id}/tasks/{task_id}/command takes four commands. Each
requires its own field:Retry
Start a new task with the same body. A failed task cannot be resumed: its
workflow has terminated, and the task row is the record of that attempt. Reuse
the original
description and parameters from
GET /v1/workspaces/{workspace}/agents/{agent_id}/tasks/{task_id}.A task that completed is different — it stays alive for 30 minutes accepting
follow-ups. Send queue_message rather than starting a new task if you want to
continue the same conversation.Verify
After cancelling, confirm the task reports a terminal status through the reconciling read:Troubleshooting
409 "Task is not running" from a command
409 "Task is not running" from a command
The workflow is no longer running, so the signal could not be delivered.
This is deliberately an error rather than a misleading 200 — a model switch
that never reached the workflow must not look like it succeeded. Check the
status first.
409 from /continue with not_waiting_for_continuation
409 from /continue with not_waiting_for_continuation
The task is not in
waiting_for_continuation . Either it never hit a limit,
or the 24-hour window expired and it already failed.409 with additional_*_required
409 with additional_*_required
The grant did not match the stop reason. A task stopped on
iteration_limit
needs iterations, budget_exceeded needs budget, token_limit needs
tokens, and tool_call_limit needs tool calls. Read failure_reason from
the task.awaiting_continuation event to see which.409 with policy_ceiling
409 with policy_ceiling
The raised limit exceeds a workspace or agent policy ceiling. Grant less, or
raise the ceiling first.
422 from /continue
422 from /continue
additional_iterations, additional_budget_usd, additional_tokens and
additional_tool_calls were all absent or zero. At least one resource must
be granted.404 from DELETE on a task you can see
404 from DELETE on a task you can see
The endpoint returns 404 when the workflow could not be cancelled, which
includes a task that already reached a terminal state. A completed task has
nothing to cancel.
The list view still shows running after a successful cancel
The list view still shows running after a successful cancel
Expected. The cancel path does not write the row; only reads that reconcile
against the workflow report the terminal status. Fetch the single task
rather than trusting a list.
update_budget returns 400
update_budget returns 400
A new ceiling below the amount already spent is rejected by the workflow.
Query the current cost from
GET /v1/workspaces/{workspace}/agents/{agent_id}/tasks/{task_id}/summary and set a higher value.Related
Tasks
A task is one persisted request to one agent
Debug a failed task
Read the failure code, narrow it with the task rollup
Durable execution
What Temporal actually provides to an AgentArea task