Module 22.6 ended on Replit AI: you can build and host an app. Module 22.7 asks how that app joins the rest of the business—email, CRM, tickets, spreadsheets—without a new microservice for every glue job. n8n is the engineer-friendly opener: a visual workflow tool you can self-host (Docker) or run as n8n Cloud. Vol. 21 workflow automation already taught durable graphs, HITL, and untrusted LLM nodes. This lecture is the vendor that most closely matches that architecture on-prem.
Vol. 15 agentic workflows / HITL map onto n8n’s AI Agent / LangChain-class nodes: the graph stays explicit; the model fills a typed step. Vol. 18 Docker / deployment / Celery remain the alternative when you outgrow a visual builder. Next: Make (SaaS visual power) then Zapier (catalog breadth).
Learning Objectives
By the end of this lesson, students should be able to:
- Define n8n as a fair-code workflow platform with self-host and Cloud options.
- Contrast self-host (data residency, ops burden) vs Make/Zapier SaaS.
- Place AI nodes (LLM, AI Agent) as untrusted steps inside a deterministic graph.
- Design HITL, credentials, retries, and kill switches on n8n the same way Vol. 21 taught FastAPI+Celery.
- Know when to pick n8n vs Make vs Zapier vs custom Vol. 18 workers.
- Avoid treating n8n’s license as “unlimited unrestricted OSS for any SaaS resale” without reading it.
n8n is a source-available (“fair-code”) automation platform: you draw a graph of nodes (triggers, HTTP, apps, Code, IF, wait, AI). Each execution is a run with item data passing along edges. You may self-host (typically Docker / K8s) so credentials and payloads stay in your VPC, or use n8n Cloud. AI capabilities appear as first-class nodes (LLM, embeddings, AI Agent / tools)—they do not replace the engine. License terms (Sustainable Use License and successors) are not Apache-2.0 for every commercial embedding; read the current license before you resell n8n as a hosted product.
Self-Host vs SaaS (the Module Thesis)
| n8n self-host | n8n Cloud | Make / Zapier SaaS | |
|---|---|---|---|
| Where data lives | Your VPC / disk | Vendor cloud region you choose (verify) | Vendor cloud (enterprise residency SKUs vary) |
| Who runs Postgres/queues | You (Vol. 18 ops) | Vendor | Vendor |
| Pricing posture | Infra + optional enterprise license | Cloud subscription by executions/workflows (live sheet) | Operations or tasks (live sheet) |
| Custom code | Code node + npm-class extensions (self-host power) | Supported but gated by Cloud limits | Weaker than n8n Code; more no-code |
| Connector catalog | Large + HTTP; smaller than Zapier’s long tail | Same nodes, hosted | Make = visual depth; Zapier = catalog breadth |
Self-host when
- Residency / DPA demands VPC
- High volume would punish SaaS task meters
- You already run Docker/K8s (Vol. 18)
n8n Cloud when
- You like n8n nodes but not ops
- Team is small; execution volume moderate
- You still want exportable workflows
Make/Zapier when
- Ops users, not platform engineers
- Long-tail SaaS connectors
- No appetite for self-host queues
AI Steps Inside the Graph
Vol. 21: the engine is trusted; LLM nodes are not. In n8n, keep control flow in IF / Switch / Wait / Error Trigger. Use AI to classify, extract, draft, or (bounded) tool-call. An “AI Agent” node is a Vol. 15 pocket, not a CEO of the company.
| Node type | Trust | Pattern |
|---|---|---|
| Webhook / Cron / App trigger | Trusted if auth’d | Start of run |
| HTTP / CRM / DB write | Trusted code + credentials | Idempotent; least privilege |
| LLM / OpenAI / Gemini node | Untrusted | Typed output + schema validate |
| AI Agent + tools | Untrusted planner | Max iterations, tool allowlist, HITL before money/send |
| Wait / Form / Chat HITL | Human | Vol. 15 gate |
Catalog Snapshot (Qualitative)
| Dimension | n8n | Make | Zapier |
|---|---|---|---|
| Pricing posture | Self-host = infra (+ enterprise license if needed); Cloud = execution/workflow subscription—no invented $ | SaaS operations metering | SaaS task metering + plan tiers |
| Strengths | Self-host; Code node; AI/LangChain-class nodes; exportable JSON workflows; engineer UX | Visual routers/aggregators; ops-friendly scenarios | Widest connector catalog; non-technical UX; enterprise SSO story |
| Weaknesses | You own upgrades/HA if self-host; license not “do anything OSS”; smaller long-tail catalog than Zapier | SaaS data path; ops can explode; not classic self-host | Task costs at volume; less code-native; SaaS-only gravity |
| AI steps | First-class LLM + AI Agent nodes | AI modules / tools | AI actions / Central / Agents (names evolve) |
| Vol. 18 analogue | Closest to FastAPI+Celery you can draw | Managed orchestrator | Managed orchestrator |
Workflow Pattern (Educational)
Illustrative graph contract—not a live exploit, not credentials. Same HITL idea as Vol. 21 invoice → pay.
When to Pick n8n
Pick n8n when
- Self-host / residency is a hard requirement.
- Engineers want Code nodes + git-exported workflows.
- AI steps must sit inside an explicit graph (Vol. 15/21).
- You already operate Docker/K8s (Vol. 18).
Pick something else when
- Non-technical ops + 5,000 SaaS apps → Zapier.
- Visual data mapping / aggregators without self-host → Make.
- The graph is the product and needs custom SLAs → FastAPI + Celery.
- License/resale model conflicts with fair-code terms.
Related Lectures
| Lecture | Role |
|---|---|
| Workflow automation (21.1) | Product theory this vendor implements |
| Agentic workflow / HITL | AI Agent node = pocket, not CEO |
| Docker / Celery / deployment | Self-host ops + when to abandon the visual builder |
| Replit AI | Previous: the app that emits webhooks |
| Make / Zapier | SaaS peers next |
“n8n is Zapier but free forever.” Self-host has infra + people cost; Cloud has a meter; license is fair-code. Second: an AI Agent node should own every CRM write. Third: credentials in a Code node string are “fine internally.” Fourth: self-host means no Vol. 20 residual risk. Fifth: inventing execution prices. Sixth: n8n replaces FastAPI for your customer-facing API.
Knowledge Check
- Short Answer: What deployment choice most distinguishes n8n from Make/Zapier? Answer: First-class self-host (VPC) in addition to Cloud SaaS.
- True/False: n8n’s license is automatically Apache-2.0 for any commercial resale. Answer: False—fair-code / Sustainable Use; read the current license.
- Multiple Choice: LLM nodes in n8n should be treated as: (a) untrusted typed steps, (b) the workflow engine, (c) a kube scheduler. Answer: (a).
- Short Answer: Name two Vol. 18 concerns you take on when self-hosting n8n. Answer: Any of Docker/K8s, backups, encryption keys, HA, upgrades, webhook TLS.
- True/False: An AI Agent node may be bounded with max iterations and tool allowlists. Answer: True.
- Multiple Choice: Pricing posture for n8n Cloud is closest to: (a) execution/workflow subscription (live sheet), (b) a fake $20 figure, (c) per-GPU Whisper only. Answer: (a).
- Short Answer: When pick Zapier instead of n8n? Answer: Non-technical ops + widest SaaS connector catalog / no self-host appetite.
- True/False: Customer email sends should often wait on a HITL node. Answer: True.
- Multiple Choice: Vol. 21 analogue is: (a) workflow automation graphs, (b) CNNs, (c) BLEU. Answer: (a).
- Short Answer: Next lecture? Answer: Make.
Key Takeaways
- n8n is the self-host-capable automation graph closest to Vol. 21 + Vol. 18 thinking.
- AI nodes are untrusted pockets inside a deterministic engine—HITL before send/pay.
- Cloud vs self-host is a residency/ops/price-posture choice, not a morality tale.
- Fair-code license + connector catalog size are real tradeoffs vs Zapier/Make.
- Next: Make.
Lab: Docker Compose n8n locally (or Cloud trial). Build webhook → LLM classify → IF → HITL wait → HTTP echo. No real customer PII. Optional: one AI Agent node with a single KB-search stub tool.
Debate: “If we can self-host n8n, why Celery?” Expected: customer-facing SLAs, custom auth, when the graph is the product.
Recap: n8n opens 22.7 as self-host-or-cloud visual automation with AI steps as untrusted nodes. Continue to Make.