Error handling patterns that actually work in production
Most n8n tutorials skip error handling. That's fine for demos. But when a workflow runs 10,000 times a day, you need it to fail gracefully.
Here's what we've learned from 300+ production workflows.
The problem with default behavior
By default, when a node fails in n8n, the whole workflow stops. That's often not what you want.
Imagine you're processing 500 leads. Lead #47 has a malformed email. Should the other 453 leads get stuck? No.
Pattern 1: Continue on fail
The simplest fix. On any node, enable "Continue On Fail" in settings. The workflow keeps running even if that node errors.
// The failed item gets an error property you can check
if ($input.item.json.error) {
// Handle the error case
return { success: false, reason: $input.item.json.error.message };
}
When to use: Processing batches where individual failures shouldn't stop everything.
Pattern 2: Try/catch with IF node
For more control, route errors explicitly:
- Enable "Continue On Fail" on the risky node
- Add an IF node after it
- Check for
$json.errorto route failures separately
This lets you:
- Log failures to a database
- Send alerts for certain error types
- Retry with different parameters
Pattern 3: Error workflow
n8n has a built-in error workflow feature. When any workflow fails, it triggers a separate workflow.
We use this for:
- Slack notifications to the team
- Logging to our monitoring system
- Auto-creating tickets for critical failures
Set it in Workflow Settings → Error Workflow.
Pattern 4: Graceful degradation
Sometimes the right response to an error is doing something simpler instead of failing.
Example: Your AI summarization fails because the API is overloaded. Instead of failing the whole workflow, fall back to extracting the first 500 characters.
// In a Code node after the AI node
const aiResult = $input.item.json;
if (aiResult.error) {
// Fallback: just use the first 500 chars
return {
summary: $('Previous Node').item.json.content.substring(0, 500) + '...',
method: 'fallback'
};
}
return { summary: aiResult.text, method: 'ai' };
What we use on every project
- Error workflow for monitoring
- Continue on fail for batch processing
- Explicit try/catch for critical paths
- Fallbacks for non-essential features
The goal isn't to prevent errors. It's to handle them without waking anyone up at 3am.
Three live calls a week. Bring your hardest build.
Every week we get on three 30-minute calls to work through real Claude Code builds, live. Bring the thing you're stuck on. Can't make it? Every call is recorded, so nothing's lost.
Free to join. Real people. No spam.
Related Posts

The best free LLM APIs in 2026: a live-probed list
A live-probed directory of free LLM API providers: ~110 free models across 16 providers, sorted by what's actually free, with the rate limits and ToS catches each one hides.

How to put Claude Code in charge of a free LLM API pool
A free LLM API pool stacks 16 providers' free tiers behind one endpoint. The smarter move is to make Claude Code the orchestrator that delegates grunt work to the pool and spends its budget only on the hard tasks.

Claude Fable 5 lasted three days: why the US government pulled Anthropic's most powerful model
Anthropic's first public Mythos-class model launched June 9, then a US export-control order pulled it offline three days later. A clear look at what Claude Fable 5 does, what it costs vs Opus 4.8, why it was suspended, and what comes next.