Understanding Task Executions and Their Lifecycle
Option | Type | Description | Default |
---|---|---|---|
task_id | string | The ID of the task to execute | Required |
input | object | The input to the task | Required |
metadata | object | Additional metadata for the execution instance | null |
transition_count | number | The number of transitions in this execution | null |
Status | Description |
---|---|
queued | The execution is queued and waiting to start. |
starting | The execution is starting. |
running | The execution is currently running. |
awaiting_input | The execution is suspended and awaiting user input to resume. |
succeeded | The execution has completed successfully. |
failed | The execution has failed due to an error. |
cancelled | The execution has been cancelled by the user or system. |
Transition Type | Description |
---|---|
init | Initializes the execution. |
start | Starts the execution process. |
step | Executes a step within the task. |
wait | Pauses execution waiting for external input. |
resume | Resumes execution after a wait. |
finish | Marks the execution as successfully completed. |
error | Marks the execution as failed due to an error. |
cancel | Cancels the execution. |
ExecutionStatusEvent
schema and includes the following fields:
AsyncClient
AsyncClient
not Client
.await client.executions.status.stream(...)
to obtain the async generator.async for
to consume events.change_status
method in the SDKs.
Example:
failed
and cancelled
.