Skip to main content

WORKEASIER implementation guide · 8 min read

n8n error handling: retries, error workflows and fallbacks

Updated

Most n8n workflows are built for the case where every API answers quickly and correctly. In production, APIs time out, rate-limit, return a 500 or answer with data the next node cannot read. Error handling decides whether that becomes a silent gap in your data or a recoverable, visible event. This guide covers the layers n8n gives you and how to combine them.

Decide what failure should mean for each node

Not every failure deserves the same response. A failed enrichment lookup might be acceptable — the lead continues with less context. A failed write to your CRM or helpdesk is not: the work is lost unless someone knows about it. Before adding retries, sort the nodes in a workflow into three groups.

  • Optional: the workflow can continue without the result (enrichment, logging to a secondary tool).
  • Retryable: a transient failure is likely and a second attempt is safe (most read requests, idempotent writes).
  • Critical: failure must stop the item and alert a person, or move it to a queue for later processing.

Layer 1: Retry On Fail for transient errors

Every node's Settings tab has a Retry On Fail option with a maximum number of tries and a wait between tries. It is the right tool for timeouts, brief network failures and occasional 429 or 5xx responses from APIs such as Anthropic, Brandfetch or Zendesk.

Retries are only safe when repeating the request cannot cause a second side effect. Retrying a read is harmless. Retrying a request that sends a Slack message or posts a public ticket reply can produce duplicates if the first attempt actually succeeded but the response was lost. For those nodes, combine retries with an idempotency key — see the guide on preventing duplicate webhook executions.

Layer 2: the On Error setting and error outputs

The On Error setting controls what happens once retries are exhausted. Stop Workflow is the default and ends the execution. Continue passes the item on as if nothing happened, which is usually wrong for anything important because downstream nodes then process incomplete data.

Continue (using error output) adds a separate error branch to the node. This is the most useful option for AI workflows: the failed item flows into its own path where you can log it, apply a fallback (for example, route a lead to manual review when scoring fails) or write it to a retry queue. The happy path stays clean and the failure path is explicit and testable.

Layer 3: validate AI output, then fail loudly

Language models fail differently from APIs: the HTTP request succeeds, but the content is wrong. A missing field, a score outside the expected range or text where JSON was expected will not trigger any of n8n's error settings by itself.

Add a validation step directly after each model call — a Code node or an If node that checks the fields the next node needs. When validation fails, retry the model call a limited number of times, then use a Stop and Error node or route the item to a fallback branch. The WORKEASIER lead module uses this pattern: a parsing step checks Claude's structured assessment before routing, with retry and fallback paths if it does not parse.

Layer 4: an Error Trigger workflow for everything else

An error workflow is a separate workflow that starts with the Error Trigger node. In a production workflow's settings, select it as the Error Workflow, and n8n runs it whenever an execution of that workflow fails. It receives the failed execution's ID and URL, the workflow name, the last node executed and the error message.

Use it to notify the right channel with a direct link to the failed execution, and to record the failure somewhere durable. One error workflow can serve many production workflows. Note that it covers failed executions of active workflows; test it by triggering a real failure in a test copy rather than only running it manually.

Keep a fallback record a person can act on

An alert that says “workflow failed” is not enough to recover. Store the input that failed, the step, the error and enough identifiers to retry or complete the work by hand. The WORKEASIER support module writes failed deliveries to a fallback queue so a ticket does not disappear when an integration is unavailable.

Review that queue regularly. A growing fallback queue is an early warning that a prompt, API or credential has changed — usually long before anyone complains.

Test the failure paths on purpose

Error handling that has never run is a guess. Point a node at a test endpoint that returns a 500, use an invalid credential in a copy of the workflow, or feed the validation step deliberately malformed model output. Confirm that each failure reaches the intended branch, that retries stop at the configured limit, and that the alert links to the right execution.

Frequently asked questions

What is the difference between Retry On Fail and an error workflow in n8n?
Retry On Fail repeats a single node's request when it fails, which handles transient errors inside the execution. An error workflow runs after an execution has failed, so it is for alerting and recording failures that retries could not fix.
Should I set On Error to Continue?
Rarely. Plain Continue passes incomplete data to the next nodes as if the step succeeded. Continue (using error output) is usually better, because it sends failed items to a separate branch you can handle explicitly.
Does n8n detect when an AI model returns invalid JSON?
Not automatically when the request itself succeeds. Add a validation step after the model call, then retry, stop with an error or route to a fallback when the output does not have the fields the next node needs.