Upstash Documentation

Bulk Cancel Workflow Runs

Cancel all matching workflow runs.
1 min read
delete/v2/workflows/runs
Request example
Response
delete/v2/workflows/runs
Warning
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.

For multi-value filters, a workflow run matches if its value equals any of the given values (OR logic), and multiple filters are combined with AND logic. Multiple values can be passed either by repeating the query parameter (label=label_1&label=label_2) or as a single comma-separated value (label=label_1,label_2).

Authorization

Authorizationstringheaderrequired#
QStash authentication token

1 alternative authorization method available — see the spec for details.

Query parameters

workflowRunIdsstring[]#
Optional list of specific workflow run IDs to cancel. If provided, the other filters are ignored.
workflowUrlstring[]required#
The URL of the workflow whose runs to cancel. Supports multiple values.
workflowUrlExactMatchboolean#
workflow url is searched as a prefix by default. To make it exact match, workflowUrlExactMatch can be set to true.

Default: false

fromDatenumber#
Optional start date to filter workflow runs to cancel. Unix timestamp in milliseconds.
toDatenumber#
Optional end date to filter workflow runs to cancel. Unix timestamp in milliseconds.
callerIpstring[]#
Optional caller IP address to filter workflow runs to cancel. Supports multiple values.
flowControlKeystring[]#
Optional flow control key to filter workflow runs to cancel. Supports multiple values.
labelstring[]#

Optional label to filter workflow runs to cancel. Supports multiple values. You can pass multiple values to match workflow runs with any of the given labels (OR logic).

Examples:

  • label=my_label
  • label=label_1&label=label_2
  • label=label_1,label_2
countinteger#
Maximum number of workflow runs to cancel. Default is 100.

Default: 100

Responses

application/json
200
All workflow runs cancelled successfully
cancelledinteger#
The number of workflow runs that were cancelled.