Stop a Workflow Run

< All Topics


Stopping or cancelling a workflow run is achieved by cancelling all the workflow nodes that have ‘Queued’ or ‘Running’ statuses. If all possible branches of the workflow are ‘Cancelled’ or ‘Failed’ then the WorkflowRunStatus will automatically be updated to Failed and execution of the workflow run will stop. The workflow can be resumed by restarting the ‘Cancelled’ or ‘Failed’ node(s) by updating the node status to ‘Queued’ via the BLAM API.

Cancelling a Workflow Node

A workflow node can be cancelled by sending a PUT request to /api/workflows/runs/nodes. The PUT body should contain a JSON object with the Id set to the node Id to be updated and the status field set to ‘Cancelled’:

Example Body:

    "Id": 1,
    "Status": "Cancelled"

curl -H "Authorization: Bearer ${TOKEN}" -X PUT -H "Content-Type: application/json" --data "{ "Id": 1, "Status": "Cancelled" }"

To confirm the new overall workflow status, a new GET request can be sent to /api/workflows/runs/{id} where {id} is the Id of the workflow run.

curl -H "Authorization: Bearer ${TOKEN}"