How to connect
1
Create an API key
Create an API key for this workspace with the
workflow run scope. Add workflow read to check status. See API keys.2
Send headers
Send the key in the
X-API-Key header, with a unique Idempotency-Key per run.3
Pass context
Put input in
context. For example phone_number becomes {{phone_number}} in later steps.Concurrency-Key (for example a store id) to allow only one active run per key; others return 409.
Optional Cooldown-Minutes (0–10080) refuses a new run for that key until this many minutes after its last run ended.
Start a run
POST https://api.persistence.dev/v1/workflows/{workflowId}/run
202 with a runId in data.id.
Check status
GET https://api.persistence.dev/v1/workflows/{workflowId}/runs/{runId}
workflow read scope. Status values match the Runs tab: queued, running, waiting_call, waiting_schedule, waiting_automation, blocked, completed, failed, cancelled.
Cancel
Cancel one run:POST /v1/workflows/{workflowId}/runs/{runId}/cancel
Cancel every active run, or only those that share concurrency keys:
POST /v1/workflows/{workflowId}/runs/cancel
"concurrencyKeys": ["store-10"] instead of "all": true. You can include an optional reason. Workflows with Send the failure webhook when a run is cancelled notify that webhook for each cancelled run.
Wake a waiting run
If a run is sleeping at a Delay (or another wait step) for a promised time, you can continue it now. Runs pausing between call retries are not woken.POST /v1/workflows/{workflowId}/runs/wake
Workflows API
Request and response contracts for start, status, cancel, and wake.