n8n AI BuilderPick your trigger, model, memory, and tools. Get the exact node graph.
This is not a platform comparison. It is a working guide to n8n's own AI Agent node, with a config tool below that outputs the real node list you would wire up, plus the documented limitations (memory, tool calling, local models) that only show up once you build something past a demo.
Updated July 20, 2026 - By Jim Liu
TL;DR - what n8n gives you for building AI agents
- One AI Agent node, run as a Tools Agent by default, that connects to any OpenAI, Anthropic, Google, or Ollama chat model.
- Memory is opt-in and matters - Simple Memory does not survive a restart, Postgres and Redis do.
- Tools attach as sub-nodes - HTTP requests, code execution, vector search, and calling other n8n workflows.
- Free to self-host, no execution cap; cloud plans start at 20 euros a month if you would rather not run a server.
n8n AI Builder — configure your agent
Pick a trigger, a model provider, a memory type, and the tools your agent needs. The node graph on the right updates as you go — it is the actual build order, not a mockup.
Node graph to build in n8n
Attach as Memory input — conversation history survives restarts.
1. Chat Trigger
2. AI Agent (Tools Agent)
3. OpenAI Chat Model
4. Postgres Chat Memory — Attach as Memory input — conversation history survives restarts.
5. HTTP Request ToolCommon setup patterns — click to load
Four configurations that come up often when people build n8n AI agents. Not live usage counts — just patterns worth starting from.
Next step
Committed to n8n already? Wire the node graph above into a real workflow. Still deciding between platforms? Compare n8n against five alternatives on triggers, code comfort, and budget.
What the AI Agent node actually does
n8n's AI Agent node sits in the middle of a workflow and makes one decision over and over: given the conversation so far, does it answer directly, or call a tool first. You feed it a chat model as a required sub-node input, and that model is what reasons about the decision. Everything else, the trigger, the tools, the memory, is plumbing around that one node.
By default the AI Agent runs as a Tools Agent. It uses the connected model's native function-calling API, which is the setting n8n recommends whenever your model supports it. There is a second mode, Conversational Agent, that describes the available tools inside the system prompt and parses the model's text output for a tool call instead of using a structured API. That fallback exists for models that never got function calling, or for simpler chat interactions where a full agent loop is overkill.
The practical implication: pick Tools Agent unless you have a specific reason not to. It is more reliable at actually calling the tool you meant, and it is what most current chat-model APIs (OpenAI, Anthropic, Gemini, and the tool-calling-capable Ollama models) are built to work with.
Memory: what persists and what does not
Memory in n8n is a sub-node you attach to the AI Agent, not a setting you toggle on. Skip it and the agent has no idea what was said two messages ago, which is fine for a single-shot tool and bad for anything conversational.
Simple Memory keeps the conversation in n8n's own running process. It works, and it is the fastest way to test a multi-turn agent, but the history does not survive the workflow finishing or n8n restarting. If your chat widget is expected to remember a user across page reloads or your server redeploys, Simple Memory will quietly lose that context.
Postgres Chat Memory and Redis Chat Memory write history to an actual database keyed by a session ID, so conversations survive restarts and scale past whatever fits in n8n's process memory. For a webhook-triggered agent, that session ID usually comes from the caller (a user ID, a ticket number) rather than being generated by n8n itself, so plan for that field when you design the trigger payload.
Giving your agent tools
Tools are what turn a chatbot into something that does work. Each tool you attach under the AI Agent node becomes a function the model can choose to call, with a description it uses to decide when that call makes sense.
The four tool types in the builder above cover most real workflows. HTTP Request Tool lets the agent call any REST API you point it at. Code Tool runs a JavaScript or Python snippet you write, useful for calculations or formatting the model should not be trusted to do free-form. Vector Store Tool gives the agent retrieval over your own documents, but it needs an embeddings node and a vector store node (Pinecone, Qdrant, Supabase Vector Store, and similar are all supported) wired underneath it to actually have something to search. Call n8n Workflow Tool lets one agent trigger a separate n8n workflow as a sub-task, which is how you keep a single agent from turning into one enormous, unmaintainable canvas.
n8n AI builder vs Zapier AI, Make, and friends
This page is deliberately n8n-only, because the node-level detail above does not generalize across platforms. The short version: n8n wins on self-hosting, per-execution pricing that does not scale per task, and control over exactly what each node does. Zapier AI Agents win on breadth, a prompt-driven builder, and not having to run any infrastructure yourself. Make sits in between with more branching logic than Zapier but a smaller AI-specific node set than n8n.
If you are still choosing a platform rather than committing to n8n, the comparison and 6-way picker linked above walks through triggers, budget, and code comfort in more detail than fits here.
What it costs to build AI agents in n8n
| Plan | Price | Executions | AI credits |
|---|---|---|---|
| Self-hosted Community | Free (pay for your own server) | Unlimited | N/A - bring your own API key |
| Cloud Starter | 20 euros/mo, billed annually | 2,500/mo | Up to 2,300/mo |
| Cloud Pro | 50 euros/mo, billed annually | 10,000/mo | Up to 13,700/mo |
| Cloud Business | 667 euros/mo, billed annually | 40,000/mo | Included, plus SSO/SAML |
One execution is one full workflow run, regardless of how many nodes fire inside it. A self-hosted instance on a small VPS runs $3 to $7 a month; the rest of your cost is whatever OpenAI, Anthropic, or Google charges for the tokens your Chat Model node actually sends.
Real issues developers hit
Sourced from n8n's own GitHub issue tracker and community forum, not invented for this page.
Tool calls the agent makes are not saved back into memory. After enough turns, the model loses track of which tools it already ran and stops calling one it needs, because its own history no longer shows the call happened.
Source: n8n-io/n8n GitHub issue #14361Several builders on the community forum report the agent skipping a tool call entirely once a memory node is attached, then calling it correctly again after they temporarily disconnect memory to test.
Source: n8n Community forumA separate thread walks through the same root cause from the opposite angle: the agent insists it already sent a message via a tool node, when the tool run never happened, because the tool step is missing from what memory can show it.
Source: n8n Community forumFrequently asked questions
- What is the n8n AI Agent node?
- It is the piece of an n8n workflow that lets a language model decide which tools to call and in what order. You connect a chat model, optionally a memory node, and one or more tools underneath it. By default it runs as a Tools Agent, which n8n recommends for models that support function calling.
- Does n8n's AI agent remember previous messages?
- Only if you attach a memory sub-node. Simple Memory keeps history in n8n's own process, and that history is gone once the workflow finishes or n8n restarts. Postgres and Redis Chat Memory persist across sessions and restarts.
- Is n8n free for building AI agents?
- Self-hosted Community Edition is free with no execution limit; you only pay for the server, usually $3 to $7 a month on a small VPS. Cloud Starter is 20 euros a month billed annually with 2,500 executions and 2,300 AI credits, Pro is 50 euros a month, Business is 667 euros a month with SSO.
- Can I use a local model like Ollama with the AI agent?
- Yes, n8n has a native Ollama Chat Model node. The catch is tool calling: not every model you pull from Ollama supports function calling, so check the model card before wiring it into a Tools Agent.
- Tools Agent vs Conversational Agent, what is the difference?
- Tools Agent uses the model's native function-calling API and is the recommended default. Conversational Agent describes tools inside the system prompt and parses the text response instead, a fallback for models without function calling.
- How do I give my agent access to my own documents?
- Add a Vector Store Tool under the AI Agent node, then connect an embeddings node and a vector store node (Pinecone, Qdrant, Supabase, or similar) beneath it. The tool alone has nothing to search until those pieces are wired in.
- n8n vs Zapier AI, which should I use for agents?
- n8n fits self-hosting, per-execution pricing, and node-level control. Zapier AI Agents fit a prompt-driven builder with the largest app-connector library and zero infrastructure. See our full platform picker for the side-by-side.
- How many AI credits does n8n cloud include?
- Starter includes up to 2,300 AI credits a month, Pro up to 13,700. Credits meter n8n's built-in AI features; bringing your own API key means you also pay that provider directly.
Related tools and guides on OpenAI Tools Hub
AI Agent Workflow Builder Picker
5-question picker ranking n8n against Zapier AI, Make, Dify, Flowise, and LangChain.
n8n vs Make vs Zapier
Head-to-head on the three most common automation platforms.
MCP Server Boilerplate Generator
Turn a list of CLI commands into a runnable MCP server your n8n agent could call.
AI Agent Loop Prompt Builder
Build the trigger, acceptance check, and stop conditions for an agent loop prompt.
LLM API Cost Calculator
Work out what your Chat Model node will actually cost per month.
MCP vs A2A Protocol
How agent-to-tool and agent-to-agent protocols complement a workflow like this one.
Built by
Jim Liu runs self-hosted n8n instances for personal automation and agent projects, including Postgres-backed memory setups. No vendor relationship with n8n, no affiliate links on this page.