How to call a step (doing revert) if any previous step fails?

Viewed 603

I have the Argo WorkflowTemplate which has n steps.

I want to call last step only if any of the previous step fails.

Example: In a 5 steps templates, if 2nd fails, skip 3 and 4 and only call 5 since its a revert step. If all are passed, don't call 5th because there is no need to revert.

1 Answers

You can define a workflow exit handler to run after all the other steps.

By adding a when condition, you can make sure the exit handler runs if and only if one of the previous steps failed.

Related