Tasks

Get task state

Task state for polling: repeat until done is true. Then reply if state is input-required, otherwise read /output. Saved rows are readable from /output earlier. Use wait=1-50 to long-poll. This is the status_url on every task.

get/task/{task_id}/state

Request

  • Base URL
    https://api.autumn.ai
  • URL
    https://api.autumn.ai/task/{task_id}/state
  • Auth
    • API key in header X-API-Key
    • or HTTP bearer

Path parameters

task_idstring required

The task_id returned by POST /task or POST /task/start.

Example:8fab6f34

Query parameters

waitinteger

Wait up to 50 seconds for the first status version change (values are clamped to 0-50).

Response

Task state.

task_idstring required
existsboolean required
statestring nullable

Lifecycle state: submitted, working, input-required, completed, canceled or failed (A2A). Poll until done is true.

doneboolean nullable

True once the task has stopped: input-required (reply to continue; see next), completed, canceled or failed. Poll until true, then check state. Saved rows are readable from /output before this.

messagestring nullable

Latest public-facing task message.

progressobject nullable

Rows saved so far (rows) and the optional target. Saved rows are readable from /output while done is false.

activeboolean required

Legacy. True while a turn is running, which can continue after rows are saved. Use done to tell when the task is finished.

statusstring required

Legacy; use state and done.

phasestring required

Legacy; use state and done.

activitystring required

Legacy; use state and done.

run_idstring nullable
heartbeat_atstring nullable
pending_opstring nullable

A queued message or execute that has not started yet.

pending_op_staleboolean nullable

True when the queued op has waited past its TTL and will not start.

last_submit_errorstring nullable

Why the last queued (202) message or execute was rejected when it ran, e.g. out_of_credits. Empty when it ran.

last_submit_error_atstring nullable
credits_usedinteger nullable

Credits used by this task.

stagestring nullable

Current stage while the task is active.

elapsed_sinteger nullable

Elapsed seconds in the current or most recent run.

queue_positioninteger nullable

Place in line for a queued task, or null when not queued.

queued_countinteger

Pending queued follow-ups.

outcomestring nullable

Normalized completed outcome.

errorobject nullable

Public failure code and recovery guidance.

nextobject nullable

Suggested next action and API call.

versionstring nullable

Changes when public task status changes.

app_urlstring nullable

Open the task in the Autumn app.

Example response

{
  "queue": {
    "position": 3,
    "eta_s": 240
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.