Skip to main content
There are multiple ways you can cancel workflow runs:
  • Pass one or more workflow run ids to cancel them
  • Pass a workflow url to cancel all runs starting with this url
  • cancel all pending or active workflow runs

Arguments

ids
array
The set of workflow run IDs you want to cancel
urlStartingWith
string
The URL address you want to filter while canceling
all
bool
Whether you want to cancel all workflow runs without any filter.

Usage

Cancel a set of workflow runs

// cancel a single workflow
await client.cancel({ ids: "<WORKFLOW_RUN_ID>" });

// cancel a set of workflow runs
await client.cancel({ ids: ["<WORKFLOW_RUN_ID_1>", "<WORKFLOW_RUN_ID_2>"] });

Cancel workflow runs with URL filter

If you have an endpoint called https://your-endpoint.com and you want to cancel all workflow runs on it, you can use urlStartingWith. Note that this will cancel workflows in all endpoints under https://your-endpoint.com.
await client.cancel({ urlStartingWith: "https://your-endpoint.com" });

Cancel all workflows

To cancel all pending and currently running workflows, you can do it like this:
await client.cancel({ all: true });