After this lesson, you will be able to: Add error handling, retry logic, and observability to n8n workflows so they survive contact with real APIs and don't silently fail.
The difference between an amateur n8n workflow and a production one is what happens when a node fails. This lesson covers error workflows, retries, conditional handling, and the alerting pattern every serious n8n operator uses.
Recruiters can spot the difference between a candidate who built a happy-path workflow and a candidate who handled the 5% of real-world failures. Rate limits, network blips, malformed payloads, expired tokens, partial sends, all happen in production. If your workflow stops dead on the first hiccup, it's a demo. If it retries, escalates, and notifies you, it's an automation.
n8n has built-in retry on the node settings tab. Use it.
Open any HTTP Request, Slack, Gmail, etc. node
Settings tab > Retry On Fail: ON
Max Tries: 3 (typical), Wait Between Tries: 2000ms
For APIs with rate limits, set Wait to a value that respects the rate limit (Anthropic: 1s; many SaaS: 1000-5000ms)
For flaky downstream services, also enable the Continue (using error output) option so the workflow keeps running on failure
Every important n8n workflow should have an attached error workflow that fires when anything blows up.
Create a NEW workflow called 'global-error-handler'
Start node: Error Trigger
First node after trigger: extract the error payload (workflow name, node name, error message, timestamp, run URL)
Add a Slack node that posts to your #ops or #alerts channel with the structured error
Optional: write to a Google Sheet or Postgres for audit history
Go back to your real workflow: Settings (gear icon) > Error Workflow > pick global-error-handler
Test by intentionally breaking a node (set a bad API key) and confirming you get the Slack message
For non-fatal errors you want to handle inline (not fall through to the error workflow), use the error output of a node.
// Pattern: HTTP Request -> If success use it, if error log it// In n8n's expression editor on the next node's input:// Check whether the previous node errored{{ $node["HTTP Request"].error ? "FAILED" : "OK" }}// Branch with an IF node based on that// Then route the success branch to your normal logic// and the failure branch to a Slack/Gmail/log node// For retry-with-backoff in code nodes:// (Code node, JavaScript)for (let attempt = 1; attempt <= 3; attempt++) {try {const r = await $http.request({ method: 'POST', url: $json.url, body: $json.body });return [{ json: r }];} catch (e) {if (attempt === 3) throw e;await new Promise(r => setTimeout(r, attempt * 2000));}}
Catching every error silently. You'll never know your workflow is broken. Alert at least once per error class. Retrying indefinitely. After three failures, escalate to a human instead of looping forever. Forgetting partial state. If a 5-step workflow fails on step 4, what happens on retry? Design for replay safety. Not testing the error workflow itself. The error path is the path that fires when everything else has gone wrong; test it by intentionally breaking nodes.
Pick the most professional handler.
Sign in and purchase access to unlock this lesson.