Back to Workflows FAQs
HELP CENTER · FAQWorkflows1 min read

How should a workflow handle a cancellation request mid-process?

Cancellation is easiest to reason about when the workflow defines which steps can still stop, which side effects have already occurred, and what result the caller receives. A cancellation signal does not automatically undo completed work or guarantee that an in-flight operation stopped.

Workflows

Define cancellation points

Check for cancellation between safe steps and before starting consequential work. For a long-running step, confirm whether the underlying service supports cancellation and how it reports a race where completion and cancellation happen together.

If earlier steps created resources or sent external actions, decide whether cancellation means leaving them in place, cleaning them up, or performing a compensating action. Do not imply full rollback when some effects cannot be reversed.

Make the final state clear

Represent cancelled, completed, failed, and partially completed outcomes distinctly. Return a stable operation identifier so a caller can check status rather than starting a duplicate process after losing the response.

Record which steps completed and any cleanup still required. Test cancellation before, during, and after side effects, then document how operators safely resume or reconcile partially completed work.

Back to Workflows FAQs