How-to
n8n error workflow for lead intake: a 3-hour plan
An n8n error workflow for lead intake turns a silent failed execution into an alert you can act on, and a dedupe key stops the retry writing twice. This is a build plan from n8n's own documentation: one key per lead, node retries, an error handler, and about three hours of work.
A webhook fires, the CRM write returns a 500, and the execution stops there. n8n defines fault tolerance as a system that keeps working when a component fails.
Does n8n retry a failed workflow automatically?
No. A node retries only if Retry On Fail is on, and a failed execution retries only when someone opens the Executions list and clicks it.
The retry is not a clean do-over either. n8n's execution docs say it resumes from the saved execution state: the failed node reprocesses every item, including ones it already handled. The docs point to update-style operations such as Insert or Update instead.
So the retry meant to save a lead is what writes it twice.
What is the n8n error workflow for lead intake?
In order: an alert on failure, a dedupe key before any write, a search-then-branch lookup, and Retry On Fail on the write nodes.
- An error workflow. A separate workflow starts with an Error Trigger, set in Workflow Settings, and alerts you with the execution URL. One handler can serve every workflow;
execution.idandexecution.urlarrive only once the execution is saved to the database. - A key before any write. A Code node builds one key per lead from the form and the email.
- Search, then branch. Look the key up in the CRM: update if it exists, create if not. Same idea as retries without duplicates on a rate-limited API.
- Retry On Fail on the write nodes. The docs cap Max Tries at five and Wait Between Tries at 5,000 ms; the HTTP Request node does not honour a Retry-After header on its own.
// one key per lead
const email = ($json.email || '').trim().toLowerCase();
const form = $json.form_id || 'web';
return [{ json: { ...$json, lead_key: `${form}:${email}` } }];
What to add for each failure mode
| What fails | What n8n does | What you add |
|---|---|---|
| CRM returns 429 | the node errors | Retry On Fail, five tries |
| CRM returns 500 mid-run | execution stops, sits in the log | error workflow, alert plus execution URL |
| Retry succeeds on the second try | failed node reprocesses every item | key lookup, update instead of create |
| The trigger node itself fails | no execution id or URL to alert with | checks from outside n8n |
How to build it in about three hours
- Map nodes that write outside n8n: about 20 minutes.
- Add the key node, search, and branch: about 40 minutes.
- Turn on Retry On Fail for the write nodes: about 20 minutes.
- Build the error handler workflow and attach it: about 40 minutes.
- Break a copy, retry it from the Executions list, and confirm one record, not two: about 30 minutes.
- Write the runbook: who is alerted, who replays it: about 30 minutes.
What it is worth on your own numbers
Run it on your inputs: leads a month (L), the share of intake runs that end in an error (E), and average closed value (V). Multiply L by E to see about how many leads land nowhere each month, and one of them closing at V pays for the three hours. If your error rate has been near zero across recent executions, spend the time on two hours of pipeline monitoring instead.
Limitations
- Retries and an error workflow are recovery, not prevention. n8n advises bounding retries and pairing them with idempotency keys where the API supports them.
- Queue mode is a different problem: the docs describe the main instance taking triggers and webhooks while Redis queues executions for workers, which is scale, not duplicate prevention.
- I have not run this exact build end to end. The steps come from the pages linked above, and every time is an estimate.
My take
Build the catch before the retry. An alert with an execution URL costs about 40 minutes and tells you a lead went missing; a retry without a key is a quiet promise to write everything twice. If you do one thing this week, attach an error workflow to intake and see what it catches by Friday.
Questions people ask
Does n8n retry a failed workflow automatically?
No. A node retries by itself only when Retry On Fail is enabled, and the docs limit it to five tries with up to 5,000 ms between them. A failed execution has to be retried from the Executions list or triggered from code.
What is an error workflow in n8n?
It is a separate workflow that starts with the Error Trigger node and is selected in Workflow Settings. The docs say it runs if an execution fails, and the same handler can serve several workflows.
Why does my n8n retry create duplicate records?
Because the retry resumes from the saved execution state and the failed node processes every item again, including the items it already handled before failing. The docs suggest update-style operations such as Insert or Update, which is why a dedupe key belongs in the flow before any write.
Have a process like this leaking time or leads?Thirty minutes, no deck, and you leave with a plan.
Book a call