n8n is an open-source workflow automation platform — like Zapier but self-hosted, with 400+ integrations and a code-when-you-need-it approach.
Why n8n?
- Self-hosted: Your data never leaves your server
- 400+ integrations: Slack, GitHub, Postgres, Stripe, and more
- Code when needed: JavaScript/Python in any workflow step
- Visual editor: Drag-and-drop workflow builder
- Free forever: Self-hosted with no limits
- AI nodes: Built-in LLM integration
- Webhook triggers: React to external events
Self-Host
docker run -p 5678:5678 -v n8n_data:/home/node/.n8n n8nio/n8n
API: List Workflows
curl http://localhost:5678/api/v1/workflows \
-H 'X-N8N-API-KEY: YOUR_API_KEY'
API: Execute Workflow
curl -X POST http://localhost:5678/api/v1/workflows/WORKFLOW_ID/activate \
-H 'X-N8N-API-KEY: YOUR_API_KEY'
API: Trigger via Webhook
curl -X POST http://localhost:5678/webhook/my-endpoint \
-H 'Content-Type: application/json' \
-d '{"event": "new_order", "data": {"id": 123, "amount": 49.99}}'
Example: GitHub → Slack Notification
Workflow JSON (import into n8n):
{
"nodes": [
{
"name": "GitHub Trigger",
"type": "n8n-nodes-base.githubTrigger",
"parameters": {
"events": ["push"],
"owner": "myorg",
"repository": "myrepo"
}
},
{
"name": "Slack",
"type": "n8n-nodes-base.slack",
"parameters": {
"channel": "#deploys",
"text": "New push to {{$json.ref}} by {{$json.pusher.name}}"
}
}
]
}
Example: Scheduled Report
- Cron Trigger: Every Monday at 9 AM
- Postgres Node: Query weekly metrics
- Code Node: Format data into report
- Email Node: Send to team
Code Node (Custom Logic)
// Process incoming data with custom JavaScript
const items = $input.all();
const processed = items.map(item => ({
...item.json,
total: item.json.price * item.json.quantity,
processed_at: new Date().toISOString(),
}));
return processed.map(json => ({ json }));
AI Agent Workflow
n8n has built-in AI nodes:
- Chat Trigger: Receive user message
- AI Agent: Process with OpenAI/Claude
- Tool nodes: Search database, call APIs
- Response: Send back to user
API: Create Workflow Programmatically
curl -X POST http://localhost:5678/api/v1/workflows \
-H 'X-N8N-API-KEY: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "My Automated Workflow",
"nodes": [...],
"connections": {...},
"active": true
}'
Real-World Use Case
A small business automated their entire order pipeline: Shopify order → Slack notification → Google Sheet → QuickBooks invoice → customer email. Previously took 15 minutes per order manually. Now it takes 0 minutes and never makes mistakes. They saved 20 hours/week.
Need to automate data collection? Check out my Apify actors for ready-made scrapers, or email spinov001@gmail.com for custom solutions.
Top comments (0)