Elizon Docs
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}/cancel

jobId is the run's executionId. No request body.

Path parameters

ParameterTypeDescription
jobIdstring (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, and status is "cancelled".
  • Run already finished → nothing is rewritten, and status is 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

StatuserrorWhen
404job_not_foundNo 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"