n8n
n8n (“node-to-node”) is an open-source, self-hostable workflow automation platform. Think of it as a developer-friendly alternative to Zapier/Make, with first-class support for APIs, custom logic, and on-prem deployments.
1. What n8n is (and isn’t)
Is
- A workflow orchestration engine (triggers → actions → logic)
- Low-code, but very developer-capable
- Self-hostable (Docker, VM, Kubernetes) or cloud-hosted
- Strong at API glue, ETL, sync jobs, and event-driven automations
Is not
- A replacement for full ETL platforms like Airflow
- A UI-only “no-code” toy (it assumes you understand APIs)
- A frontend automation tool (it’s backend-first)
2. Core concepts (mental model)
| Concept | Meaning |
|---|---|
| Workflow | A directed graph of steps |
| Node | A single operation (HTTP call, DB query, IF, code, etc.) |
| Trigger | How the workflow starts (Webhook, Cron, Queue, Event) |
| Execution | One run of a workflow |
| Credentials | Encrypted secrets used by nodes |
| Expressions | JS-like syntax to reference data between nodes |
If you’re comfortable with Django signals, Celery tasks, or DRF pipelines — this will feel natural.
3. Node types you’ll use most
Triggers
- Webhook (HTTP)
- Cron (scheduled jobs)
- Polling (interval-based)
- Queue (Redis-backed)
- App events (e.g. Stripe, GitHub)
Core logic
- IF / Switch
- Merge
- Split In Batches
- Wait / Delay
- Error Trigger
Data + integration
- HTTP Request (most powerful node)
- PostgreSQL / MySQL / SQLite
- Redis
- S3
- Google Sheets
- Slack, Email, Discord
- Hundreds of SaaS APIs
Code
- Code node (JavaScript / TypeScript)
- Run arbitrary logic
- Transform payloads
- Do math, validation, formatting
4. Expressions (very important)
n8n uses expression syntax to reference previous node data:
{{$json.email}}
{{$node["Fetch User"].json.id}}
{{$now}}
Features:
- JS-like
- Safe access
- Date helpers
- Math & string ops
This is where n8n becomes much more powerful than Zapier.
5. Credentials & secrets (security model)
Stored encrypted at rest
Scoped per node
Can be environment-backed
Supports:
- API keys
- OAuth2
- Basic auth
- Custom headers
For production:
- Use env vars or secret managers
- Disable plaintext exports
- Lock down execution UI
6. Error handling & reliability
Built-in
- Continue on failure
- Error Trigger workflows
- Try/catch logic with IF nodes
- Retry on HTTP errors
Patterns
- Dead-letter workflows
- Idempotency keys
- Webhook signature verification
- Batch + resume workflows
You can build very robust pipelines if you treat it like backend infra, not a toy.
7. Hosting & deployment
Options
- n8n Cloud (managed, paid)
- Docker (most common)
- VM / bare metal
- Kubernetes (Helm chart available)
Typical Docker setup
- n8n container
- PostgreSQL (for executions)
- Redis (for queue mode)
- Reverse proxy (Nginx / Traefik)
Execution modes
| Mode | When to use |
|---|---|
| Main process | Small setups |
| Queue mode | High volume, reliability |
| Webhook workers | Scale HTTP ingestion |
8. Performance & scaling
- Stateless workers (queue mode)
- Horizontal scaling
- Webhooks can be fronted by a load balancer
- DB load depends on execution logging settings
Tuning tips:
- Prune execution history
- Disable full payload storage when not needed
- Batch APIs aggressively
- Avoid large JSON in memory
9. Versioning & environments
Out of the box:
- No built-in environments (dev/staging/prod)
Common strategies:
- Git-based export/import
- Separate instances per env
- Infra-as-code for workflows (JSON)
- Use feature flags in expressions
10. Use cases (realistic, high-value)
- CRM ↔︎ internal DB sync
- Webhook → validation → DB → notification
- Scheduled reporting jobs
- SaaS glue (Stripe, HubSpot, Cliniko, Nookal, etc.)
- IoT ingestion & transformation
- Lightweight ETL
- Backoffice automations
- Admin tooling without writing a UI
Given your background, this is perfect for CRM syncs and ops tooling.
11. n8n vs alternatives
| Tool | Strength |
|---|---|
| Zapier | Fast, simple, SaaS-only |
| Make | Visual, complex flows |
| n8n | Open, self-hosted, dev-friendly |
| Airflow | Heavy ETL, data engineering |
| Temporal | Durable workflows (code-first) |
| Celery | Task queue, no UI |
Rule of thumb:
- Business automation → n8n
- Core product logic → app code
- Massive data pipelines → Airflow/Dagster
12. Common pitfalls
- Treating it as source-of-truth logic
- No idempotency on webhooks
- Storing huge payloads
- Mixing prod + dev workflows
- Forgetting auth on webhooks 😬
13. Best practices (TL;DR)
- Keep workflows small & composable
- Use HTTP Request over vendor nodes when needed
- Log minimally in prod
- Use queue mode for anything serious
- Version workflows in Git
- Validate all inbound webhooks
- Don’t put business-critical rules only in n8n
14. When n8n is a great choice for you
Given your stack (Django, DRF, Postgres, CRMs, IoT, scheduled syncs):
n8n is ideal for:
- CRM ingestion pipelines
- Data sync orchestration
- Notifications & automation
- Admin workflows
- Rapid experimentation
…and not replacing your Django backend.