API Reference
Cancel Workflow Run
POST /api/v1/workflow-jobs/:jobId/cancel — stop a workflow run that is still in flight.
Cancels a workflow run that hasn't reached a terminal state yet, and releases the concurrency slot it was holding.
POST /api/v1/workflow-jobs/{jobId}/canceljobId is the run's executionId. No request body.
Path parameters
| Parameter | Type | Description |
|---|---|---|
jobId | string (UUID) | The run's executionId. |
Response
200 OK
{
"executionId": "8f2a1c9e-...",
"status": "cancelled"
}Idempotent by design
Cancelling always returns 200 with the run's real current status, whether or not this call changed anything:
- Run still in flight (
queued,running,paused,awaiting_approval) → it is cancelled, andstatusis"cancelled". - Run already finished → nothing is rewritten, and
statusis whatever it actually reached (completed,failed, …). - Run finishes in the instant between your call and the write → you get its real terminal status, not
"cancelled". A finished run's verdict is never overwritten by a late cancel.
Safe to call more than once, and safe to call on a run you aren't sure about.
Useful for a timed-out synchronous run
A /run call that returns 504 leaves the run executing on
purpose. If you don't intend to collect it, cancel it here — otherwise it holds a concurrency slot
until it finishes on its own.
Errors
| Status | error | When |
|---|---|---|
404 | job_not_found | No run with that id in your organization, or outside your project-scoped key's project |
Example
curl -X POST https://api.elizon.com/api/v1/workflow-jobs/{executionId}/cancel \
-H "X-API-Key: elz_your_key_here"