The n8n AI Agent, explained: what the node does, when to use it, and 12 workflows to start from
An n8n AI agent is a language model running in a loop inside a workflow: it reads the input, decides which of the tools you gave it to call, reads the result, and repeats until it has an answer — while everything around it (triggers, data, approvals, delivery) stays ordinary n8n. This guide covers the anatomy of the AI Agent node, the rule for when to use it instead of plain nodes, twelve buildable workflows with templates, the limits, and what it costs to run or to have built.
Written by Max Zeshut
Founder at Agentmelt · Last updated Sep 11, 2026
What the AI Agent node actually is
n8n has two kinds of language-model nodes. Chains — Basic LLM Chain, Summarization Chain, Question and Answer Chain, Information Extractor, Text Classifier, Sentiment Analysis — make one model call and return. The AI Agent node makes a model call, lets the model choose a tool, runs the tool, feeds the result back, and loops until the model says it is done. The difference is the loop: a chain answers; an agent works.
The node is built from sub-nodes you attach to it: a chat model (Anthropic, OpenAI, Google, Mistral, Ollama and others), optional memory (Simple Memory for a session window, Postgres or Redis chat memory for persistence), any number of tools (HTTP Request Tool, Code Tool, Call n8n Workflow Tool, Vector Store Tool, Calculator, plus most n8n app nodes usable as tools), and an optional output parser that forces the final answer into a JSON schema so the next node gets typed fields instead of prose. The system message you write in the node’s options is where the agent’s job, rules and refusals live.
If you have read the agentic loops guide, this is that loop with n8n handling the observe and act sides. The model reasons; n8n observes (triggers, data pulls) and acts (tools, deliveries, approvals).
The one rule: deterministic first, agent second
Most of any business workflow is deterministic: pull the record, check the status, compute the number, send the message. Deterministic work belongs in plain nodes — Code, IF, Switch, Set, HTTP Request — because they are free, instant, testable and never hallucinate. The agent node earns its place only where the task requires reading language, making a judgement, or deciding which of several tools to use: classifying a ticket, extracting fields from a messy PDF, drafting a message from context, explaining an anomaly, deciding whether a request is complete.
Every blueprint on this site follows that rule. Look at the demand forecasting workflow: eight steps, one of which is an agent — and that agent explains the forecast, it does not produce it. Or payroll automation: the agent annotates anomalies and has no write access to amounts. Putting the model in the smallest box that still does the job is what makes these workflows reliable enough to sell.
A practical corollary: use the chain nodes (Text Classifier, Information Extractor) instead of the full agent for single-call jobs. They are cheaper, faster and produce structured output natively. Reserve the AI Agent node for steps that genuinely need tools or multi-step reasoning.
Building blocks that make agents safe in production
- Structured Output Parser. Attach it and set a JSON schema with a
confidenceand aneeds_humanfield. Downstream IF nodes route on those, and the agent cannot return prose where a number is expected. - Tools with narrow scope. An HTTP Request Tool that can only call one read endpoint is safer than a generic one. For write actions, do not give the agent the tool — route its decision to a Wait node with an approval button and let n8n perform the write after a human click.
- Call n8n Workflow Tool. Wrap complex or sensitive operations in a sub-workflow with its own validation, and expose that as the tool. The agent sees one clean function; you keep control of what it does.
- Error Trigger and an error workflow. Every production workflow should set an error workflow that logs the failure, alerts a channel, and — for idempotent steps — retries. Model APIs fail occasionally; the workflow should not.
- Idempotency keys. Store a key per processed item (ticket id, invoice number) and check it before acting, so a retried run cannot send the same email twice.
- Evaluations. Keep a sheet of 30–50 representative inputs with expected outputs and run the workflow against it whenever you change a prompt or a model. n8n’s evaluation features and a simple Compare Datasets node both work for this.
12 n8n AI agent workflows to start from
Each is a full blueprint — trigger, steps with nodes, data, guardrails, FAQ — with an importable starter template behind an email form. They are ordered from the simplest integration surface to the most involved.
Speed to lead is the most reliable lever in inbound sales, and most teams take hours.
Trigger: Form webhook (HubSpot, Typeform, website form) · Nodes: Webhook, HTTP Request, Code, AI Agent, Switch
Blueprint + templateTicket deflection means resolving the questions your help centre already answers — password resets, invoice copies, “how do I…” — before they reach an agent, and giving agents the rest with a summary, a category and a priority.
Trigger: Help desk webhook (ticket created) · Nodes: Webhook, HTTP Request, Text Classifier, Vector Store, AI Agent
Blueprint + templateEmail triage automation turns an inbox into a queue with decisions already made: every incoming message is classified (needs reply, FYI, task, meeting request, newsletter, spam), routine replies are drafted for approval, tasks and deadlines are extracted into your task tool, and what reaches the person is a short list ranked by urgency.
Trigger: Gmail / Outlook trigger (new message) · Nodes: Gmail Trigger, Text Classifier, HTTP Request, Information Extractor, AI Agent
Blueprint + templateEmployee onboarding automation turns the offer-accepted moment into a workflow: the HRIS fires an event, n8n creates the checklist by role, requests accounts from IT, schedules training, sends the welcome sequence, and an AI agent answers the new hire's policy questions from your handbook.
Trigger: HRIS webhook (offer accepted) · Nodes: Webhook, Set, Notion, HTTP Request, Google Calendar
Blueprint + templateContent repurposing is the most-sold automation workflow because the input is already made: a podcast episode, a webinar, a founder interview.
Trigger: New file in a folder (Google Drive / Dropbox) or RSS · Nodes: HTTP Request, Information Extractor, AI Agent, Code, Notion
Blueprint + templateInvoice processing automation takes the supplier invoice from wherever it arrives — email attachment, portal, scan — extracts every field, validates it against the PO and the receipt, routes it to the right approver with the exceptions highlighted, and posts it to the ERP coded and ready to pay.
Trigger: Gmail / Outlook trigger on the AP inbox + portal polling · Nodes: Gmail Trigger, Information Extractor, Code, HTTP Request, Switch
Blueprint + templateAn n8n sales agent for outbound does the research and writing a good SDR would do for each prospect, at a volume a person cannot sustain, inside limits that protect your domain.
Trigger: Schedule Trigger (daily batch) + reply webhooks · Nodes: HTTP Request, AI Agent, IF, Webhook, Slack
Blueprint + templateProactive outreach flips support from reactive to preventive: the workflow monitors the events that reliably lead to a ticket or a cancellation — a failed payment, a spike in errors, a feature never activated, a delayed shipment — and sends the right message before the customer has to ask.
Trigger: Event webhooks + daily scan · Nodes: Webhook, HTTP Request, IF, AI Agent, Wait
Blueprint + templateResponding to every review matters for ranking and for the next customer reading it, and almost nobody does it consistently.
Trigger: Schedule Trigger (hourly review collection) · Nodes: HTTP Request, Text Classifier, AI Agent, IF, Wait
Blueprint + templateProposals, RFP responses, statements of work and recurring reports are assembled from the same components every time: the client's details, the scope, the relevant past answers, the pricing rules, the boilerplate.
Trigger: Form / CRM stage change / RFP upload · Nodes: Webhook, HubSpot, Information Extractor, Vector Store, AI Agent
Blueprint + templateAutomated code review adds a consistent first pass to every pull request: the workflow reads the diff with the surrounding context, checks it against your written standards and the linked issue, posts inline comments only for concrete problems (bugs, security, missing tests, breaking changes), classifies the PR's risk, and writes the summary a human reviewer reads before opening the files.
Trigger: GitHub / GitLab webhook (pull request opened or updated) · Nodes: Webhook, HTTP Request, Code, AI Agent, IF
Blueprint + templateAI spend analysis (spend analytics) uses machine learning to classify every invoice and purchase-order line into a category taxonomy, normalise supplier names, and build the spend cube — supplier × category × business unit × time — that procurement needs to find savings.
Trigger: Schedule Trigger (monthly, after AP close) · Nodes: Postgres, Code, Information Extractor, Google Sheets, AI Agent
Blueprint + template
The full library is on the workflows hub, filterable by department.
Where n8n agents stop and code begins
n8n is the right tool for the large majority of business automations that include a model. It is not the right tool for everything. Long-running agent loops with dozens of tool calls and complex state are hard to observe and debug in a visual canvas; multi-agent systems with supervisors and hand-offs get unwieldy; and rigorous evaluation and testing are easier in code. Teams building a product feature rather than an internal workflow usually reach for a framework — LangGraph, the Claude Agent SDK, the OpenAI Agents SDK — or plain code with the model’s API. The frameworks comparison covers those trade-offs; AI agent vs n8n covers the decision itself.
A useful test: if the workflow can be drawn on a whiteboard as a line with one or two decision points, it belongs in n8n. If the whiteboard needs a loop within a loop, or the agent has to plan a variable number of steps, prototype in n8n and expect to move to code if it sticks.
Cost control
Model usage is billed per token by the provider; n8n itself is free self-hosted (Sustainable Use License) or priced per execution on n8n Cloud. In practice the token bill for a business workflow is small and the mistakes that inflate it are predictable: sending the whole record to the model when it needs three fields; using the largest model for classification; letting an agent loop without a step limit; and re-processing items on retries. The fixes are workflow hygiene — Set nodes that shape the input, a smaller model for chain steps, a max-iterations option on the agent, and idempotency keys. The templates ship with those defaults.
Hosting and data
n8n Cloud is the fastest start and fine for most teams. Self-hosting (Docker on a small VM, or Kubernetes) is the choice when data must stay in your environment or when execution volume makes it cheaper; it also lets you run a local model through Ollama for sensitive steps. Credentials live in n8n’s encrypted store either way; the model provider sees only what the workflow sends it, which is one more reason to shape inputs with a Set node before the agent.
Build it, or have it built
If you have someone who enjoys n8n, the templates above will get you a working first version in a day or two; the blueprints tell you what the guardrails need to be. If the value for you is in the result rather than the build, Agentmelt sets up any of these workflows on n8n, connects your tools, hosts and maintains it for $197–297 a month, setup included — and scopes custom versions from $2,000. You keep the JSON either way.
Frequently asked questions
What is the n8n AI Agent node?
It is n8n's node for running a language model in a loop with tools. You give it a chat model (Claude, GPT, Gemini, a local model), optional memory, a set of tools it may call (HTTP requests, code, other n8n workflows, a vector store, calculators), and an optional output parser. On each run the model reads the input, decides whether to call a tool, reads the result, and repeats until it produces a final answer. Everything before and after the agent node is normal n8n.
Is an n8n AI agent the same as an AI agent built in code?
Same idea — an observe–reason–act loop with tools — with different trade-offs. n8n gives you the integrations, the visual flow, credentials, retries and scheduling for free and is faster to build and hand over. Code frameworks (LangGraph, the Claude Agent SDK, OpenAI Agents SDK) give you finer control over state, long multi-step loops, testing and evaluation. Most business workflows sit comfortably in n8n; complex multi-agent systems are better in code.
Which model should I use in the AI Agent node?
For most business workflows a mid-tier model with strong tool use — Claude Sonnet is the default in the templates here — balances quality, speed and cost. Use a smaller model for classification and extraction steps that run on every item, and reserve the largest models for the few steps that need deep reasoning. The node lets you swap models without changing the workflow.
How do I stop an n8n agent from doing something wrong?
Give it only the tools it needs, make destructive actions go through an approval (a Wait node or a Slack button) instead of a tool call, use a structured output parser so downstream nodes get typed data, put the rules in the system prompt and check them in a Code or IF node, and route low-confidence results to a person. The blueprints on this site list the guardrails per workflow.
Does the agent need memory?
Only for conversations. A workflow that processes one ticket or one invoice per run needs no memory — each run is independent, which is simpler and cheaper. Chat-style agents (a Slack bot, a support assistant) use Simple Memory for short sessions or Postgres/Redis chat memory when conversations must survive restarts.
How much does running an n8n AI agent cost?
Two parts: n8n (free self-hosted under the Sustainable Use License, or n8n Cloud priced by executions) and model usage, billed per token by the provider. A typical business workflow — a few thousand runs a month with one or two model calls each on a mid-tier model — costs tens of dollars a month in tokens. Cost control is mostly about keeping deterministic work out of the model and choosing the smallest model that does each step well.
Can I run n8n agents on my own infrastructure?
Yes. Self-hosted n8n runs on a single server or in Docker/Kubernetes, and the model can be a cloud API or a local model via Ollama. That is the usual choice for teams with data-residency requirements.
Should I build this myself or have it built?
Build it yourself if you have someone who enjoys n8n and the workflow is simple enough to finish in a week. Have it built if the value is in the integrations and the guardrails rather than the learning — Agentmelt's automation workflows are $197–297/month with setup and maintenance included, and you keep the JSON either way.