Overview
This lesson is part of the n8n AI Automation - Zero to Hero course, Section: 4. Error Handling & Debugging.
Watch the video above for the full tutorial, or read the written guide below.
What is error handling in n8n?
Error handling in n8n keeps workflows running when something goes wrong by setting fallback actions instead of stopping execution. Every n8n node exposes an "On Error" setting with three choices: stop the workflow (default), continue and pass the error as an item in the regular output, or continue and route failed items to a dedicated error output branch. Picking the right option lets you log failures, notify your team, and process remaining items without interrupting the run.
How do you configure error handling on any n8n node?
Open the node's Settings tab
The Settings tab on every n8n node holds two error-related controls: "Retry on Fail" and "On Error." Retry on Fail triggers automatic re-attempts before the node gives up, which suits temporary API outages where a second or third attempt may succeed on its own. Avoid relying on retry for permanent errors like uploading a PDF to a Notion field that only accepts images; the node fails every attempt regardless of how many retries you configure.
Choose the right On Error action
The "On Error" dropdown offers three actions. "Stop Workflow" is the default and halts execution the moment any node fails, including inside a loop. "Continue - pass error message as item in regular output" keeps execution going and injects an error property into the item, which an IF node can detect by checking whether $json.error exists. "Continue using error output" adds a second output connector directly to the node, routing failed items through a dedicated error branch so you can handle successes and failures in parallel without needing a separate IF node.
Add context to your error notifications
The error output branch carries richer context than a plain error string, including the data URL and success status from the failed iteration. Pipe those fields into your notification node so the message reads something like "error occurred in your workflow due to data in one iteration which had a URL of [PDF link]" rather than a generic "error occurred." A developer receiving that message can immediately diagnose a PDF-versus-image mismatch without re-running the workflow, and the rest of the nine-item loop completes cleanly.
Key Takeaways
- The "On Error" setting on every n8n node defaults to "Stop Workflow"; switching it to either Continue option lets a loop finish all remaining items even when one record fails.
- "Retry on Fail" is the right tool for temporary outages where a second or third attempt may resolve the issue on its own, not for permanent type mismatches.
- "Continue using error output" splits the node into two physical output connectors, eliminating the need for a separate IF node to route successes and failures.
- The error output branch surfaces contextual data beyond a raw error string, such as the URL of the failing record, giving your team actionable details instead of an abstract alert.
- Brainstorm failure scenarios before building each workflow so error paths are wired in from the start rather than retrofitted after a production crash.
Related Lessons
- Lesson 32: Master AI Automation Workflows Debugging & Error Handling with Execution Logs
- Lesson 33: How to fix AI Automation Workflows Fast in n8n | Error Handling & Debugging
- Lesson 34: Error Workflows in n8n AI Automation | Stop & Error Node | Error Trigger Node
Next Steps
Continue your n8n journey with the full n8n AI Automation - Zero to Hero course.