capabilities.work

Cancellable Workflow Trigger

A 3-step recipe with Knock. We can help you get access.

Recipe · 3 steps

Cancellable Workflow Trigger

with Knock
Works with AI assistants

Trigger a workflow with a cancellation key and then cancel it.

  1. Upsert the recipient so the workflow has a valid user to target.
  2. Trigger the workflow for the recipient with a cancellation key so the queued run can be cancelled before it sends.
  3. Cancel any queued runs for the workflow key and cancellation key, scoped to the single recipient. A 204 indicates the cancellation was accepted.
What you'll need to have ready
  • apiKey: Knock secret API key (sk_...) used as a Bearer token.
  • userId: The unique identifier of the recipient.
  • email: The primary email address to set on the user.
  • workflowKey: The key of the workflow to trigger and cancel.
  • cancellationKey: A unique key used to reference and later cancel the trigger.
  • data: Optional data payload passed into the workflow run.
For your developer

Arazzo workflow knock-app:cancellable-workflow-trigger, 3 operations: identifyUser → {$sourceDescriptions.workflowsApi.url}#/paths/~1v1~1workflows~1{key}~1trigger/post → cancelWorkflow. Specs on APIs.io.