- Payment received — A payment-received event triggers a workflow whose Cancel Workflow node stops the invoice reminders for that invoice and customer. (Filters: Workflow Slug + Recipient + Cancellation Key.)
- Slot change — A booking slot moves. The slot-change event triggers a workflow whose Cancel Workflow node stops the old slot’s reminders, and a fresh workflow starts reminders for the new slot. (Filters: Recipient + Cancellation Key.)
- Approval received — A purchase request needs approval from any one of several admins. One workflow sends recurring reminders to every approver (one execution per admin, all tagged with the same
request_id). One admin approves, triggering a workflow whose Cancel Workflow node stops every reminder execution matching thatrequest_id, so the remaining admins stop being reminded. (Filter: Cancellation Key only.)
How it works
- You drag a Cancel Workflow node from the Functions group onto the canvas (next to Invoke Workflow).
- In the config panel, you add one or more filters — Workflow Slug, Recipient(s), Cancellation Key. All filters are ANDed: a running execution must match every filter you added.
- On the target workflow’s Trigger node, you set an optional Cancellation Key (a JSONNET expression such as
data.booking_id), or pass a literalcancellation_keystring in the workflow trigger payload. SuprSend stores the resolved value on the running execution, so the Cancel Workflow node can match against it. - At runtime, when execution reaches the Cancel Workflow node, SuprSend finds every running execution matching all the filters and cancels them. If zero executions match, it’s a silent success — the cancelling workflow carries on to the next node.
- Messages that already left SuprSend are not recalled. Cancellation stops the currently running execution — nodes that have already run stay run, and the messages they sent stay sent.
Configuring the Cancel Workflow node
Open the Cancel Workflow node’s config panel and click + Add Filter. Add one filter at a time; every filter you add gets ANDed with the others. At least one filter is required — SuprSend won’t let you save the node with none. You can combine up to three.
Adding a filter in the Cancel Workflow config panel
JSONNET expression format
Where a filter takes a JSONNET expression (the Recipient’s Input Payload option and the Cancellation Key), reference workflow data as follows — the same format used across other workflow fields such as Invoke Workflow.Common filter combinations
Which filters you combine depends on how precisely you need to target what to cancel. Two common shapes: 1. Workflow Slug + Recipient(s) — cancel one user’s runs of a workflow. Useful when a user hits the goal a drip was pushing them towards and the remaining nudges no longer make sense for that user specifically. For example, when a user completes onboarding, anonboarding_completed event fires and triggers a workflow that stops the onboarding reminders for that user.
onboarding-sequence are halted. Every other user still in the sequence keeps going, and every other workflow the user is in (billing emails, product notifications) is untouched.
2. Cancellation Key only — cancel every workflow tied to a specific entity. Useful when an entity has gone away and you want everything keyed to it to stop, across every workflow at once — for example a booking is cancelled, and reminders, confirmations, and follow-up workflows all keyed to the same booking_id should all halt.
data.booking_id is halted. For this to work, each target workflow has to have set its cancellation_key on the Trigger node (or had one passed in the workflow trigger API payload) so the match has something to compare against.
Setting the Cancellation Key on the target workflow
For a Cancel Workflow node to match on something more specific than slug + recipient — for example “cancel the reminders for this booking” — the target workflow has to declare what makes one of its runs cancellable. You do that on the Trigger node of the target workflow, in the Cancellation Key field at the bottom of the form.
Cancellation Key field on the target workflow's Trigger node
data.booking_id— cancel one booking’s reminders.data.request_id— cancel all approver reminders for one request.data.order_id— cancel the post-purchase nudges for one order.
Passing a cancellation key directly in the trigger payload
Instead of setting an expression on the Trigger node, you can pass a literalcancellation_key string at the top level of any trigger payload — direct workflow trigger, event trigger, list broadcast, and workflow test run all accept it. See the workflow trigger payload schema.
cancellation_key, SuprSend uses it as-is. Only when the payload doesn’t carry one does SuprSend evaluate the JSONNET expression on the Trigger node. The resolved value (whichever source) is stored on the execution and max 512 characters long; longer values are truncated.
Execution behaviour
What gets cancelled
- Nodes that haven’t started yet — don’t execute.
- Nodes in a waiting state (delay, batch, digest, time window) — are interrupted immediately. The execution’s status moves to
cancelled. - Messages already dispatched are not recalled. Cancellation stops the currently running execution; steps that have already completed stay completed.
Logs on the cancelling workflow
On the canvas, the Cancel Workflow node shows a one-line “Cancels: ” subtitle so you can see what it targets without opening the panel. Once the node runs, its execution history records how many executions it matched and lists their ids.
Execution history for a Cancel Workflow node — summary line, matched execution ids, and the filters used
cancelled_count is zero or many, the cancelling workflow continues to the next node — the Cancel Workflow node is fire-and-forget.
Logs on the cancelled workflow
Each execution that got cancelled shows:- Execution status:
cancelled(terminal). - Interrupted node: if a delay, batch, digest, or time window was open when the cancel landed, the log records how much time was remaining when it was interrupted.
cancelled_exec_ids field on the Cancel Workflow node lists every execution it stopped.
Patterns and edge cases
Frequently Asked Questions
Does cancellation stop messages that have already been sent?
Does cancellation stop messages that have already been sent?
What happens if the cancel node matches zero executions?
What happens if the cancel node matches zero executions?
cancelled_count: 0 with an empty cancelled_exec_ids list, and the cancelling workflow continues to the next node. There’s no error branch — the cancel node is fire-and-forget.Do I always need to set a Cancellation Key on the target workflow's Trigger node?
Do I always need to set a Cancellation Key on the target workflow's Trigger node?
data.booking_id as the Cancellation Key on the Trigger node and match on it in the Cancel Workflow node.You can also skip the Trigger-node field and pass a literal cancellation_key string in the workflow trigger API payload instead. When both are present, the payload value wins.Can I cancel the workflow I'm currently in?
Can I cancel the workflow I'm currently in?
If I cancel a workflow that itself has Cancel Workflow nodes, do those nodes still fire?
If I cancel a workflow that itself has Cancel Workflow nodes, do those nodes still fire?
Can the cancel node branch on how many executions it stopped?
Can the cancel node branch on how many executions it stopped?