Skip to main content
AC
← Blog

01 / n8n · AI agents

n8n AI agents in production, what actually breaks

Six months. About 250 workflows across a dozen teams. The OpenAI node is not the hard part. The plumbing around it is. Here is what falls over first, in the order it will happen to you.

·9 min read·Alex Cinovoj

A founder called me last month. Their support team had built an AI triage agent in n8n. Claude reads the ticket, tags it, drafts a reply, pings a human. It worked beautifully in the demo. Then it hit real traffic and burned through $180 in a weekend, misrouted two enterprise tickets, and quietly stopped running on Tuesday because a Google Sheets node hit a rate limit and swallowed the error.

That story is the story. Everyone can wire an AI node to a webhook. Very few can keep it running for six months. So this piece is not another "what is an n8n AI agent" explainer. It is a field note on the five things that actually break, in the order they break, and what to build so they don't.

First, the honest definition

An n8n AI agent is the AI Agent node with an LLM (Claude, OpenAI, Gemini) as the reasoning engine and a set of tools it can call. The agent gets a prompt, decides which tools to run, runs them, reads the results, decides what to do next, and stops when it thinks it is done. n8n handles the input trigger, the tool wiring, the memory, and the execution log.

The reason it is compelling is not the AI part. It is that a non-engineer can look at the workflow, understand what happens, and change one step without a pull request. That is the durable value. The AI is table stakes.

What breaks, in order

1. Cost, in week one

First surprise for every team. The demo cost seven cents. The first real day costs sixty dollars. Then someone forwards ten years of email into a summarization workflow at three in the morning and you get a Stripe alert.

Two rules that keep this from happening:

  • Every workflow starts with a budget check node. Track spend per run in a Postgres table. If the running total for the day is over the cap, route to a fallback (queue for later, send to a cheaper model, or just error clean). Never call the LLM blindly.
  • Cheap classifier first, expensive model second. Use gpt-4o-mini or Haiku to decide whether the request even needs Claude Sonnet. Two-thirds of the time it does not.

2. Silent failures, in month one

n8n executions can fail without anyone noticing. A Google Sheets append gets rate-limited. A Slack webhook returns a 403 because someone rotated the token. The workflow marks itself green because the AI Agent node succeeded, and the tool call after it just did not run.

The fix is not more monitoring. The fix is loud failure. Every workflow that touches an external system gets:

  • An error trigger workflow that catches every failed execution.
  • A Slack message to a #ai-alerts channel with the workflow name, the error, and a link to the failed execution. Not an email. Emails get ignored. Slack pings do not.
  • Idempotency keys on every external write. If a ticket create runs twice, it should not create two tickets. Store the key in Postgres with a unique constraint and let the second insert fail.

3. The agent looping, in month two

You will get a Claude call that thinks the search tool returned nothing useful, so it searches again with slightly different words, and again, and again. n8n's default max iterations is ten. Ten iterations at Sonnet pricing with a big context is real money for one stuck request.

4. Retrieval that lies, in month three

Around month three, someone will ask why the AI keeps citing a policy document from 2023 that was replaced last quarter. Your vector database still has the old chunks. Nobody set up a re-index. The agent is confidently wrong.

Three habits that keep retrieval honest:

  • Every chunk carries a source URL, a version hash, and a last-indexed timestamp. The agent quotes the source when it answers.
  • A nightly workflow re-embeds anything changed in the last 24 hours, not the whole corpus. Cheap and it stays current.
  • A weekly eval that runs 50 known questions against the retrieval layer and alerts if pass rate drops. This is the eval nobody builds until they get burned once.

5. Prompt drift, in month six

Your prompt started as three sentences. Six months later it is eight hundred words of "please do not confuse invoice number with PO number again" patches. Every fix is a reaction to one bad output. Nobody remembers why half the rules are there.

The fix is version control on prompts and a small eval suite. Prompts live in a Postgres table with a version number and a changelog. When someone changes the prompt, the workflow runs the eval suite (10 to 30 test cases) before the new version goes live. If pass rate drops, the change is rejected. Boring. Effective.

