ReferenceEvents and execution

Run states and error categories

The complete enums for routine status, run state, trigger, step kind, and error category.

These enums are shared between the API, the dashboard, and webhook payloads.

Routine status

draft | active | paused | archived
ValueSchedulableRunnable manually
draftNoYes
activeYesYes
pausedNoYes
archivedNoNo

Run state

queued | claimed | running | succeeded | failed | cancelled | timed_out

Terminal states are succeeded, failed, cancelled, and timed_out. Poll for membership of that set.

Run trigger

manual | api | schedule

Only a successful manual run satisfies the activation requirement.

Step kind

model | tool_call | tool_result | error

Error category

authentication | configuration | gateway_rate_limit | gateway_timeout |
gateway_error | invalid_model | model_auth_required | model_access_denied |
model_unavailable | model_rate_limited | model_runtime_unavailable |
model_timeout | model_provider_error | mcp_discovery | mcp_transport |
reauthorization_required | provider_permission_denied | provider_rate_limit |
provider_policy_blocked | external_action_unknown | tool_denied | tool_error |
step_limit | idle_timeout | timeout | cancelled | billing_limit | internal

step_limit marks the fixed platform safety ceiling of 10,000 model steps — an anti-runaway backstop, retired as a configurable cap. Runs are otherwise bounded by time: timeout covers the absolute deadline (the routine's timeoutSeconds, or on the hosted scheduler the smaller platform execution window — see Limits), and idle_timeout covers a run that recorded no progress within its idleTimeoutSeconds.

CategoryRetryable
authenticationNo
configurationNo
gateway_rate_limitYes
gateway_timeoutYes
gateway_errorYes
invalid_modelNo
model_auth_requiredNo
model_access_deniedNo
model_unavailableNo
model_rate_limitedNo
model_runtime_unavailableNo
model_timeoutNo
model_provider_errorNo
mcp_discoveryNo
mcp_transportYes
reauthorization_requiredNo
provider_permission_deniedNo
provider_rate_limitNo
provider_policy_blockedNo
external_action_unknownNo
tool_deniedNo
tool_errorNo
step_limitNo
idle_timeoutYes
timeoutYes
cancelledNo
billing_limitNo
internalNo

Webhook retryability is derived from the fixed webhook category mapping. In version one, only gateway_error, gateway_rate_limit, gateway_timeout, idle_timeout, mcp_transport, and timeout produce run.error.retryable: true; every connected-provider model_* category produces false. The webhook payload does not preserve a provider result's retryable value. Any in-attempt runtime retry inside the active provider operation is separate from this webhook contract. Consumers should use the emitted webhook value and the fixed Troubleshooting recovery guidance rather than infer retryability from provider behavior.

Run usage

{
  inputTokens: number; // integer, ≥ 0
  outputTokens: number; // integer, ≥ 0
  totalTokens: number; // integer, ≥ 0
  costUsd: number | null; // webhook/shared aggregate; null when cost is unknown
}

Usage appears on each model step and aggregated on the run. Run detail exposes its preserved cost as an exact decimal string or null; connected-provider missing cost means billed/limited by that provider, not zero. The current database field is text and legacy producers used String(number), so consumers must validate it conservatively rather than assuming every stored value is a canonical decimal or recomputing billing.

On this page

Edit this page on GitHub