Cancel workflow/job with graceful termination

Hi,

Is it possible to trigger some specific job after clicking on “Cancel workflow” button?
In our case workflow used to trigger tests on our environment. It start remote container which run tests.
If we cancel workflow it cancel all jobs on CircleCI side but remote container stay in run state. Is it possible to run some job after clinking on “Cancel workflow”? We can use it to sent request to remote container with test to stop it.

Thank You.

Hi, this is not possible as once you cancel a workflow from the UI then the workflow is completely cancelled, it is not possible to have a trigger for this.

The closest functionality we have at the moment is an on_fail conditional which will run a step in a job, but this is scoped to the job, rather than workflow, and also is only triggered on a failure, not on a cancel.

Please vote and comment on the idea request below which aligns to this:

https://ideas.circleci.com/cloud-feature-requests/p/circle-workflow-on-failure-lets-you-run-a-job-onfail-can-the-same-be-added-on-on

We use all votes and comments to determine our plans for upcoming features!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.