Automating Daily Tasks with n8n
If you’ve ever wished you could connect your apps without writing custom integration code, workflow automation tools are your answer. Today I’m looking at n8n—an open-source alternative to Zapier and Make (formerly Integromat) that you can self-host.
What is n8n?
n8n (pronounced “nodemation”) is a node-based workflow automation tool. You create workflows by connecting nodes, where each node represents an action: trigger on webhook, fetch data from API, transform data, send email, post to Slack, etc.
Key differentiators:
- Open source: MIT licensed, fully self-hostable
- Fair-code model: Free for personal use, reasonable commercial terms
- Visual editor: Node-based interface for building workflows
- Extensive integrations: 200+ built-in nodes
- Code when needed: Write JavaScript for custom logic
Getting Started
The fastest way to try n8n is with Docker:
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8n
Open http://localhost:5678 and you’re ready to build workflows.
Your First Workflow
Let’s create a simple workflow: when a webhook receives a POST request, format the data and send it to Slack.
Step 1: Add a Webhook Trigger
- Click “Add first step” → Search for “Webhook”
- Select “Webhook” node
- Set HTTP Method to POST
- Copy the test URL
Step 2: Format the Data
- Add a new node after Webhook
- Search for “Set” (or use “Code” for JavaScript)
- Configure the fields you want to extract/transform
// Using the Code node for custom logic
return {
json: {
message: `New submission from ${items[0].json.body.name}`,
email: items[0].json.body.email,
timestamp: new Date().toISOString()
}
};
Step 3: Send to Slack
- Add “Slack” node
- Configure credentials (OAuth or webhook URL)
- Select channel and format message
Step 4: Activate
Save the workflow and toggle it to Active. Now every POST to your webhook URL triggers the Slack notification.
Common Use Cases
Developer Workflows
GitHub → CI/CD → Notifications:
- Trigger on GitHub push/PR
- Check CI status
- Send Slack notification on failure
Monitoring Alerts:
- Webhook from Prometheus/Grafana
- Format alert data
- Send to PagerDuty/Slack/Email
Automated Backups:
- Cron trigger
- Fetch data from API/database
- Store in S3/Google Drive
Product/Marketing Workflows
Form Submissions:
- Typeform/Google Forms submission
- Add to CRM
- Send welcome email
- Notify sales team
Social Media Monitoring:
- RSS feed trigger
- Filter for keywords
- Post to Slack
- Track in spreadsheet
Data Pipelines
API Synchronization:
- Cron trigger
- Fetch from Source API
- Transform data
- Push to Destination API
Spreadsheet Automation:
- Google Sheets trigger (new row)
- Validate data
- Update external systems
- Log results
Key Nodes to Know
Triggers:
- Webhook: HTTP endpoint for external triggers
- Cron: Scheduled execution
- RSS Feed: Monitor feeds
- Gmail/Outlook: Email triggers
Actions:
- HTTP Request: Call any API
- Set: Create/modify data
- IF: Conditional branching
- Switch: Multiple condition routing
- Merge: Combine data from branches
- Code: Custom JavaScript
- Wait: Delay execution
Integrations:
- Slack, Discord, Telegram
- Google Sheets, Airtable
- GitHub, GitLab
- AWS services
- Databases (Postgres, MySQL, MongoDB)
Advanced Features
Expressions
n8n uses a templating system for referencing data from previous nodes:
// Reference data from previous node
{{ $node["Webhook"].json.body.email }}
// Access all items
{{ $json.fieldName }}
// Use JavaScript expressions
{{ $json.amount * 1.1 }}
// Date formatting
{{ $now.format('YYYY-MM-DD') }}
Error Handling
Create robust workflows with error handling:
// Use Error Trigger node for global error handling
// Use Try/Catch pattern with IF nodes
// Set up notifications for failed workflows
Sub-Workflows
Break complex workflows into reusable sub-workflows:
// Main workflow calls sub-workflow
// Sub-workflow can be reused across multiple main workflows
// Great for shared logic like data validation, formatting
Self-Hosting Considerations
For production use, you’ll want:
Database: Use PostgreSQL instead of SQLite
docker run -d \
--name n8n \
-p 5678:5678 \
-e DB_TYPE=postgresdb \
-e DB_POSTGRESDB_HOST=postgres \
-e DB_POSTGRESDB_DATABASE=n8n \
n8nio/n8n
Reverse Proxy: Put nginx/Caddy in front for HTTPS
Persistence: Mount data volumes for durability
Scaling: For high volume, run multiple workers
n8n vs Alternatives
vs Zapier:
- Zapier: SaaS, easier setup, more integrations, expensive at scale
- n8n: Self-hosted, open source, requires more setup, cost-effective
vs Make (Integromat):
- Make: More visual, complex logic support, SaaS
- n8n: Similar power, self-hostable, code node flexibility
vs Custom Scripts:
- Scripts: Maximum flexibility, maintenance burden
- n8n: Visual debugging, built-in integrations, easier maintenance
When to Use n8n
Perfect for:
- Connecting SaaS applications
- Automating repetitive tasks
- Building internal tools
- Data synchronization
- Alert and notification systems
Consider alternatives when:
- You need real-time processing (< 1 second latency)
- Workflows are primarily code (just write Python/Node)
- You need enterprise compliance features
Final Thoughts
n8n hits a sweet spot: powerful enough for complex workflows, accessible enough for non-developers, and open-source enough that you’re not locked into a SaaS pricing model.
Start with a simple pain point—something you do manually that should be automated—and build from there. Once you get comfortable with the node-based model, you’ll find automation opportunities everywhere.
Automate the boring stuff. Focus on what matters.