Cancel a running or pending workflow run.
This endpoint:
The Redis flag ensures in-flight executions are stopped quickly.
Args: run_id: The ID of the workflow run to cancel
Returns: CancelWorkflowResponse with run status and redis availability
Cancel a running or pending workflow run. Cancellation is delivered through Temporal, so the response can carry one of three states:Documentation Index
Fetch the complete documentation index at: https://docs.retab.com/llms.txt
Use this file to discover all available pages before exploring further.
cancelled — the run reached a cancelled terminal state.cancellation_requested — the cancel signal was accepted; the run will reach cancelled shortly. Re-poll Get Run to observe the transition.cancellation_failed — Temporal rejected the cancel (e.g. the run already finished). The returned run reflects the actual current state.command_id is an idempotency key — replaying the same value never enqueues a second cancel.
Optional request payload for cancel workflow command idempotency.
Optional idempotency key for deduplicating cancel commands
Successful Response
Response for cancel workflow endpoint.
A stored workflow run record.
Slim, typed, discriminated. Engine-only state is segregated into
engine and excluded from API serialization (Field(exclude=True)).
The terminal state (success/error/cancelled) is encoded in
lifecycle, not spread across loose error / error_details
/ etc. fields.
Steps are NOT embedded — fetch via StepsView(run_id, ...) or the
GET /v1/workflows/runs/{run_id}/steps endpoint.
Whether Redis was available to set the cancellation flag for immediate effect
Cancellation delivery state from this request
cancelled, cancellation_requested, cancellation_failed