Automation fails quietly. That is its defining operational characteristic and the reason an automation programme can look fine for months while losing data.
A person who cannot complete a task tells someone. A workflow that errors at 3am writes a log entry nobody reads, and the record it was processing simply does not exist anywhere downstream. Three weeks later someone asks why a customer never got their invoice.
Classify the failure
Different failures need different responses, and treating them identically is the root of most bad error handling.
Transient. A timeout, a rate limit, a brief service outage, a network blip. The same request would probably succeed in thirty seconds. Retry these.
Permanent. Invalid data, a missing required field, a deleted record, a rejected authorisation. Retrying produces the same failure forever. Do not retry; route to a human.
Ambiguous. A 500 from a third party could be either. Retry a bounded number of times, then treat as permanent.
Workflows that retry everything hammer a failing service and fill logs. Workflows that retry nothing fall over on a momentary blip. The distinction is the whole point.
Retry with backoff
Retry transient failures on an increasing delay — a few seconds, then longer, then longer again, with a cap on attempts.
Immediate retries in a tight loop make things worse. If a service is rate-limiting you, retrying instantly guarantees another rate-limit response and may extend the block.
Add a small random jitter to the delay. Without it, every workflow that failed during an outage retries simultaneously the moment it recovers, producing a second outage.
Idempotency
The most important and most skipped concept here.
If a workflow creates an invoice and then times out waiting for the response, did the invoice get created? You do not know. Retrying might create a second one.
Idempotency means an operation can run twice without doing the work twice. Implement it by sending a unique key with each request that the receiving system uses to deduplicate, or by checking whether the record already exists before creating it.
Any workflow that creates records, sends messages or moves money needs this. Without it, your retry logic is a duplication machine.
Dead-letter handling
When something fails permanently, it needs somewhere to go other than a log file.
A dead-letter queue — a table, a spreadsheet, a task list — holds the failed item with:
- The original payload
- What step it failed at
- The error message
- When it happened
- A way to retry after fixing the cause
This converts "a record vanished" into "there are four items waiting for someone to look at." The second is a manageable operational state; the first is a problem you discover from a customer.
Review the dead-letter queue regularly. A queue nobody reads is a log file with extra steps.
Alerting
Someone needs to learn about failures without checking a dashboard.
Set a global error handler. In n8n this is an error workflow applied by default; most platforms have an equivalent. Without it, a workflow that has been failing for three weeks looks identical to one that is working.
Alert to a channel people watch. Slack or email, not a dashboard someone opens monthly.
Include useful context. Workflow name, the record involved, the error, a link to the execution. An alert saying "workflow failed" sends someone on a search.
Group related failures. When a third-party API goes down, two hundred individual alerts train people to ignore alerts. Aggregate: "47 executions failed in the last 10 minutes — connection refused."
Name an owner. Every workflow needs a person who receives its alerts. Alerts to a shared inbox with no owner get ignored by everyone equally.
Validate early
Much error handling becomes unnecessary if bad data never enters the workflow.
Validate inputs at the first step: required fields present, types correct, values in range, references resolvable. Reject early with a clear reason rather than failing at step eight with an obscure error.
This also makes debugging far easier, because the failure happens next to the cause.
Partial failure in batches
A workflow processing a hundred records should not abandon the remaining ninety because record seven was malformed.
Handle items individually: process each, collect failures, continue. At the end, report what succeeded and what did not. One bad record should cost you one record.
This is the default behaviour in some tools and emphatically not in others, so check.
Timeouts
Set them explicitly on every external call. A request with no timeout can hang indefinitely, holding resources and blocking the queue behind it.
Set them shorter than you think. A call that normally takes two seconds and has taken thirty is not going to succeed usefully.
Monitor the absence of work
The failure mode nobody builds for: the workflow that stops running entirely.
A trigger breaks, a credential expires, a webhook registration lapses. No errors are generated, because nothing is executing. Everything looks healthy.
Monitor expected volume. If a workflow normally runs two hundred times a day and ran zero today, that should alert — the absence of failures is not the same as success.
Test the failure paths
Error handling that has never been exercised is a hypothesis.
Deliberately: revoke a credential, point at an unreachable endpoint, feed malformed data, simulate a rate limit. Confirm the retry behaves, the dead letter captures, and the alert arrives at the right person.
Do this before launch, and again after any significant change.
A checklist
For every workflow that matters:
- Inputs validated at the first step
- Transient and permanent failures handled differently
- Retries with exponential backoff and jitter, capped
- Idempotency on anything that creates, sends or pays
- Dead-letter destination for permanent failures
- Alerting to a named owner on a channel they watch
- Explicit timeouts on external calls
- Volume monitoring to catch silent stoppage
- Failure paths tested, not assumed
That list is roughly a day of work on a typical workflow and it is the difference between automation you can rely on and automation you have to check.
If you have workflows running without this and want them hardened, get in touch.
