"AI agents" is the most overused phrase of 2026, so let's bring it down to earth. An AI agent in n8n is a workflow where a language model doesn't follow a fixed path but decides what to do: the AI Agent node receives the query, picks among the tools you gave it (check stock, look up an order, create a ticket), runs them, and builds the response. The difference from a fixed-response chatbot is exactly that: the chatbot walks through a tree someone drew; the agent reasons about the context and resolves cases nobody explicitly programmed.
What the n8n AI Agent node does, piece by piece
The AI Agent node is an orchestrator with four sockets. Understanding them is understanding agents:
- Chat Model: the brain. You connect OpenAI, Claude, Gemini, or a local model. This is where you define the system prompt: who the agent is, what it can do, and — more importantly — what it must NOT do.
- Tools: the hands. Each tool is a named, described capability: "check_stock: returns available units of a product by code or name." The model reads those descriptions and decides on its own when to use each.
- Memory: the thread of the conversation. Without memory, every message starts from scratch and the agent asks the customer for the order number three times. With memory (Simple Memory to start, Postgres or Redis in production), it remembers what was said.
- Output Parser (optional): forces the agent to respond in a structured format (JSON) when the output feeds another system instead of a human.
The key distinction to keep your head straight: a tool isn't a decorative integration, it's delegating decisions. In a classic workflow, you decide when stock gets checked. In an agent, the model decides. That's what makes it flexible — and what makes scoping it well so important.
Agent vs. fixed-response chatbot vs. classic workflow
| Criterion | Classic workflow | Fixed-tree chatbot | AI agent |
|---|---|---|---|
| Execution path | Predefined | Predefined (menus) | Decided by the model |
| Unforeseen questions | Fails | "I didn't understand your query" | Resolves them if it has tools |
| Cost per interaction | ~USD 0 | ~USD 0 | USD 0.002-0.01 |
| Predictability | Total | Total | High but not total |
| Maintenance | Low | Medium (tree grows) | Medium (prompts and tools) |
The uncomfortable conclusion almost nobody writes down: if your process has a single, known path, you don't need an agent — you need a classic workflow, which is cheaper, faster, and 100% predictable. The agent is worth it when the input is varied natural language and resolving it requires combining sources.
End-to-end example: an agent that checks stock and answers customers
The case we get asked for most: customers asking on WhatsApp "do you have the X-200 booster pump?" and someone on the team dropping what they're doing to look it up in the system. Let's build the full agent:
Step 1 — Trigger: a WhatsApp node (via the WhatsApp Business API or a provider like Evolution API self-hosted). Each incoming message fires the workflow. If you want to go deeper on this part, we have a guide on automating WhatsApp with n8n.
Step 2 — AI Agent node with this system prompt (summarized):
You're the sales assistant for a plumbing-supplies distributor. You answer stock and price queries using the available tools. If the product doesn't exist or the query isn't about products, you hand off to a human with the "escalate" tool. Never make up stock or prices. Reply in clear, concise language, no more than 3 sentences.
Step 3 — Tools (three are enough):
check_stock: an HTTP Request to the management system's API (or a direct database query with the Postgres node). It takes a product name or code and returns units and price. If your system doesn't expose this data, that bridge is exactly what we solve with API development.find_product: fuzzy search by description, for when the customer writes "the little pump for the tank" instead of the code.escalate: a sub-workflow that notifies a salesperson on Slack with the conversation history and tells the customer a human will reach out.
Step 4 — Memory: Simple Memory with a 10-message window, key = customer's phone number. That way "and in white?" is understood as a continuation of the previous query.
Step 5 — Response: the agent's output goes back through the same WhatsApp channel.
Build time for the first working version: an afternoon if the stock API already exists. Taking it to real production — validations, error handling, conversation logging, edge cases — is usually where an AI integration partner comes in.
Want to see an agent answering with YOUR products and YOUR stock? Book a 30-minute demo and we'll build it live with your business's data.
How much it costs to run an agent: the token math, for real
The numbers nobody publishes, with 2026 GPT-4o-mini pricing (USD 0.15 per million input tokens, USD 0.60 per million output):
A typical conversation for the stock agent:
- 8 back-and-forth messages, with system prompt, history, and 2 tool calls.
- Total consumption: ~6,000-12,000 accumulated input tokens + ~1,000 output.
- Cost: USD 0.002 to 0.008 per conversation.
Projected to monthly scale:
| Conversations/month | Token cost (GPT-4o-mini) | With high-end Claude/GPT |
|---|---|---|
| 500 | USD 1-4 | USD 15-60 |
| 2,000 | USD 5-16 | USD 60-240 |
| 10,000 | USD 25-80 | USD 300-1,200 |
Three lessons from that table:
- Token cost isn't the problem for the vast majority of SMBs: the 2,000-conversation agent costs less than lunch. The real cost is in implementation and maintenance.
- Choose the model based on the task: to check stock and answer briefly, an affordable model is plenty. Save high-end models for complex reasoning (contract analysis, deep technical support).
- Memory inflates the bill: every message re-sends the history. Cap the memory window (10-15 messages) or a chatty agent will multiply your tokens by 5.
On top of that, add n8n infrastructure: USD 10-30/month self-hosted. Compare it against the 2-4 hours a day the team spends answering stock queries and the math closes on its own.
When an AI agent is NOT for you
The section that loses us sales and wins trust:
- Deterministic process: if the response to every input is always the same, a classic workflow or a menu chatbot does it for free and without hallucinating. Don't put a language model in charge of an
IF. - Zero tolerance for error: an agent gets it right 90-98% of the time depending on how well it's scoped. If a wrong answer costs money or reputation (binding prices, legal or medical matters), have the agent suggest and a human approve.
- Messy data: if the system's stock is always out of date, the agent will answer wrong with total confidence. Fix the source first.
- No volume: for 5 queries a day you won't even pay off the build. Automate something else first — there are 25 examples of automations with n8n to choose from.
The first agent is built scoped, or it isn't built at all
Start with ONE use case, TWO or three tools, and a system prompt that clearly states what it cannot do. Measure for a week, tune the prompt, and only then expand. The agents that fail are the ones born wanting to solve everything.
At Deepyze we design, implement, and maintain AI agents on n8n for companies across LATAM: from AI chatbots that serve customers 24/7 to internal agents that unblock operations, as part of our AI automation service. Fixed price, a team in your time zone, and a proposal in 24 hours. Tell us which queries you'd like answered automatically and we'll build the agent end to end.
Frequently asked questions
What is an AI agent in n8n?+
It's a workflow built around the AI Agent node: a language model that receives a goal, decides which tools to use (check stock, look up an order, create a ticket), and runs the necessary steps until it resolves the request. Unlike a classic workflow, the path isn't fixed in advance: the agent decides it based on context.
What's the difference between an AI agent and a regular chatbot?+
A fixed-response chatbot follows a decision tree: if the customer taps 'hours', it replies with hours. An agent understands the query in natural language, can query your systems in real time, and combines several actions in a single conversation, even for questions nobody explicitly programmed.
What is a tool in the AI Agent node?+
A tool is a capability you give the agent: a sub-workflow, an HTTP call to your API, or a database query, with a name and a description. The model reads those descriptions and decides on its own when to invoke each one. Without tools, the agent can only chat; with tools, it can act.
How much does it cost to run an AI agent in n8n?+
With an affordable model like GPT-4o-mini, a typical conversation of 6-10 messages with 2-3 tool calls costs between USD 0.002 and USD 0.01 in tokens. An agent handling 2,000 conversations a month runs at USD 5-20 monthly, plus n8n infrastructure.
Do I need to know how to code to build an agent in n8n?+
For a first agent with simple tools (querying a spreadsheet, calling a documented API), no: everything is configured visually. For production with real customers — error handling, response validation, escalation to humans — technical support helps, because a poorly scoped agent will answer anything.
Want this working in your company?
At Deepyze we turn manual processes into systems that work on their own: AI automation, web and mobile apps, and custom software. Tell us your case and you will have a concrete proposal within 24 hours.
Sin compromiso · Respuesta en 24 hs · Equipo en tu mismo huso horario