Flow Studio
Cancelling Execution
Cancel terminates the current execution immediately. Unlike pause, cancel is permanent — the execution cannot be resumed. Any nodes that were running when cancel was requested are given a 5-second grace period to complete cleanly before being forcibly terminated.
When to Cancel
- A node is stuck in a long-running operation and you need to stop it immediately
- You realise there is an error in the workflow logic and want to start over
- A loop is iterating far more than expected
- A suspended (HIL) node is no longer relevant and should not be completed
Cancel Sequence
1
Client Sends Cancel Request
POST /api/v1/process-engine/executions/{id}/cancel
2
CancellationToken Signalled
The backend sets the CancellationToken passed to all running node executors. Well-implemented executors check this token and stop gracefully.
3
Grace Period (5s)
Running nodes are given 5 seconds to complete their current operation. After that, they are forcibly terminated.
4
Execution Marked Cancelled
The execution record is marked Cancelled in the database. All pending nodes show as Skipped. Running nodes show as Failed with reason "Cancelled".
Cancel vs Pause Comparison
| Aspect | Pause | Cancel |
|---|---|---|
| Resumable? | Yes | No |
| Execution memory preserved? | Yes | Partial (up to cancellation point) |
| Effect on running node | Waits for it to finish | Signals cancellation, 5s grace period |
| Final status | Paused (temporary) | Cancelled (permanent) |
| Re-run after? | Resume or Run Again | Run Again only (new execution) |
Cancellation Is Permanent
There is no undo for cancellation. If you need to be able to stop and continue later, use Pause instead.