Cancelling Workflow Executions

It is possible to cancel an execution whose status is either pending or started.

There are two types of execution cancellations:

Usually, this is the recommended way to cancel an execution, since while it doesn’t make any guarantees, it allows for a workflow to cancel its execution gracefully - whether by performing a rollback, cleaning up resources, or any other actions that it may take before stopping.

This type of cancellation may be used over an execution which is already in cancelling status, and indeed, its main purpose is to be used for workflows which don’t support Standard cancellation or when the Standard cancellation is stuck or is taking too long. It may also be used when it’s needed to simply stop an execution immediately.

Warning

When the execution’s status changes to cancelled, it means the workflow execution has completed, meaning no new tasks will be started; However, tasks that have already been started might still be executing on agents. This is true for both Standard and Forced cancellations.


Cancelling an execution whose ID is SOME_EXECUTION_ID from the CLI can be done using the following command:

cfy executions cancel SOME_EXECUTION_ID

To use force-cancellation instead, simply add the force flag. For a syntax reference, see the CLI commands reference.