Skip to main content
DELETE
/
v2
/
workflows
/
runs
Bulk Cancel Workflow Runs
curl --request DELETE \
  --url https://qstash.upstash.io/v2/workflows/runs \
  --header 'Authorization: Bearer <token>'
{
  "cancelled": 123
}
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.

Authorizations

Authorization
string
header
required

QStash authentication token

Query Parameters

workflowRunIds
string[]

Optional list of specific workflow run IDs to cancel. If provided, the other filters are ignored.

workflowUrl
string
required

The URL of the workflow whose runs to cancel.

workflowUrlExactMatch
boolean
default:false

workflow url is searched as a prefix by default. To make it exact match, workflowUrlExactMatch can be set to true.

fromDate
number<date-time>

Optional start date to filter workflow runs to cancel. Unix timestamp in milliseconds.

toDate
number<date-time>

Optional end date to filter workflow runs to cancel. Unix timestamp in milliseconds.

callerIp
string

Optional caller IP address to filter workflow runs to cancel.

flowControlKey
string

Optional flow control key to filter workflow runs to cancel.

label
string

Optional label to filter workflow runs to cancel.

count
integer
default:100

Maximum number of workflow runs to cancel. Default is 100.

Response

200 - application/json

All workflow runs cancelled successfully

cancelled
integer

The number of workflow runs that were cancelled.