I have a 5 steps Argo-workflow: step1: create an VM on cloud step2: do some work step3: do some more work step4: do some further work step5: delete the VM
All the above steps are time consuming. And for whatever reasons, a running workflow might be stopped or terminated by issuing the stop/terminate command.
What I want to do is, if the stop/terminate command is issued at any stage before step4 is started, I want to directly jump to step4, so that I can clean up the VM created at step1.
Is there any way to achieve this? I was imagining it can happen this way:
- Suppose I am at step2 when the stop/terminate signal is issued.
- The pods running at step2 gets a signal that the workflow is going to be stopped.
- The pods stop doing their current work and outputs a special string telling the next steps to skip
- So step3 sees the outputs from step2, skips its work and passes it on to step4 and so on.
- step5 runs irrespective of the input and deletes the VM.
Please let me know if something like this is achievable.