Error Handling Workflow Example
This example demonstrates comprehensive error handling patterns including try-catch logic, fallback mechanisms, error notifications, and graceful degradation. Essential for production workflows.Workflow Overview
The workflow implements robust error handling:- Webhook Trigger - Initiates workflow
- Try-Catch Pattern - HTTP request with error handling
- Error Output - Dedicated error processing branch
- Fallback Logic - Alternative data sources
- Notification - Alert on failures
- Response - Appropriate status codes and messages
Use Cases
- Production API integrations
- Mission-critical workflows
- Third-party service integration
- Data pipeline resilience
- User-facing automation
Complete Workflow JSON
Error Handling Architecture
Step-by-Step Breakdown
Primary API with Error Handling
The HTTP node is configured for resilience:Key Settings:
continueOnFail: true- Workflow continues on errorsonError: "continueErrorOutput"- Routes errors to error outputretry.maxRetries: 3- Automatic retry with backofffullResponse: true- Access status codes
Success Path
When the API returns 200:
- IF node checks status code
- Formats success response
- Includes source metadata
- Returns HTTP 200
Fallback Path
When API returns non-200 but doesn’t error:
- IF node routes to FALSE branch
- Calls fallback API
- Formats with “success_fallback” status
- Returns HTTP 206 (Partial Content)
Error Path
When request fails completely:
- Error output activates
- Formats detailed error response
- Sends Slack notification to team
- Returns HTTP 500 with error details
Response Examples
Success Response (HTTP 200)
Fallback Response (HTTP 206)
Error Response (HTTP 500)
Key Error Handling Patterns
1. Continue On Fail
Critical Setting: Always set
continueOnFail: true on nodes where errors are expected. This prevents the entire workflow from failing.2. Error Output Routing
Use dedicated error connections:3. Retry Logic
4. Graceful Degradation
Always provide fallback:- Alternative API endpoints
- Cached data
- Default values
- User-friendly error messages
Advanced Patterns
Circuit Breaker Pattern
Add rate limiting after repeated failures:Dead Letter Queue
Store failed items for manual review:Exponential Backoff
Implement custom retry logic:Production Checklist
Node Configuration
-
continueOnFail: trueon all external calls -
onError: continueErrorOutputenabled - Retry logic configured (3 retries minimum)
- Timeouts set appropriately (10s recommended)
Workflow Settings
-
saveDataErrorExecution: "all"for debugging -
saveExecutionProgress: truefor monitoring - Execution timeout configured
- Error workflow ID set (optional)
Monitoring
- Error notifications configured (Slack/email)
- Logging to external service
- Request ID tracking
- Execution history retention
Monitoring and Alerting
Slack Notification Best Practices
Error Tracking Service
Integrate with Sentry, Datadog, or similar:Next Steps
- Build Basic Workflows with these patterns
- Add error handling to Webhook Integration
- Apply to Multi-Node Workflows
- Review AI Agent Workflows error handling