Workflow Patterns
This guide documents reusable patterns for building n8n workflows within the SO1 automation system.Input Processing Patterns
Pattern A: Webhook → Parse → Validate
Purpose: Secure and validated input processing Use Cases: GitHub webhooks, API endpoints, external integrationsKey Nodes
| Node | Role |
|---|---|
| HOOKSTART | Secure webhook with authentication |
| CODE | Extract & validate payload structure |
| IF | Check required fields and data types |
| EDIT FIELDS | Standardize to common schema |
| THROW | Log and alert on validation failure |
LLM Integration Patterns
Pattern B: Throttled LLM Chain
Purpose: Rate-limited multi-stage LLM processingConfiguration
- Use 3-5 second delays between LLM calls
- Implement retry logic with exponential backoff
- Cache intermediate results
Decision Patterns
Pattern C: Quality Gate
Purpose: Iterative processing until quality thresholdImplementation
Output Patterns
Pattern D: Multi-Channel Notification
Purpose: Deliver to multiple destinationsConfiguration
Each channel runs in parallel with independent error handling.Error Handling Patterns
Pattern E: Graceful Degradation
Purpose: Continue processing despite partial failuresBest Practices
- Always have a fallback path
- Log all errors with context
- Notify on critical failures
- Don’t fail silently
Composition Rules
Chaining Workflows
UseexecuteWorkflow nodes to chain modular workflows:
Shared Data
Pass context between workflows via:- Workflow input parameters
- Shared database tables
- Message queues