The stack I actually use

Self-hosted n8n on Fly.io, sitting in front of:

  1. Anthropic Claude Sonnet for reasoning and drafting.
  2. gpt-4o-mini for cheap classification and routing.
  3. Postgres with pgvector for retrieval.
  4. A separate Postgres schema for prompt versions, budgets, and audit logs.
  5. Slack for alerts. PagerDuty for anything that touches money.

Nothing exotic. The value is not in the parts. It is in how they are wired: budget check first, cheap model routing, loud failure, idempotency keys, versioned prompts, versioned retrieval, a weekly eval that runs without anyone remembering to click it.

How to build your first one, honestly

Pick a workflow that currently costs a human three to five hours a week and has clear inputs. Support triage. Lead enrichment. Contract summary. Meeting notes to CRM. Something with a shape.

  1. Build the deterministic version in n8n first. No AI. Just the plumbing: trigger, tool calls, storage, alerts. Get it to green.
  2. Add one AI Agent node in the middle where the human judgment was. Give it two or three tools. Cap iterations at five. Log everything.
  3. Run it in shadow mode for a week. Human still does the work. Agent also does the work. Diff the outputs. Measure agreement.
  4. When agreement is over eighty-five percent, cut over. Keep the human in the loop for the top ten percent of high-value cases.
  5. Set the weekly eval. Set the budget cap. Ship the runbook to the team that owns it. Walk away.

What I would skip

  • Multi-agent orchestration on run one. You do not need CrewAI, you do not need a supervisor pattern, you do not need a swarm. One agent, a few tools, a fallback. Ship that. Add complexity only when the single agent visibly fails at something.
  • Building your own vector database. Postgres pgvector is fine up to about a million chunks. Do not add Pinecone until you can prove Postgres is the bottleneck.
  • Streaming to end users through n8n. If the workflow needs sub-second streaming to a chat UI, that is not an n8n workflow. That is a backend. n8n is for orchestration, not for real-time UX.
The AI is the interesting part. The idempotency keys and the budget cap and the alert on the failed Google Sheets append are what keep it running.
, the honest version

Common questions

What is an n8n AI agent?

In n8n, an AI agent is a workflow node that hands a user request to an LLM (Claude, OpenAI, or others) with a set of tools it can call. The agent decides which tool to run, in what order, and when to stop. n8n handles the plumbing around it: input, retries, memory, logging.

Should I build AI agents in n8n or in code?

n8n if the workflow crosses more than two SaaS tools, needs human approval steps, or your team wants to see and edit it visually. Code if the agent is the product, needs sub-second latency, or streams tokens to end users.

How do I stop an n8n AI agent from looping forever?

Set a max iteration count on the agent node. Cap tool calls per run. Add a circuit breaker that kills the execution if the same tool is called with the same arguments twice in a row. And always cap total cost per run with a budget check node.

Does n8n work with Claude?

Yes. There is a native Anthropic Chat Model node, and Claude works as the reasoning engine inside the AI Agent node. In production I use Claude for anything that needs careful extraction or drafting, and OpenAI for cheap classification.

Self-hosted n8n or n8n Cloud for AI workflows?

Self-hosted when data sensitivity or cost matters. n8n Cloud when speed matters more. For serious AI workloads, self-hosted on Fly, Railway, or your own infra usually wins on cost and control once you cross a few thousand runs per month.

If you want a shortcut

I have built about 250 n8n workflows in production, most of them with AI in the loop. The audit exists so you do not have to make the same mistakes I did in month one, month three, and month six. 90 minutes, ranked action plan in 48 hours, fee credits toward the build. See n8n automation or reserve the audit.

Want this shipped in your stack?

The $1,000 AI audit gets you a ranked action plan in 48 hours.

90-minute live review of your workflows, agents, retrieval, permissions, evals, costs, and observability. Fee credits toward the build.