Source: wiki synthesis: n8n vs Claude Code — When to Use Which, Building n8n Workflows with Claude Code, The Loop Is the Unit of Work, Should You Build a Loop?

Every automation task hits the same fork: wire it as a deterministic visual workflow, or hand it to an agent loop. The n8n topic answers from the workflow side (Nate Herk’s decision framework), the agent-loops topic from the loop side (the four-condition test, the token math, the security tax) — but neither cluster reads the other. Composed, they yield a three-way triage in which “keep it a manual prompt” is a first-class outcome, not a failure.^[inferred — the composition is this article’s synthesis] This decision comes before Running the Agentic Loop (which picks where a loop runs once you’ve decided to build one) and is orthogonal to Vendor-Direct Tool Calls (which picks the tool-call surface, CLI/MCP/middleware, for a given vendor action).

Key Takeaways

  • Task shape is the first cut. Fixed steps with one right answer — schedule triggers, “if new row in Sheet then send Slack” — are wiring territory: Herk’s 10-minute rule says if it fits a small handful of nodes, just build it in n8n. Open-ended work — branching strategy, “search until I have enough info, then synthesize,” the ~15-node YouTube-dedupe-summarize example that becomes one paragraph in Claude Code — is loop territory.
  • Loop territory has an entrance exam. The four-condition test: the task repeats at least weekly, verification is automated (a test/build/linter that can fail the work without you in the room), your token budget can absorb the waste, and the agent has a senior engineer’s tools. “Miss one box, keep it a manual prompt” — a loop pointed at the wrong task “costs more than it returns, forever.”
  • Verification is the hidden variable separating the two.^[inferred] In a wired workflow the node graph is the spec — determinism substitutes for verification, and n8n’s per-node execution log shows exactly which step failed. In a loop the path is open-ended, so an objective gate must define “done” instead; without one you get the named failure family — Ralph Wiggum loops, agentic laziness, goal drift, self-preferential grading.
  • The economics run in opposite directions. A published n8n workflow runs forever on a 47,000). Counter-current: n8n cloud pricing scales with executions while token prices fall, so high-volume agent workloads trend cheaper in code. The deciding metric for the loop side is cost per accepted change.
  • The security tax differs in kind. Loops: community skills as injection vectors, secrets scattered into debug logs, permission scope creep — a 30-day re-audit checklist. Wired workflows carry operational risk instead: a 60-node agent-authored oneshot throttled the n8n cloud API and bricked the instance for over an hour (self-hosted recovers via reboot; cloud needs a support ticket).
  • The bridge dissolves the either/or for authoring. As of Q2 2026 n8n ships a first-party MCP server in every edition: Claude Code describes the workflow, and a self-correcting build loop (generate TypeScript that must compile → validate → fix → execute → retry) writes it into your instance. You get agent authoring speed plus workflow deployment determinism — Herk’s framing: “n8n is not dead, it has become the foundation, and Claude Code is the new top of the stack.”

The combined triage

Walk it top-down; stop at the first match.^[inferred — composes Herk’s decision rules with the four-condition test]

  1. Deterministic and small (10-minute rule), owned long-term by a non-coder, dependent on the 1,900+ integration catalog, or already running in n8n?Wire it. Publish in n8n and leave it alone — “don’t migrate working automations just because a new tool exists.”
  2. Open-ended or decision-making, AND all four conditions pass (weekly recurrence, automated gate, budget headroom, real tooling)? → Loop it. Then, and only then, pick the runtime — in-process, durable, or hosted, per Running the Agentic Loop — and write the verifier before the first run per Verifier-First Loops.
  3. Open-ended but a condition fails — it’s a one-off, there’s no automatable check, the budget can’t absorb waste, or the agent can’t run what it writes? → Keep it a manual prompt. This is “the cheapest decision in the whole topic”: you stay the feedback loop until the task earns automation.
  4. Complex logic, but you want n8n’s deployment story?Hybrid. Author the n8n workflow with Claude Code through the MCP bridge; deploy on the canvas where ops can read it.

