Skip to main content
The Cancel node stops in-flight journey runs from inside a flow. You can also cancel from your own code with the cancel API, so you don’t need a Cancel node in the journey to stop a run. Either way, you target runs one of two ways: a single run by its run_id, or a group of runs by a shared cancellation token. Courier only cancels active runs, and canceling is idempotent, so a run that has already finished or errored is left untouched.

Cancel a Single Run

The simplest case. Use the runId returned when you invoke a journey and call POST /journeys/cancel with a run_id:
curl -X POST https://api.courier.com/journeys/cancel \
  -H "Authorization: Bearer $COURIER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "run_id": "1-67ab1234-a1b2c3d4e5f6" }'
import Courier from "@trycourier/courier";

const client = new Courier({ apiKey: "your_api_key" });

await client.journeys.cancel({ runId: "1-67ab1234-a1b2c3d4e5f6" });
from courier import Courier

client = Courier(api_key="your_api_key")

client.journeys.cancel(run_id="1-67ab1234-a1b2c3d4e5f6")
It returns 202 with the run_id and its resulting status:
StatusMeaning
CANCELEDThe run was active (or already canceled), and is canceled.
PROCESSEDThe run had already finished; nothing changed.
ERRORThe run had already ended in an error; nothing changed.
A run_id Courier can’t find for your workspace returns 404.

Cancel a Group with a Cancellation Token

A cancellation token is an addressing key you attach to runs, so you can cancel a whole set by a business identifier without tracking individual run IDs. How you build the token decides what it covers:
  • order-{{data.order_id}} cancels the runs for one order
  • user-{{profile.id}} cancels every run for a user, even across different journeys
  • black-friday-2026 cancels an entire campaign
Set the token in the journey’s settings. It’s templated, so you build it from run data with {{data.…}}, {{profile.…}}, or {{recipient}}. Use a dynamic value so the token maps to the runs you mean, not every run of the journey.
If a token references a variable that isn’t present when a run starts, the run is created without a token. It won’t be cancelable by token, but you can still cancel it by run ID.
Once runs are tagged, cancel the token two ways:
  • From your code — call POST /journeys/cancel with a cancelation_token (spelled with one L), or client.journeys.cancel({ cancelationToken: "order-1234" }). It returns 202 with the token.
  • From a Cancel node — add a Cancel node and set its Cancelation Token. When a run reaches the node, Courier cancels every active run sharing that token. This is how one path cancels another: an “invoice paid” branch routes to a Cancel node set to invoice-{{data.invoice_id}}, stopping that invoice’s remaining reminders.
POST /journeys/cancel takes exactly one of run_id or cancelation_token; sending both or neither returns 400. See the cancel journey runs reference for the full schema.

What’s Next

Send Node

Deliver messages on a channel, or run an experiment

Building Your Journey

Add branching, delays, and enrichment between sends

Starting a Journey

Trigger runs by API or Segment event