Skip to main content
DELETE
https://qstash.upstash.io
/
v2
/
workflows
/
runs
# Cancel by workflow URL
curl -XDELETE https://qstash.upstash.io/v2/workflows/runs \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <QSTASH_TOKEN>" \
  -d '{"workflowUrl": "https://example.com"}'

# Cancel with filters
curl -XDELETE https://qstash.upstash.io/v2/workflows/runs \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <QSTASH_TOKEN>" \
  -d '{
    "label": "my-workflow-label",
    "fromDate": 1640995200000,
    "toDate": 1672531200000
  }'

# Cancel all workflows (empty body)
curl -XDELETE https://qstash.upstash.io/v2/workflows/runs \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <QSTASH_TOKEN>" \
  -d '{}'
{
  "cancelled": 10
}
Bulk cancel allows you to cancel multiple workflow runs at once.
If you provide a list of workflow run IDs in the request body, only those specific workflow runs will be canceled.If you include the workflow URL parameter, all workflow runs matching the URL filter will be canceled.If the request body is empty, all workflow runs will be canceled.
This operation scans all your workflow runs and attempts to cancel them. If a specific workflow run cannot be canceled, it will return an error message. Therefore, some workflow runs may not be cancelled at the end. In such cases, you can run the bulk cancel operation multiple times.

Request

workflowRunIds
Array
The list of workflow run IDs to cancel.
workflowUrl
string
The workflow URL to filter. Can be used either for exact matches or as a prefix filter depending on the endpoint behavior.
label
string
Cancel workflows with this label.
fromDate
number
Cancel workflows created after this date (Unix timestamp in milliseconds).
toDate
number
Cancel workflows created before this date (Unix timestamp in milliseconds).

Response

A cancelled object with the number of cancelled workflow runs.
{
  "cancelled": number
}
# Cancel by workflow URL
curl -XDELETE https://qstash.upstash.io/v2/workflows/runs \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <QSTASH_TOKEN>" \
  -d '{"workflowUrl": "https://example.com"}'

# Cancel with filters
curl -XDELETE https://qstash.upstash.io/v2/workflows/runs \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <QSTASH_TOKEN>" \
  -d '{
    "label": "my-workflow-label",
    "fromDate": 1640995200000,
    "toDate": 1672531200000
  }'

# Cancel all workflows (empty body)
curl -XDELETE https://qstash.upstash.io/v2/workflows/runs \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <QSTASH_TOKEN>" \
  -d '{}'
{
  "cancelled": 10
}