Cancel Process
UsePOST /processes/{process_id}/cancel to request process-aware cancellation.
When To Use It
Use this endpoint when you need cancellation semantics for the public process model. This is not the same as the legacy queue-itemPOST /cancel endpoint.
Request Example
Request Fields
| Field | Type | Required | Notes |
|---|---|---|---|
reason | string | yes | Human-readable cancel reason. |
requested_by | object | yes | Caller identity payload. |
strategy | string | no | soft, hard, or soft_then_force. Defaults to soft_then_force. |
force_after_seconds | integer | no | Defaults to 10. Must be >= 0. |
Strategies
| Strategy | Meaning |
|---|---|
soft | Mark work cancelled and rely on cooperative stop behavior only. |
hard | Issue immediate termination against active executing work when available. |
soft_then_force | Request cooperative stop first, then escalate after the delay window. |
Response Example
Behavior Notes
- Terminal processes return
ignored_terminal. - Pending child queue items are cancelled immediately when eligible.
- Executing work may require control-plane termination depending on strategy and current runtime state.
- Public callers should treat cancel as a state transition request and re-read the returned
processobject.
Idempotency
This endpoint is stateful rather than idempotent-by-key. Repeated requests may produce different results based on current process state.Failure Modes
| Status code | Meaning |
|---|---|
401 | Missing or invalid bearer token. |
404 | Process not found. |
422 | Invalid payload, unknown strategy, or invalid force_after_seconds. |
500 | Unexpected cancellation error. |