Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Cancellation and Run Status

Cancellation requests that work stop. It is not the same as successful completion, and it does not reverse external actions already performed.

Cancellation is a request, not a rollback

Read the actual final state. Cancellation does not undo provider actions already completed, and a different credential can represent a different actor.

Copy the example
# Request cancellation using the run-owning credential.
POST /v2/runs/{run_id}/cancel

# A 202 response means accepted, not finished.
GET /v2/runs/{run_id}

# Keep following the same run until a terminal state:
# succeeded | failed | cancelled

Before you begin

A run ID and the credential that owns the run for the v2 cancellation path.

Run states and cancellation

Term
Definition

Cancellation request

A request to stop an execution. Acceptance is not confirmation that all work has stopped.

Terminal state

A state indicating that a run has ended, such as succeeded, failed, or cancelled. Stop normal completion polling only after a final state is known.

Run

One execution of a project. Use its run ID to retrieve that execution’s state, input, output, and errors.

Side effect

A change outside the returned answer, such as creating a record or sending email. Cancellation or release rollback does not undo a completed side effect.

Cancel a run and check its status

  1. Read the current run state.

  2. Request cancellation through the supported run control.

  3. Continue reading the run until its terminal state is known.

The client displays the actual final state instead of treating request acceptance as completion.

Behavior and limitations

A v2 cancellation response of 202 means the request was accepted. A personal API key and a session are distinct actors even when associated with the same person. The batch UI cancellation path is different and can leave in-flight work running.

v2 state
Interpretation

queued, running

Execution is not complete.

paused

A response is required before continuation.

succeeded

The run completed successfully.

failed

Inspect the recorded error.

cancelled

The run ended as canceled.

Execution Order and Node Dependencies

Was this helpful?