Argo stop workflow early, mark complete
By default, a step that exits with a non-zero exit code fails the workflow.
I would suggest writing an output parameter to determine whether the workflow should continue.
- name: yourstep container: command: [sh, -c] args: ["yourcommand; if [ -f /tmp/yourfile ]; then echo continue > /tmp/continue; fi"] outputs: parameters: - name: continue valueFrom: default: "stop" path: /tmp/continue
Alternatively, you can override the fail-on-nonzero-exitcode behavior with continueOn
.
continueOn: failed: true
I'd caution against continueOn.failed: true
. If your command throws a non-zero exit code for an unexpected reason, the workflow won't fail like it should, and the bug might go un-noticed.