> ## Documentation index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Ask it with GET https://upstash.com/docs/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.
> Feature requests: https://upstash.com/docs/common/help/feature-requests.md lists what users asked for and how to vote for a request or add one.
> Page rating: `GET https://upstash.com/docs/feedback?path=/docs/workflow/howto/cancel&helpful=true` (or `false`) records whether this page helped. An optional `comment` (URL-encoded, at most 500 characters) says what was missing or wrong. It is anonymous and needs no key. Comments hold no code, secrets or personal data.

# Cancel a Run

You can cancel a running workflow both programatically and from your Upstash Workflow console.

## Cancelling via console

In your Upstash Workflow console, find the run you'd like to cancel and press the `Cancel Workflow` button on the right side:

<Frame>
  <img src="/img/qstash-workflow/cancel_workflow.png" alt="Cancel a workflow run in the Upstash Console" />
</Frame>

## Cancelling in bulk

To cancel many runs at once, filter the `Logs` tab down to the runs you want
and pick **Cancel** from the **Bulk actions** menu. QStash cancels every running
workflow that matches the filters in the background.

The **History** button next to the menu lists each bulk cancellation with its
state, the filters used and the number of runs cancelled, so you can follow an
operation while it runs or look it up later by its action ID. The same is
available through the [bulk cancel workflow runs](/workflow/api-reference/runs/bulk-cancel-workflow-runs)
endpoint with `"async": true`, and the
[bulk actions](/workflow/api-reference/bulk-actions/list-bulk-actions) endpoints.

<Frame caption="The bulk action history panel">
  <img src="/img/qstash/bulk-actions-history.jpg" alt="Bulk action history panel in the Upstash Console" />
</Frame>

## Cancelling programatically

<Note>
  This feature is not yet available in
  [workflow-py](https://github.com/upstash/workflow-py). See our
  [Roadmap](/workflow/roadmap) for feature parity plans and
  [Changelog](/workflow/changelog) for updates.
</Note>

```javascript
import { Client } from "@upstash/workflow";

const client = new Client({ token: "<QSTASH_TOKEN>" });
await client.cancel({ ids: "<WORKFLOW_RUN_ID>" });
```

And replace `<WORKFLOW_RUN_ID>` with your actual run ID. See [the documentation of `client.cancel` method for more information about other ways of canceling workflows](/workflow/basics/client/cancel).

You can also use the [Upstash Workflow REST API](/workflow/api-reference/runs/cancel-workflow-run) to cancel a run programatically.
