Your workflow ran fine for a week. Then an external API returned an error and the whole execution stopped halfway. How do you keep one error from breaking everything, and make sure you actually find out about it?
Three levels of error handling:
- Retry On Fail: in the node's Settings tab you turn on retries. You set Max Tries and Wait Between Tries (ms). Good for temporary issues, e.g. an HTTP Request to an API that sometimes hiccups.
- On Error: also in Settings. The default is “Stop Workflow”. “Continue” keeps going despite the error, and “Continue (using error output)” adds a separate error output that you handle with your own branch, e.g. a notification.
- Error Workflow and Error Trigger: a separate workflow that starts when another workflow fails. You select it in the workflow settings in the Error Workflow field and send yourself a message with the workflow name and the error description.
Watch out for:
- Retry also repeats actions with side effects. With sending an email or creating an order you may end up with a duplicate.
- “Continue” without an error branch hides the problem: the workflow looks successful while data silently disappears.
- An Error Workflow won't run if nobody assigned it. Just having a workflow with an Error Trigger is not enough.
Rule of thumb: retry what is temporary, handle what is predictable with a branch, and report the rest through an Error Workflow.
Upcoming meetups and workshops are listed in the Events section.