n8n AI Agent
BeginnerAi AgentsA no-code AI agent in n8n: a model that picks its own tools, with memory and a chat window.
Published 27 September 2026 · Last updated 2 October 2026
About n8n AI Agent
This stack builds an AI agent without writing a backend. In n8n's visual editor, the AI Agent node connects a chat model to a set of tools, and for each request the model decides which tools to call, reads what they return, and repeats until it has an answer. That is the difference from an ordinary automation, where every step is fixed in advance: here the workflow supplies the tools and the limits, and the model chooses the path.
Tools are where n8n earns its place. Any of its app integrations can be handed to the agent as a tool, so reading a spreadsheet, searching a CRM, sending a Slack message, or creating a ticket takes a node and a credential, not custom code. A tool can also be another n8n workflow, an HTTP request, a code snippet, or a server from n8n's MCP registry. Risky tools can require a person's approval before they run, with the request sent to Slack, Telegram, or the chat itself.
The agent needs somewhere to talk and something to remember. n8n's Chat Trigger gives it a hosted chat page or an embeddable widget, and the same agent can be started from Slack, Telegram, email, a webhook, or a schedule. Simple Memory keeps the recent conversation with no setup, which is enough to start. A PostgreSQL database can be added so that conversations survive restarts and scale past one n8n process, and a vector database such as Qdrant or Pinecone can be added to let the agent search your own documents.
The model is a sub-node you can swap: Claude is the default, and OpenAI, Google Gemini, Mistral, or DeepSeek replaces it by changing one node and its credential. Model usage is the bill that grows, since an agent makes several model calls per request, while n8n itself is either a flat monthly plan on n8n Cloud or free to self-host. n8n also has a newer Agents feature, still in preview, that sets up an agent with instructions, tools, and channels outside a workflow. Open-weight models are optional as well, through Groq or, on a self-hosted n8n, a local Ollama.
Key Features
- ✓n8n's AI Agent node: a model that chooses which tools to call, built in a visual editor
- ✓Hundreds of n8n integrations usable as agent tools, plus other workflows, HTTP requests, code, and MCP servers
- ✓A hosted chat page or an embeddable chat widget from the Chat Trigger, with optional login
- ✓Conversation memory, from the built-in Simple Memory to a database
- ✓Human approval for selected tools before they run
- ✓Swappable chat models: Claude by default, or OpenAI, Google Gemini, Mistral, or DeepSeek
- ✓Built-in evaluations to test an agent against saved examples
When to Use n8n AI Agent
- →An internal assistant that answers questions from your spreadsheets, CRM, or knowledge base
- →A support agent that looks up an order or a ticket and drafts or sends the reply
- →A chat window on your site backed by your own documents
- →An operations agent in Slack or Telegram that takes requests and acts across your tools
- →A scheduled agent that researches a topic and posts a summary
Pros
- No backend code: the agent, its tools, and its chat interface are all configured visually
- n8n's integrations double as the agent's tools, so connecting a new system takes minutes
- Runs on n8n Cloud or on your own server with the same workflow
- The model is one node, so changing provider does not touch the rest
Cons
- Less control than agent code: complex branching, custom state, and automated tests are harder in a visual editor
- Model costs are hard to predict, because one chat message can turn into several model calls
- The simplest memory is not meant for production at scale: it stops working once n8n runs in queue mode
- n8n's AI features change quickly, and its newer Agents feature is still in preview
LLM Options for n8n AI Agent
The default. An agent's quality depends on how reliably the model picks the right tool and fills in its parameters, and Claude is strong at following a detailed system message across many tool calls. It connects through n8n's Anthropic Chat Model node. The current Sonnet model costs $2 per million input tokens and $10 per million output, and Haiku at $1 and $5 suits simple, high-volume agents.
GPT models through the OpenAI Chat Model node. Most n8n agent templates and community examples are built around them, which makes them the easiest to copy from. The mid-tier model costs $2 per million input tokens and $10 per million output, and the smallest tier, at $0.10 and $0.50, keeps a busy agent cheap when its tasks are simple.
Gemini through the Google Gemini Chat Model node. Its Flash and Flash-Lite models are among the cheaper capable ones, with Flash-Lite at $0.30 per million input tokens and $2.50 per million output, and they accept images, audio, and video, which helps when the agent reads screenshots or scanned documents. A rate-limited free tier in Google AI Studio is enough to build and test an agent before paying.
Mistral through the Mistral Cloud Chat Model node, the European option. Mistral Small costs $0.15 per million input tokens and $0.60 per million output, and the free Experiment tier gives rate-limited access to every API model, which covers prototyping. The weights are open, so the same model can later run on your own hardware if data has to stay in house.
The low-cost choice, through n8n's DeepSeek Chat Model node. The Flash model costs $0.15 per million input tokens and $0.60 per million output off-peak, with weekday peak hours billed at double, which suits agents that handle routine requests all day. The API is operated by a Chinese company, which rules it out under some data policies.
These are highlighted picks. To see all the tools, check the LLM category.
n8n AI Agent Add-ons
Each addition below extends this stack with a capability the base stack works fine without. None are required: include the ones your product actually needs when building this stack, and skip the rest.
Database Add-ons
Add a database when the app needs to persist data between sessions: user records, application state, or anything that should survive a restart.
Persistent memory for the agent. n8n's Postgres Chat Memory node stores each conversation in a table it creates itself, keyed by session, so chats survive restarts and work when n8n runs several workers, which the built-in Simple Memory does not. The same database can hold the agent's working data, read and written through the Postgres node as a tool, and document embeddings through the PGVector store. Free on your own server.
Managed PostgreSQL when you would rather not run a database. The Postgres Chat Memory node connects with Supabase's connection details, and n8n has a Supabase Vector Store node, so one project covers chat memory and document search. The free plan pauses a project after a week without activity, which an agent used only now and then will hit, so anything long-lived belongs on Pro, from $25 a month.
These are highlighted picks. To see all the tools, check the Databases category.
Vector Database Add-ons
Add a vector database when the agent needs to find documents, notes, or past conversations by meaning instead of exact keywords.
A vector database for giving the agent your documents to search, through n8n's Qdrant Vector Store node, which works as a tool the agent calls when a question needs it. Qdrant runs as one container next to a self-hosted n8n, or as Qdrant Cloud, where a small free cluster is enough to test. A separate n8n workflow loads the documents and keeps them up to date.
A fully managed vector database with nothing to run, connected through n8n's Pinecone Vector Store node. It fits n8n Cloud well, since both are hosted and need only an API key. The Starter plan is free for prototypes. n8n's built-in Simple Vector Store is the zero-setup way to try retrieval first, but it keeps data in memory, so it is for testing only.
Model Inference Add-ons
Add model inference when you want an open-weight model in the mix: on your own hardware for privacy, or on a hosted inference provider for speed and low per-token prices.
Hosted open-weight models with very fast output, through n8n's Groq Chat Model node. Speed matters for a chat agent because every tool call waits on a model response. There is a rate-limited free tier, and paid usage starts at a few cents per million tokens on small models. A good match when the agent's tasks are simple and response time is what users notice.
A local model through n8n's Ollama Chat Model node, which in practice means a self-hosted n8n, since n8n Cloud can't reach a model on your own machine. Nothing leaves your network and there is no per-token cost. The model has to support tool calling, and small local models pick tools less reliably than hosted ones, so test the agent's hardest request first. When both run in Docker, n8n reaches Ollama by its container name, not by localhost.
These are highlighted picks. To see all the tools, check the AI Runtime & Serving category.
Model Aggregator Add-ons
Add a model aggregator when you want one API key and one bill for models from many providers, with automatic fallback when one of them is down, instead of setting up each provider separately.
One API key and one prepaid balance for hundreds of models, through n8n's OpenRouter Chat Model node. It is the quick way to try several models on the same agent without opening an account with each provider: change the model name in the node and run the test chat again. Models are billed at the providers' prices, with a 5.5% fee when you buy credits.
These are highlighted picks. To see all the tools, check the AI Model Aggregators category.
Frequently Asked Questions about n8n AI Agent
Which model should I use for the agent?
Start with what the agent has to do. Picking the right tool and filling in its parameters correctly is the hard part, and stronger models do it more reliably, so Claude's Sonnet or OpenAI's mid-tier model is the safe start for an agent with many tools or long instructions. For an agent with two or three simple tools and a high volume of requests, a small model is enough and far cheaper: Haiku, the smallest GPT tier, Gemini Flash-Lite, Mistral Small, or DeepSeek. Because the model is a sub-node, you can test this directly: swap the node, rerun the same chat, and compare. Mixing is common too, with a small model on a routing step and a stronger one inside the agent.
Do I need the AI Agent node, or is a simple AI step enough?
Use an agent only when the model has to decide what to do. If the steps are known in advance, for example classify this email, extract these fields, then write to the CRM, a fixed workflow with a Basic LLM Chain, Text Classifier, or Information Extractor node is cheaper, faster, and more predictable, because each run makes one model call and always follows the same path. An agent is for open-ended requests: a person asks something in chat and the right tools depend on the question. Agents also bring memory, which chains in n8n do not have. Many good builds combine the two: an agent for the conversation, calling fixed workflows as its tools for anything that must happen the same way every time.
Where does the agent's memory live, and when do I need a database?
Simple Memory keeps the last few exchanges inside n8n and needs no setup, which is right for building and for a single small instance. It has two limits. It does not work in an active workflow once n8n runs in queue mode, because separate workers don't share it, and it is not a store you can query or back up. Postgres Chat Memory fixes both: conversations are written to a table, survive restarts, and are shared across workers. A vector database is a different thing. Memory is what was said in this conversation, while a vector store holds documents the agent can search by meaning. Add one when the agent should answer from your own files, not before.
What does it cost as usage grows?
Two bills behave differently. n8n is flat: a self-hosted instance has no execution limit, and n8n Cloud counts one execution per workflow run however many steps the agent takes, on plans from €20 a month for 2,500 executions. The model bill grows with use, and faster than for a simple AI step, because an agent sends its instructions, its tool descriptions, and the conversation so far on every model call and makes several calls per request. The levers are a smaller model where the task allows, fewer and better-described tools, a short memory window, and the node's limit on iterations so that a confused agent stops. The Pricing section has the per-model rates.
Should I run this on n8n Cloud or self-host n8n?
n8n Cloud is the quick start: nothing to install, the chat page gets a public HTTPS address at once, and n8n's newer Agents feature is available on every Cloud plan, while a self-hosted instance needs extra setup for it. Self-hosting has no execution limit, keeps every conversation and credential on your own server, and is the practical way to use a local model through Ollama. It also means you run the database, updates, and backups. The agent workflow is the same either way and can be exported from one and imported into the other. The n8n Self-Hosted stack covers the server setup, and n8n Quick Deploy starts from a provider's one-click template.
Stacks Related to n8n AI Agent
Zapier + Spreadsheet Database
ProjectZapier automation workflows backed by Airtable, with alternative spreadsheet-style backends available.
Make + Spreadsheet Database
ProjectMake automation scenarios backed by Airtable, with Google Sheets available as a simpler spreadsheet backend.
Shopify Automation
ProjectAutomation workflows triggered by Shopify order and inventory events, with Zapier, Make, or n8n as the automation engine.
Webflow Automation
ProjectAutomation workflows triggered by Webflow form and CMS events, with Zapier, n8n, or Make as the automation engine.
Scores
Popularity4/5
n8n is among the most-used automation platforms and has become a common way to build agents without code, with a large library of community agent templates.
Learning Curve2/5
The agent is assembled visually from a model, tools, and memory, and a working chat takes minutes. Writing a good system message, describing tools so the model uses them correctly, and testing the agent's answers take longer to learn.
Flexibility4/5
Hundreds of integrations, other workflows, code, HTTP requests, and MCP servers can all be tools, and the model, memory, and vector store are swappable nodes. Control flow inside the agent loop is limited to what the node exposes.
Performance3/5
Response time is set by the model and by how many tool calls a request needs. n8n adds little overhead and streaming keeps a chat responsive, but a visual workflow is not built for high-volume, low-latency agent traffic.
Portability4/5
Workflows export as JSON and run on n8n Cloud or any self-hosted instance, and the model is a swappable node. The agent logic is tied to n8n's nodes and would be rebuilt to move to code or to another platform.
Tools in the n8n AI Agent Stack
n8n AI Agent Pricing
n8n is free to self-host, and n8n Cloud starts at €20 a month for 2,500 workflow runs, where a run counts once however many steps the agent takes. The model is the bill that grows: mid-tier models cost about $2 per million input tokens and $10 per million output, small ones a tenth of that or less, and an agent makes several model calls per request. Chat memory in PostgreSQL and a vector database are optional, with free tiers or no cost on your own server.
Self-hosting has no execution limit. n8n Cloud's Starter plan is €20 a month billed yearly for 2,500 executions, and Pro is €50 for 10,000.
About $2 per million input tokens and $10 per million output on mid-tier models, and from $0.10 and $0.50 on small ones. Several model calls per request. Usually the largest line.
PostgreSQL and Qdrant are free on your own server, Qdrant Cloud and Pinecone have free tiers, and a managed PostgreSQL plan for anything long-lived starts at $25 a month.