> ## Documentation Index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk Cancel Workflow Runs

> Cancel all matching workflow 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.</Warning>

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.


## OpenAPI

````yaml /workflow/openapi.yaml delete /v2/workflows/runs
openapi: 3.1.0
info:
  title: Upstash Workflow REST API
  description: >
    Upstash Workflow is a serverless workflow orchestration service built on top
    of Upstash QStash and Upstash Redis.
  version: 2.0.0
  contact:
    name: Upstash
    url: https://upstash.com
servers:
  - url: https://qstash.upstash.io
security:
  - bearerAuth: []
  - bearerAuthQuery: []
paths:
  /v2/workflows/runs:
    delete:
      tags:
        - Runs
      summary: Bulk Cancel Workflow Runs
      description: Cancel all matching workflow runs.
      parameters:
        - in: query
          name: workflowRunIds
          required: false
          schema:
            type: array
            items:
              type: string
          description: >-
            Optional list of specific workflow run IDs to cancel. If provided,
            the other filters are ignored.
        - in: query
          name: workflowUrl
          required: true
          schema:
            type: string
          description: The URL of the workflow whose runs to cancel.
        - in: query
          name: workflowUrlExactMatch
          required: false
          schema:
            type: boolean
            default: false
          description: >-
            workflow url is searched as a prefix by default. To make it exact
            match, `workflowUrlExactMatch` can be set to true.
        - in: query
          name: fromDate
          required: false
          schema:
            type: number
            format: date-time
          description: >-
            Optional start date to filter workflow runs to cancel. Unix
            timestamp in milliseconds.
        - in: query
          name: toDate
          required: false
          schema:
            type: number
            format: date-time
          description: >-
            Optional end date to filter workflow runs to cancel. Unix timestamp
            in milliseconds.
        - in: query
          name: callerIp
          required: false
          schema:
            type: string
          description: Optional caller IP address to filter workflow runs to cancel.
        - in: query
          name: flowControlKey
          required: false
          schema:
            type: string
          description: Optional flow control key to filter workflow runs to cancel.
        - in: query
          name: label
          required: false
          schema:
            type: string
          description: Optional label to filter workflow runs to cancel.
        - in: query
          name: count
          required: false
          schema:
            type: integer
            default: 100
          description: Maximum number of workflow runs to cancel. Default is 100.
      responses:
        '200':
          description: All workflow runs cancelled successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  cancelled:
                    type: integer
                    description: The number of workflow runs that were cancelled.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: QStash authentication token
    bearerAuthQuery:
      type: apiKey
      in: query
      name: qstash_token
      description: QStash authentication token passed as a query parameter

````