# n8n AI Agent Node: How to Build an Agent and Connect a Model *How-to — 2026-10-09 — by Mahmoud Zalt* How the n8n AI Agent node works: attach a chat model, add tools and memory, wire a Chat Trigger, and where the newer Agent Builder fits in. **Short answer.** **The AI Agent node is a root node with sub-connections hanging off its underside, and a chat model plus at least one tool are what make it work.** You drop the AI Agent node onto the canvas, use the plus under its Chat Model connector to attach a model and its credential, then use the tools connector to give it things it can actually do. A Chat Trigger in front of it gives you somewhere to type. **About this guide.** This guide is based on publicly available information and n8n's own documentation, checked on 17 August 2026. Sistava is not affiliated with n8n. Interfaces and pricing change often, so confirm the current steps in their documentation before you rely on them. An agent in n8n is not a bigger node. It is a small assembly: one root node that does the reasoning, and a set of sub-nodes clipped underneath it that supply the model, the memory and the tools. That layout is the thing to understand first, because it is unlike every other node on the canvas. Ordinary nodes connect left to right and pass data along. The AI Agent node also has connectors along its bottom edge, and each one accepts a different kind of sub-node. Once you see the shape, the rest of the build is mechanical. ## What does the n8n AI Agent node do? It lets a language model decide which actions to take instead of you drawing them. n8n's own description of an agent is a chain that knows how to make decisions, and their conceptual page puts it plainly: when you send a query to an agent, it tries to choose the best tools to use to answer. Their node documentation is specific about the minimum viable setup. An AI Agent node needs a chat model, and it requires at least one tool sub-node connected to it. Without a tool there is nothing for the model to choose between, so the node is not really an agent yet. **There is only one agent type now.** n8n's AI Agent node documentation notes that from version 1.82.0 onward every instance functions as a Tools Agent, and the previous agent type setting was removed. Older tutorials that tell you to pick between agent types are describing a version you are probably not running, which is worth knowing before you go hunting for a dropdown that no longer exists. ## How do you connect a chat model to the AI Agent node? You use the plus icon on the Chat Model connector underneath the agent node, pick your provider from the list, then create or select the credential holding that provider's API key. Independent walkthroughs of the node describe exactly this flow, and it is the same pattern for every provider n8n supports. Two things are worth doing carefully at this point. Name the credential something you will recognise later, because a workspace with three model credentials all named after the node is unreadable within a week. And pick the model deliberately rather than accepting whatever appears first, since every user message runs the whole chain and the model choice is where the cost of that lands. ### Standing up an agent on the canvas 1. **Add a Chat Trigger** — This gives you a chat interface to test against. n8n's documentation states the Chat Trigger must connect to either an agent or a chain root node. 2. **Add the AI Agent node** — Connect it to the trigger. The sub-connectors along its bottom edge are what you fill in next. 3. **Attach a chat model** — Select the plus on the Chat Model connector, choose your provider, and create the credential with your API key. 4. **Attach at least one tool** — Use the tools connector. n8n's node documentation requires at least one tool sub-node before the agent is functional. 5. **Attach memory if the conversation needs it** — Memory is what lets the second message know about the first. Without it, every message starts from nothing. 6. **Test in the chat panel** — Send a message that should force a tool call, not just a greeting. A polite reply proves the model works, not the agent. ## How do you give an n8n agent tools? Through the tools connector on the agent node, one sub-node per tool. Many ordinary app nodes can be attached this way. n8n's Gmail node documentation, for example, says the node can function as an AI tool where many parameters can be set automatically, or with information directed by AI. That last phrase is where beginners lose an afternoon. A tool parameter can either be a value you set or a value the model fills in at runtime, and the model can only fill it in sensibly if the field is described well. One independent walkthrough of the agent node makes the same point about a database tool: supply a detailed schema description so the agent understands which tables and fields exist, or it will invent a query. Treat tool descriptions as the actual prompt engineering of an agent build. The system message tells the model who it is. The tool descriptions tell it what is real. A vague tool description produces a confident agent that calls the wrong thing. ## How does memory work in an n8n agent? Memory is a sub-node too, attached to its own connector, and it is what carries context from one message to the next inside a session. Independent tutorials describe a simple in-instance memory option that needs no extra credential, which is the sensible starting point while you are still testing. There is a detail in n8n's Chat Trigger documentation worth reading before you build anything user-facing. The node has a Load Previous Session option for retrieving earlier chat messages, and when it is enabled the Chat Trigger and the connected agent must both link to the same shared memory sub-node so there is a single source of data. Two different memory nodes means two different versions of the conversation. **In-memory storage is exactly as durable as it sounds.** An independent walkthrough notes that simple in-instance memory is lost on restart. That is fine for testing and wrong for anything a customer touches. If a conversation needs to survive a redeploy, move to a memory sub-node backed by real storage before you go live, not after the first restart eats a support thread. ## How do people actually talk to the agent? Through the Chat Trigger node, which n8n documents as the way to build chatbot and chat interface workflows. It carries the options that decide who can reach your agent, so it deserves more than thirty seconds of attention. - **Make Chat Publicly Available. **Controls whether the chat is reachable publicly or limited to the manual chat interface inside n8n. - **Mode. **Hosted Chat uses n8n's built-in interface. Embedded Chat expects your own interface to call the webhook URL the node provides. - **Authentication. **None, Basic Auth with a username and password, or n8n User Auth requiring an account login. - **Response Mode. **When Last Node Finishes, Using Response Nodes, or a streaming response for real-time output. - **Load Previous Session. **Retrieves prior messages, and requires the trigger and agent to share one memory sub-node. One line in that documentation deserves a highlighter: each user message triggers a complete workflow execution, consuming execution credits according to your plan. A chatty agent is not one execution, it is one execution per turn, and that is the number to model before you put it in front of customers. Assembly work like this is exactly what we removed at Sistava. Rather than attaching a model, a memory store and a tool sub-node and then describing each field well enough for the model to use it, you hire an AI Employee and tell it in plain English what you want handled. The tools are connected already, it asks you when it is unsure, and there is no sub-node graph to keep in your head. ## What is the Agent Builder, and how is it different? n8n also documents a separate way of building agents that does not live on the workflow canvas at all. Their guidance describes agents as first-class artifacts alongside workflows, created through an Agent Builder reached from the Agents tab after you select a project, rather than assembled as nodes. The configuration is form-shaped rather than graph-shaped. You choose a provider and model in the Agent tab's Model field, and n8n prompts you for credentials if it needs them. You describe the agent's role, tone, response format and boundaries in an Instructions field. Tools are added through Add tool in the Tools section, covering built-in integrations, project workflows, custom tools defined by JSON schema, and external tools reached over MCP servers. Memory is handled differently here too. n8n's documentation says session memory keeps the context of the current conversation, that it is on by default and needs no setup, while episodic memory requires OpenAI credentials. Published agents can also be delegated to as sub-agents from the Agents section. Which route you take depends on where the agent belongs. If it is one reasoning step inside a larger pipeline that already fetches, transforms and writes data, the node keeps it on the same canvas as everything else. If it is a standalone assistant people will talk to, the builder is the shorter path. | | AI Agent node | Agent Builder | |---|---|---| | Where it lives | On the workflow canvas | In the Agents tab of a project | | Shape | Root node plus sub-nodes | A form with Model, Instructions and Tools | | Model choice | Chat Model sub-node with a credential | Model field in the Agent tab | | Tools | One sub-node per tool | Add tool, including MCP servers | | Memory | Memory sub-node you attach | Session memory on by default | | Good for | Agents that are one step inside a larger workflow | A standalone assistant you publish and reuse | **Read the limitations before you pick this route.** n8n's own documentation lists constraints on the Agent Builder path: it is not ready for self-hosted Enterprise yet, queue mode is unsupported for agents, channel connections can fail in queue mode, and knowledge bases on self-hosted require a Daytona sandbox. If you are self-hosting at any scale, check these against your setup first. This list will change, so treat it as a prompt to go and read rather than a settled fact. ## What do people get wrong when building an agent in n8n? - **Testing with a greeting. **Saying hello proves the model responds. Only a message that forces a tool call proves the agent works. - **Thin tool descriptions. **The model picks tools from their descriptions. Vague ones produce confidently wrong calls. - **No memory, then blaming the model. **Without a memory sub-node, every message is the first message. - **Ignoring the per-message execution cost. **n8n documents that each user message triggers a full workflow execution against your plan. - **Following a tutorial written for an older version. **The agent type setting is gone, and this space moves faster than the blog posts about it. None of this is a criticism of n8n. Giving people a visual way to assemble an agent out of a model, a memory store and real tools is genuinely hard, and the sub-node design makes the moving parts visible instead of hiding them. The cost is that the moving parts are yours: you choose them, describe them, and own them when the model picks badly. If what you wanted was an assistant that already knows its job, that is the question Sistava answers. You hire an AI Employee for a role, brief it in a paragraph, and correct it in plain English when it gets something wrong, the same way you would coach a new hire. ## FAQ ### What does the n8n AI Agent node need to work? A chat model and at least one tool. n8n's node documentation states that an AI Agent node requires at least one tool sub-node connected to it, and it needs a chat model to do the reasoning. Both attach to connectors along the bottom edge of the node rather than to its left or right side. ### How do I connect a chat model to the AI Agent node in n8n? Use the plus icon on the Chat Model connector underneath the agent node, select your provider from the list, then create or choose the credential that holds that provider's API key and pick the model. Independent walkthroughs of the node describe this same flow across providers. ### Which models can I use with an n8n agent? n8n supports a range of providers through separate chat model sub-nodes, and independent tutorials show builds using different vendors including ones with free tiers. Rather than trusting any list in an article, open the Chat Model connector in your own instance, which shows exactly which providers your version offers. ### Does an n8n agent remember previous messages? Only if you attach a memory sub-node. n8n's Chat Trigger documentation also describes a Load Previous Session option for retrieving earlier messages, and notes that when it is enabled the Chat Trigger and the connected agent must link to the same memory sub-node so there is a single source of data. ### What is the difference between the AI Agent node and the Agent Builder? The AI Agent node is assembled on the workflow canvas from a root node and sub-nodes. The Agent Builder is a separate interface reached from the Agents tab in a project, where you configure a Model field, an Instructions field and a Tools section instead of wiring sub-nodes. n8n documents limitations on the Agent Builder route including no support for queue mode and self-hosted Enterprise. ### How much does an n8n chat agent cost to run? There are two costs stacked on each other: your model provider's charges for the tokens, and n8n's own execution accounting. n8n's Chat Trigger documentation states that each user message triggers a complete workflow execution and consumes execution credits based on your plan, so a long conversation is many executions rather than one. ## Sources - [n8n documentation, ](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent.md)AI Agent node - [n8n documentation, ](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.chattrigger.md)Chat Trigger node - [n8n documentation, ](https://docs.n8n.io/build/build-and-manage-agents.md)Build and manage agents - [n8n documentation, ](https://docs.n8n.io/build/integrate-ai/understand-ai-components/what-agents-do.md)What agents do - [n8n documentation, ](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.gmail.md)Gmail node - [Pondhouse Data, ](https://www.pondhouse-data.com/blog/ai-agents-with-n8n)Building AI Agents with n8n - [Hostinger Tutorials, ](https://www.hostinger.com/tutorials/how-to-build-ai-agent-with-n8n/)How to build an AI agent with n8n **Tags:** n8n, ai-agents, workflow-automation, llm-tools, chat-model