Error Handling
n8n provides comprehensive error handling mechanisms at multiple levels: node-level, workflow-level, and system-level. Understanding these mechanisms helps you build resilient workflows that gracefully handle failures.Error Types
n8n uses a hierarchical error system with specific error classes:Node Errors
- NodeOperationError
- NodeApiError
- ExpressionError
- WorkflowError
Errors that occur during node execution:When to use:
- Invalid credentials
- API rate limiting
- Invalid parameters
- Business logic errors
Node-Level Error Handling
Retry Configuration
Nodes can automatically retry on failure:Failure Detected
If the node throws an error and
retryOnFail is true, the retry mechanism activates.Continue on Fail
Control whether workflow execution stops on node failure:Error Data Structure
WhenalwaysOutputData is true, failed items include error information:
Workflow-Level Error Handling
Error Workflow
Configure a dedicated error workflow to handle failures:Error workflows run in
error mode and receive the complete error context, allowing you to:- Send error notifications (email, Slack, etc.)
- Log errors to external services
- Trigger recovery workflows
- Store error details for analysis
Error Trigger Node
The Error Trigger node starts workflows when errors occur:Execution-Level Error Handling
Execution Errors
The execution engine tracks errors throughout workflow execution:Timeout Handling
Manual Cancellation
Error Recovery Patterns
Pattern 1: Graceful Degradation
Continue with default values when optional operations fail:Pattern 2: Error Notification
Notify team when critical operations fail:Pattern 3: Fallback Service
Try alternate services if primary fails:Pattern 4: Exponential Backoff
Implement custom retry with increasing delays:Error Context and Debugging
Error Context Information
Errors include detailed context for debugging:Accessing Error Details
In error workflows or subsequent nodes:Best Practices
- Set appropriate retry counts: Too many retries can delay error detection
- Use meaningful error messages: Include context for debugging
- Configure error workflows: Set up centralized error handling
- Handle errors close to source: Use
continueOnFailjudiciously - Log errors appropriately: Balance detail with noise
- Test error scenarios: Deliberately trigger errors to test handling
- Document error handling: Explain expected failures in workflow notes
- Monitor error rates: Track and alert on unusual error patterns
Common Error Scenarios
API Rate Limiting
Transient Network Errors
Optional Operations
Critical Operations
Next Steps
Execution Modes
Understand how workflows execute in different contexts
Creating Workflows
Learn more about workflow structure and design