← Master Index
Vol. 22 Module 22.7 Lecture

n8n

Automation Platforms

How This Lesson Fits the Module & Volume

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.
Definition

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-hostn8n CloudMake / Zapier SaaS
Where data livesYour VPC / diskVendor cloud region you choose (verify)Vendor cloud (enterprise residency SKUs vary)
Who runs Postgres/queuesYou (Vol. 18 ops)VendorVendor
Pricing postureInfra + optional enterprise licenseCloud subscription by executions/workflows (live sheet)Operations or tasks (live sheet)
Custom codeCode node + npm-class extensions (self-host power)Supported but gated by Cloud limitsWeaker than n8n Code; more no-code
Connector catalogLarge + HTTP; smaller than Zapier’s long tailSame nodes, hostedMake = 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 typeTrustPattern
Webhook / Cron / App triggerTrusted if auth’dStart of run
HTTP / CRM / DB writeTrusted code + credentialsIdempotent; least privilege
LLM / OpenAI / Gemini nodeUntrustedTyped output + schema validate
AI Agent + toolsUntrusted plannerMax iterations, tool allowlist, HITL before money/send
Wait / Form / Chat HITLHumanVol. 15 gate

Catalog Snapshot (Qualitative)

Dimensionn8nMakeZapier
Pricing postureSelf-host = infra (+ enterprise license if needed); Cloud = execution/workflow subscription—no invented $SaaS operations meteringSaaS task metering + plan tiers
StrengthsSelf-host; Code node; AI/LangChain-class nodes; exportable JSON workflows; engineer UXVisual routers/aggregators; ops-friendly scenariosWidest connector catalog; non-technical UX; enterprise SSO story
WeaknessesYou own upgrades/HA if self-host; license not “do anything OSS”; smaller long-tail catalog than ZapierSaaS data path; ops can explode; not classic self-hostTask costs at volume; less code-native; SaaS-only gravity
AI stepsFirst-class LLM + AI Agent nodesAI modules / toolsAI actions / Central / Agents (names evolve)
Vol. 18 analogueClosest to FastAPI+Celery you can drawManaged orchestratorManaged orchestrator

Workflow Pattern (Educational)

Illustrative graph contract—not a live exploit, not credentials. Same HITL idea as Vol. 21 invoice → pay.

# n8n_ticket_triage.json (conceptual — draw these nodes in the UI) # 1. Trigger: Webhook (HMAC auth) OR IMAP / Helpdesk app # 2. Set: wrap body as untrusted data (Vol. 21 wrap_data) # 3. AI: LLM node → JSON {intent, urgency, draft_reply} [schema] # 4. IF: urgency == "legal" OR confidence < 0.7 → Wait (HITL form) # 5. Trusted: HTTP to ticket API (idempotency key = ticket_id) # 6. Optional AI Agent node: ONLY search KB tools, max 3 iterations # 7. Error Trigger → Slack on-call (no silent fail) POLICY = { "llm_may_write_crm": False, "agent_max_iterations": 3, "agent_tools": ["kb_search"], "hitl_before_customer_email": True, "credentials_in_n8n_store": True, # not in Code node strings } # docker-compose sketch (self-host lab — confirm current image tags) # services: # n8n: # image: n8nio/n8n # ports: ["5678:5678"] # environment: # - N8N_ENCRYPTION_KEY=... # from secrets manager # - WEBHOOK_URL=https://n8n.internal.example # volumes: ["n8n_data:/home/node/.n8n"]

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

LectureRole
Workflow automation (21.1)Product theory this vendor implements
Agentic workflow / HITLAI Agent node = pocket, not CEO
Docker / Celery / deploymentSelf-host ops + when to abandon the visual builder
Replit AIPrevious: the app that emits webhooks
Make / ZapierSaaS peers next
Common Misconception

“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

  1. Short Answer: What deployment choice most distinguishes n8n from Make/Zapier? Answer: First-class self-host (VPC) in addition to Cloud SaaS.
  2. True/False: n8n’s license is automatically Apache-2.0 for any commercial resale. Answer: False—fair-code / Sustainable Use; read the current license.
  3. Multiple Choice: LLM nodes in n8n should be treated as: (a) untrusted typed steps, (b) the workflow engine, (c) a kube scheduler. Answer: (a).
  4. 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.
  5. True/False: An AI Agent node may be bounded with max iterations and tool allowlists. Answer: True.
  6. 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).
  7. Short Answer: When pick Zapier instead of n8n? Answer: Non-technical ops + widest SaaS connector catalog / no self-host appetite.
  8. True/False: Customer email sends should often wait on a HITL node. Answer: True.
  9. Multiple Choice: Vol. 21 analogue is: (a) workflow automation graphs, (b) CNNs, (c) BLEU. Answer: (a).
  10. 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.
Trainer’s Guide

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.