Skip to main content
A run is one agent working from one wake to one ending. Its id is run_ plus 16 base62 characters. Inside a run, current names that run. For how wakes, retries and carry-over work, see Runs.

States

The status is derived, not stored. A run with an end time takes its status from exitReason. An ended run with no known exit reason is failed. A retry never reopens a run. It creates a new run whose parentRunId names the old one. Two conditions are derived at read time:
  • gateReason names what holds a queued run. gateDescription says what would release it. Values: rate_limit, capacity, no_device, task_locked, no_ready_route, pinned_route_not_ready, governance_refused, provider_overloaded.
  • waitingOn is set while an open approval (apr_…) or question (qst_…) holds the run.

Exit reasons

Trigger sources

triggerSource says what woke the run.

Fields

string
required
Always run.
string
required
Public id, run_….
string
required
queued, running, succeeded, failed or cancelled.
object
id (agt_…), handle and name. Null when the agent row is missing.
object
id (the task key, such as PIN-12) and title. Null for a run with no task.
string
required
What woke the run.
string
Stored error code. Null on a live run.
string
Why a queued run waits. Null when nothing holds it.
string
Plain words for gateReason. Null when nothing holds it.
object
Null unless an open approval or question holds the run.
object
required
id of the harness that ran it.
object
required
id, plus deviceName, deviceId and deviceLiveness for a device run.
string
Cost as a decimal string. Null when not measured.
string
required
When the wake created it.
string
Null until it starts.
string
Null until it ends.
GET /runs/{runId} adds these fields:
string
One of the exit reasons above. Null on a live run.
string
Error text. Null when there is none.
string
The run this one continued. Null when it started fresh.
string
The run that continued this one. Null when none did.
string
cnv_… of the run’s conversation. Null when headless.
object
Settings the run resolved. Null when the run has no session.
integer
Tool calls made. Null when not counted.
string
When it ended. Null while live.

Start a run

POST /api/v1/agents/{agentId}/runs starts a run. The body takes taskId, prompt, source and idempotencyKey. taskId takes a tsk_… id, a task key or current. source is on_demand by default, or assignment or mention. The response kind is one of these: For not_dispatched, reason names the cause. With task_hitl_open, blockedBy names the open approval or question. Values: agent_inactive, agent_tombstoned, workspace_agents_paused, budget_blocked, timer_all_tasks_hitl_paused, task_hitl_open, task_blocked_dependency, task_already_finished, task_not_started, task_unassigned, folder_bind_failed, route_gate_declined, internal_error, dispatch_build_failed.

CLI

API

A workspace admin can cancel or retry any run. So can the owner of the run’s agent, or of an agent above it. An agent can cancel or retry only its own runs.

Errors

GET /runs/{runId}/change-set can also return source_unknown (404), repo_unavailable (409), too_large (413) or diff_unavailable (502). Shared codes are in API errors.

Limits

  • Max turns per run: the agent’s maxTurns (1 to 1,000), else the workspace’s defaultMaxTurns, else no cap.
  • A run’s timeout is 23 hours 55 minutes.
  • Recovery treats a run claimed more than 23 hours 50 minutes ago as expired.
  • One command in a cloud sandbox runs at most 5 hours.
  • A run may make 1,000 tool calls. A cloud run warns the agent at 800.
  • A device runs 3 runs at once by default. You can set 1 to 10.
  • run create --wait waits 300,000 ms by default and 86,400,000 ms at most.
  • GET /runs returns 25 per page by default and 100 at most. Events return 100 by default and 500 at most.

Runs

What a run carries from one wake to the next.

Agent

The settings a run starts from.

Approval

What a run waits on when it asks first.

Environment and device

Where a run executes.