Build order if branch 2 fires, from the loop-economics source: one manual run that works → a skill → an automation → a state file → a gate → then schedule it. “Skip ahead and you’re paying for a swarm before you have a single run that works.”

What each side charges you

DimensionWired workflow (n8n)Agent loop (Claude Code + scheduler)
Marginal cost$3-8/mo self-hosted VPS, runs forever; cloud scales with executions50k-200k tokens per medium single-agent run (author estimate); context re-billed quadratically; a daily-scheduled loop burns millions of tokens a week
Where blowups happencloud API throttling on huge agent-authored builds (60-node oneshot, >1 hour outage)context resubmission (50k-300k tokens on a single prompt), tool-output bloat (40-60% removable waste), uncapped subagent fan-out (15k single run; $47k 3-day incident)
Observabilityper-node input/output execution log built in — “the dashboard tells you which step failed and why”build it separately (Trigger.dev, Sentry, custom logging)
Security surfaceoperational: cloud recovery requires a support ticketskill injection, secret scatter in verbose logs, permission scope creep — re-run the 30-day checklist
”Done” is defined bythe node graph — one right answer per shapean objective gate: pass/fail test, build, zero/non-zero linter — “not a verifier with an opinion”
Who can own itany non-coder — the canvas is legible to opsa loop engineer who “writes the VISION.md, the gate, and the stop condition, then walks away and trusts the verifier”

The bridge — hybrid patterns the sources document

  • Claude Code authors n8n. The official first-party MCP server (Public Preview, n8n 2.18.4+, all editions including free self-hosted) builds and updates workflows from a prompt; n8n’s own testing calls Claude Code its strongest client. Known rough edges: complex branching often needs a second pass, and node selection can pick the wrong near-duplicate node.
  • Split by interface. Customer- and ops-facing workflows live in n8n (visual, debuggable by ops staff); custom agent logic, research tasks, and anything that must think for itself lives in Claude Code + a runtime like Trigger.dev.
  • Claude Code as teacher. Keep production automations in n8n; use Claude Code to explain patterns, prototype ideas, and walk new frameworks before you build them for real on the canvas.
  • The moat transfers. n8n fluency — triggers, data flow, error handling, idempotency, observability — is the mental model that makes you good at directing loops; beginners who skip it hit context drift, hallucinations, and scoping walls “without knowing why.”
  • The ladder connects them.^[inferred] The agent-loops leverage ladder (prompt → harness → loop) applies to workflow authoring itself: dragging nodes is the manual rung, prompting Claude Code to build the workflow is the agent rung, and the bridge’s self-correcting build loop (validate → fix → re-validate → execute → retry) is a bounded loop whose verifier — the TypeScript compile + n8n validation — is supplied by the platform.

Try It

  1. Run the triage on your next automation idea and write down which branch fired and why — the one-line record is what stops relitigating the choice later.
  2. Branch 2? Pre-flight before tokens: name the done-condition, the per-pass check, the saved artifact, and the failure-retry path; instrument cost-per-accepted-change from run one (“tokens-spent and tasks-attempted are vanity metrics”).
  3. Branch 4? Wire the bridge: enable the official MCP server from n8n instance settings (2.18.4+), connect Claude Code per n8n’s setup guide, and build in plan mode so it asks the clarifying questions first.
  4. The moment any loop goes unattended, put the 30-day security checklist (SAST + dependency audit + secret scanning in the gate, no skill auto-install, verbose logging off, permissions re-audited, human gate on merge/deploy) on a recurring calendar reminder.
  5. Prefer self-hosted n8n when agents author workflows at scale — the cloud-throttling incident’s recovery asymmetry (reboot vs support ticket) is the argument.

Open Questions

  • No published benchmark implements the same automation both ways and compares n8n execution cost against loop token cost end-to-end — the comparison table above splices each side’s own numbers.^[inferred]
  • The loop-side token ranges are one author’s estimates (50k-200k per medium run), corroborated in order of magnitude but not validated by the 2026-07-03 benchmark drain; the three named starter loops remain individually unmeasured.
  • The official n8n MCP server is still Public Preview with no GA date and no feature-parity comparison against the community server — both flagged in the bridge article.