n8n Automation: The Complete Guide
n8n is the Swiss Army knife of workflow automation: open source, self-hostable, incredibly flexible. This guide takes you from zero to productive use – with 10 concrete workflow examples.
Why n8n?
n8n vs. the Competition
| Feature | n8n | Make | Zapier |
|---|---|---|---|
| Price (1,000 tasks/mo) | €20 (Cloud) / €0 (Self-Host) | €16 | €29 |
| Self-Hosting | Yes | No | No |
| Open Source | Yes | No | No |
| Code Nodes | Yes (JS/Python) | Limited | Limited |
| Complexity | Medium-High | Medium | Low |
| EU Hosting | Yes | Yes | No |
n8n is ideal when:
- You need control over your data (GDPR)
- You want to implement complex logic
- You're technically savvy or want to become so
- Budget is a factor
Detailed comparison: Make vs Zapier vs n8n
Basics: Understanding n8n
Core Concepts
Workflows: A workflow is a chain of nodes that process data.
Nodes: Building blocks of your workflow. There are:
- Trigger Nodes: Start the workflow (Webhook, Schedule, App Event)
- Regular Nodes: Process data (HTTP Request, Transform, Filter)
- Credential Nodes: Store access data securely
Connections: Connect nodes and transport data.
Expressions: Allow dynamic values with {{ $json.field }} syntax.
Understanding Data Flow
[Trigger] → [Node 1] → [Node 2] → [Output]
↓ ↓ ↓
Items Items Items
Each node receives Items (JSON objects) and outputs items. Items flow from left to right through the workflow.
Important: A node can receive multiple items and processes each one individually.
Installation and Setup
Option 1: n8n Cloud (Recommended for Start)
- Go to n8n.io
- Create an account
- Done – you can start immediately
Advantages: No setup, automatic updates, SSL included
Option 2: Self-Hosting with Docker
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8n
Open http://localhost:5678 in your browser.
Option 3: Docker Compose (Production)
version: '3.8'
services:
n8n:
image: n8nio/n8n
restart: always
ports:
- "5678:5678"
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=securepassword
- N8N_HOST=n8n.yourdomain.com
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://n8n.yourdomain.com/
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:
The 10 Practical Workflows
Workflow 1: Lead Notification (Beginner)
Use Case: New lead in CRM → Slack message → Email to sales
Nodes:
- CRM Trigger (e.g., HubSpot, Pipedrive)
- Slack Node → Message to #sales-channel
- Email Node → Email to assigned sales rep
Complexity: ⭐☆☆☆☆
Workflow 2: Automatic Invoice Processing (Medium)
Use Case: Email with PDF attachment → OCR → Data to Excel/Airtable
Nodes:
- Email Trigger (IMAP)
- IF Node → Filter: Has attachment?
- HTTP Request → OCR API (e.g., Azure Document Intelligence)
- Set Node → Structure data
- Airtable/Google Sheets → Save
Complexity: ⭐⭐⭐☆☆
Pro Tips:
- Use Error Workflow for failed OCR
- Save original PDF for audit
- Validate extracted amounts (Regex)
Workflow 3: Social Media Scheduler (Medium)
Use Case: Google Sheet with posts → Automatically post to LinkedIn/Twitter
Nodes:
- Schedule Trigger (daily 9:00)
- Google Sheets → Read next post
- IF Node → Post not yet published?
- LinkedIn/Twitter Node → Post
- Google Sheets → Mark as published
Complexity: ⭐⭐⭐☆☆
Workflow 4: Applicant Pipeline (Medium)
Use Case: Application on website → Notion entry → Hiring manager notification
Nodes:
- Webhook Trigger (Form submission)
- Notion Node → Create candidate page
- IF Node → Which position?
- Email Node → To responsible hiring manager
- Slack Node → Recruiting channel
Complexity: ⭐⭐⭐☆☆
Workflow 5: Data Synchronization (Advanced)
Use Case: CRM ↔ ERP Sync every 15 minutes
Nodes:
- Schedule Trigger (every 15 min)
- CRM Node → Get changed contacts
- Code Node → Transform data
- ERP API → Update/Create
- Error Workflow → Notify on errors
Complexity: ⭐⭐⭐⭐☆
Code Node Example:
// Transform CRM data to ERP format
return items.map(item => {
return {
json: {
erpCustomerId: item.json.crm_id,
name: `${item.json.firstName} ${item.json.lastName}`,
email: item.json.email,
lastSync: new Date().toISOString()
}
};
});
Workflow 6: AI-Powered Email Sorting (Advanced)
Use Case: Incoming emails → GPT-4 classification → Automatic routing
Nodes:
- Email Trigger (IMAP)
- OpenAI Node → Classify: Support/Sales/Spam/Info
- Switch Node → Based on classification
- Email/Slack Nodes → To right team
Complexity: ⭐⭐⭐⭐☆
OpenAI Prompt:
Classify this email into one of the categories:
- SUPPORT: Technical questions, problems, bugs
- SALES: Inquiries, interest in products
- SPAM: Advertising, irrelevant
- INFO: General information
Email:
{{ $json.text }}
Reply only with the category in uppercase.
Workflow 7: Reporting Automation (Advanced)
Use Case: Monday 8:00 → Data from 5 sources → PDF report → Send via email
Nodes:
- Schedule Trigger (Monday 8:00)
- Multiple Parallel Nodes → Google Analytics, CRM, Ads, etc.
- Merge Node → Combine data
- Code Node → Generate report
- Email Node → With PDF attachment
Complexity: ⭐⭐⭐⭐⭐
Workflow 8: Inventory Alert System (Medium)
Use Case: Stock below threshold → Trigger order + notification
Nodes:
- Schedule Trigger (hourly)
- Database/API → Current inventory
- IF Node → Below minimum stock?
- Supplier API → Auto-reorder
- Slack/Email → Notify team
Complexity: ⭐⭐⭐☆☆
Workflow 9: Customer Onboarding (Advanced)
Use Case: New customer → Multi-step onboarding over 14 days
Nodes:
- Webhook Trigger (New customer)
- Wait Node → Day 0: Welcome email
- Wait Node → Day 3: Tutorial video
- Wait Node → Day 7: Book check-in call
- Wait Node → Day 14: Feedback survey
Complexity: ⭐⭐⭐⭐☆
Workflow 10: Multi-Channel Support Bot (Expert)
Use Case: Slack + Email + Webform → Central queue → Auto-reply → Escalation
Nodes:
- Multiple Triggers (Webhook, Email, Slack)
- Merge Node → Unified format
- OpenAI Node → Response suggestion
- Notion/Airtable → Create ticket
- Code Node → Prioritization
- Switch Node → Routing
Complexity: ⭐⭐⭐⭐⭐
Best Practices
1. Workflow Design
- Build modular: Small, reusable sub-workflows
- Error Handling: Always define an error workflow
- Documentation: Sticky notes for complex logic
- Naming: Descriptive node names (
Get_Active_CustomersnotHTTP Request)
2. Performance
- Batch Processing: Process large data volumes in batches
- Webhook over Polling: Saves resources
- Caching: Cache frequently used data
- Watch timeout: Long workflows can timeout
3. Security
- Credentials: Never hardcoded in workflow
- Webhook Security: Enable authentication
- Self-Hosting: Behind reverse proxy (Traefik/Nginx)
- Encryption: SSL/TLS for all connections
4. Debugging
- Execute Once: For testing individual nodes
- Pin Data: Fix test data
- Console.log: In code node for analysis
- Execution History: Check logs
Avoiding Common Mistakes
Mistake 1: No Error Handling
Problem: Workflow breaks, nobody notices.
Solution:
[Main Workflow] → Error Workflow → Slack/Email Notification
Mistake 2: Overly Complex Workflows
Problem: One workflow does everything – impossible to debug.
Solution: Split into sub-workflows. One workflow = one task.
Mistake 3: Hardcoded Values
Problem: API keys, URLs directly in workflow.
Solution: Use environment variables and credentials.
Mistake 4: No Idempotency
Problem: Workflow runs twice = duplicate data.
Solution: Build in deduplication logic (check before create).
Advanced Techniques
Custom Code Nodes
// Complex transformation
const processedItems = [];
for (const item of items) {
// Your logic here
const processed = {
json: {
...item.json,
processedAt: new Date().toISOString(),
customField: someFunction(item.json.data)
}
};
processedItems.push(processed);
}
return processedItems;
Webhook with Authentication
// In workflow: Check header auth
const authHeader = $input.headers['x-api-key'];
const validKey = $env.WEBHOOK_API_KEY;
if (authHeader !== validKey) {
throw new Error('Unauthorized');
}
Calling Sub-Workflows
Use the "Execute Workflow" node to build modular architectures.
Next Steps
- Start small: Take a simple process (e.g., notification)
- Learn the nodes: Experiment with the most important ones (HTTP, IF, Set)
- Build incrementally: Extend working workflows
- Use community: n8n Community for templates
Calculate ROI: Our Automation ROI Calculator shows you the savings potential.
Conclusion
n8n is powerful – but the learning curve is worth it. With these 10 workflow examples, you have a solid starting point. Begin with simple automations and work your way up.
Want to automate processes but don't know where to start? Our Automation Potential Check identifies the best candidates in your company. See also: Process Automation Best Practices.


