VMware Cloud Community
VaultTec13
Contributor
Contributor

Canceling a workflow

Hello Everyone.

I have a main workflow that is responsible for calling sub workflows to run in parallel. The main workflow holds token for each sub workflow and wait for them to finish.
Recently I've made a mistake and had to cancel the workflow right after I started it, the problem was the the sub workflows had been called already and I had to cancel each one separately.
Is there any way for me to do it?(Cancel the main workflow and the sub workflows by only canceling the main one)

There must be a way to perform some cleanup actions before the workflow is canceled.

Thanks in advance,

Dan.

Reply
0 Kudos
2 Replies
iiliev
VMware Employee
VMware Employee

AFAIK, there is nothing out of the box for such scenario.

But you can collect the sub workflow tokens into attribute inside the main workflow, and to write a helper workflow/action that will accept as an input the list of these workflows and cancel all of them.

So, instead of directly cancelling the main workflow, you can invoke this helper workflow/action and pass the list of tokens you want to cancel (main token + sub tokens) to it and it will do the batch cancellation.

VaultTec13
Contributor
Contributor

Thank you sir!

Reply
0 Kudos