Master Error Handling in n8n | Build Reliable n8n Workflows That Don't Break

Learn Master Error Handling in n8n | Build Reliable n8n Workflows That Don't Break in this comprehensive n8n tutorial. Step-by-step guide with video, code examples, and expert tips from the n8n Zero to Hero course.

Table of Contents

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.

Next Steps

Continue your n8n journey with the full n8n AI Automation - Zero to Hero course.

Frequently Asked Questions

'Continue - pass error message as item in regular output' injects an error property into the regular data stream, requiring a downstream IF node to split successful and failed items by checking whether `$json.error` exists. 'Continue using error output' adds a second physical connector to the node itself, routing failures to a dedicated branch automatically and including richer context like the data URL and status of the failed item, with no extra IF node needed.

'Retry on Fail' is appropriate for temporary errors such as an API being momentarily unavailable, where a second or third attempt may succeed on its own. It is not useful for permanent errors like sending a PDF to a Notion field configured to accept only images; in those cases, every retry fails identically and only adds delay before the node finally throws the error.

The IF node reads a `$json.error` property that n8n injects into the item when 'On Error' is set to 'Continue - pass error message as item in regular output.' Set the IF condition to check whether that field exists; items carrying the property route to the true branch for error handling such as sending a notification, while clean items route to the false branch to continue processing normally.

n8n's default 'On Error' action is 'Stop Workflow,' which halts execution the moment any node fails, including mid-loop. Changing the failing node's 'On Error' setting to either Continue option lets the Loop Over Items node keep processing remaining records, so eight out of nine uploads can complete successfully even when the fifth item throws a bad-request error.

Dheeraj Sharma

Dheeraj Sharma

AI Systems Builder
Creator of the n8n Zero to Hero course (42 lessons, 31+ hours). I help solopreneurs build AI systems that grow revenue without growing workload.

Get the n8n Mastery Bundle

All workflows, cheat sheets, and premium resources from the entire course in one package.

Get Premium Resources