- Home
- Resources
- Integrations
- AI Agent
n8n AI Agent nodeConfigure AI Agent in n8n.
The AI Agent node turns a workflow into something that decides. The n8n AI Agent node reads each incoming item, picks which connected tool to call, and writes the answer. Eleven parameters shape how it behaves, four ports carry everything it needs to run.
Verified Trustpilot reviews · AI, automation & growth agency
What does the n8n AI Agent node actually do?
The AI Agent node is a root node: it receives items from the workflow through its main input, then loops between the chat model and the tools you attached until it has something to return. The pieces around it are sub-nodes, small nodes that clip onto a port under the agent instead of sitting in the workflow line. One type of sub-node per port, and a sub-node never runs on its own.
Start with a support inbox. A Gmail node brings the message in, and a System Message tells the agent to answer refund questions itself and escalate anything about a broken order. Give it one tool and it stops improvising: it calls the tool, gets a real value back, and writes the reply around that value.
Second shape, a chat that remembers. Attach a memory sub-node and the agent keeps the thread between runs, which is what makes an internal assistant in Slack bearable to use. Without memory, every message starts from zero and the agent asks again for the order number it was given a minute earlier.
Third, an agent that feeds a table. Turn on Require Specific Output Format, connect an output parser, and the answer arrives as named fields instead of a paragraph. The next node can then append a row to Google Sheets with no parsing step in between.
Not every AI step deserves an agent. When the task is fixed, summarize this, classify that, a plain model call does the same work with fewer moving parts and no tool loop to debug. The agent earns its place when the next action depends on what the model finds, and when a guess should be replaced by a real lookup. Same reasoning for a dedicated node: if a single Openai call covers the case, take the simpler path.
The limits are worth knowing before you build. This page describes version 3 of the node. The agent type selector was deprecated in n8n 1.82.0 and every agent now runs as a Tools Agent, while node version 1 is removed from n8n 3.0, so the old SQL, ReAct, Plan and Execute and OpenAI Functions variants stop working there. A chat model is required, and at least one tool has to be connected. n8n itself adds nothing to your bill, but the provider behind the model charges its own API calls under its own terms. For the platform question, the n8n review covers it, and the n8n training walks through building these workflows.
What do you plug into the agent?
The agent is the root node, and everything it needs hangs underneath it: you drag a sub-node onto a port, one type of sub-node per port, and none of them ever runs by itself.
Ports (what plugs in)
- Chat Model
ai_languageModelrequired - Memory
ai_memoryoptional - Tool
ai_tooloptional - Output Parser
ai_outputParseroptional
01Chat Model
The chat model reads the prompt, decides whether a tool is needed, and writes the final text. It is the one port you cannot skip.
Key parameters
- Required: leave it empty and the run stops with a chat model sub-node must be connected error.
- OpenAI Chat Model and Anthropic Chat Model are the usual starting points, each carrying the credential of its own provider.
- Google Gemini Chat Model fits when your keys already live on that side.
- Ollama Chat Model points at a model you host yourself, so the prompts stay on your machine.
02Memory
Memory carries what was said in earlier runs, so the agent follows a conversation instead of treating every item as a first contact.
Key parameters
- Optional: skip it for one-shot jobs, where a clean context each time is exactly what you want.
- Simple Memory keeps the recent turns inside the n8n instance, enough for a chat widget or a small internal bot.
- Postgres Chat Memory and Redis Chat Memory park the history outside n8n when several workflows share the same conversation.
03Tool
Tools are what the agent can do besides talk. It reads their descriptions, picks one, sends it arguments, and folds the result into its answer.
Key parameters
- Optional as a port, but the node is built around tools: connect at least one or you are running an expensive chat.
- Calculator is the honest first tool: it replaces arithmetic the model would otherwise invent.
- Code Tool runs your own snippet when the action is specific to your data.
- Wikipedia and Think Tool cover a lookup, and a pause to reason before the agent commits to an action it cannot take back.
04Output Parser
The output parser shapes what comes out of the agent, turning free text into fields the rest of the workflow can read.
Key parameters
- Optional, and only taken into account once Require Specific Output Format is switched on.
- Structured Output Parser is the default choice: you describe the shape you expect and the agent fills it.
- Auto-fixing Output Parser sends malformed output back to the model for a second attempt.
- Item List Output Parser suits an answer that is a list of values rather than an object.
Which parameter do you touch, and when?
The AI Agent node has 11 parameters. For each one: the node as you configure it in n8n, what the parameter changes, and our field notes.
Parameters index
Source for Prompt (User Message)
promptTypeWhat you see in n8n
Notes & use cases
This selector says where the agent picks up the user message. It is the first thing to check when the node runs on an empty prompt.
Key parameters
- Connected Chat Trigger Node (
auto): reads thechatInputfield from a Chat Trigger wired straight into the agent. - Connected Guardrails Node (
guardrails): readsguardrailsInputfrom a directly connected Guardrails node. - Prompt (User Message): the required field opened by
define(Define below), where you type text or an expression such as{{ $json.subject }}.
Require Specific Output Format
hasOutputParserWhat you see in n8n
Notes & use cases
Switch this on when the answer has to be machine readable. The node then exposes the output parser port and stops returning a paragraph of prose.
Key parameters
- Require Specific Output Format: a boolean. On, the agent is expected to produce the shape described by the parser you connect; off, you get plain text.
Enable Fallback Model
needsFallbackWhat you see in n8n
Notes & use cases
A safety switch for the model side. Turned on, the agent is configured with a fallback model in addition to the main one, so a failing call has somewhere to go.
Key parameters
- Enable Fallback Model: a boolean, off by design on a simple agent, worth turning on when the workflow runs unattended.
System Message
options.systemMessageWhat you see in n8n
Notes & use cases
Here you write the instruction sent to the agent before the conversation starts. Most of the quality of an agent lives in this field, not in the model choice.
Key parameters
- System Message: free text, sent ahead of the user message. Describe the role, the tone, what to do when a tool fails, and when to answer nothing rather than guess.
Max Iterations
options.maxIterationsWhat you see in n8n
Notes & use cases
An agent works in loops: think, call a tool, read the result, think again. This number caps how many of those loops it gets before it stops.
Key parameters
- Max Iterations: the maximum number of iterations the agent runs before stopping. Raise it for a task with several lookups, lower it when you want a fast failure instead of a long spiral.
Return Intermediate Steps
options.returnIntermediateStepsWhat you see in n8n
Notes & use cases
By default the node hands back only the final answer. Turn this on and the output also contains the steps the agent went through to get there.
Key parameters
- Return Intermediate Steps: a boolean. On, the output includes the tool calls and their results; off, the payload stays small.
Automatically Passthrough Binary Images
options.passthroughBinaryImagesWhat you see in n8n
Notes & use cases
When an item arrives with an image attached, this option hands that image to the agent as an image message rather than dropping it.
Key parameters
- Automatically Passthrough Binary Images: a boolean that decides whether binary images are passed through to the agent automatically.
Tracing Metadata
options.tracingMetadataWhat you see in n8n
Notes & use cases
This option attaches your own labels to the tracing events of the run, so an execution can be identified later by something other than its timestamp.
Key parameters
- Key: the name of the label, for instance a customer or a campaign.
- Type: the value type, among
stringValue,numberValue,booleanValue,arrayValueandobjectValue. - Value: the content itself, often an expression like
{{ $json.customerId }}.
Auto-save highlighted data
options.autoSaveHighlightedDataWhat you see in n8n
Notes & use cases
Highlighted data is what lets you filter the Executions view on your own values instead of scrolling through a list of runs.
Key parameters
- Auto-save highlighted data: a boolean, on by default, available on the Pro and Enterprise plans of n8n Cloud, and on Enterprise or a registered Community Edition when you self-host.
Enable Streaming
options.enableStreamingWhat you see in n8n
Notes & use cases
Streaming sends the answer back as it is being written instead of waiting for the last word, which changes how a long generation feels to whoever is waiting.
Key parameters
- Enable Streaming: a boolean, enabled by default. It only works when the workflow starts from a trigger that supports streaming responses, a Chat Trigger or a Webhook node with Response Mode set to Streaming.
Batch Processing
options.batchingWhat you see in n8n
Notes & use cases
When a hundred items hit the agent at once, this is where you slow the node down on purpose to stay inside the rate limits of the model provider.
Key parameters
- Batch Size: how many items are processed in parallel. It helps against rate limits, and it can change the ordering of the log output.
- Delay Between Batches: a pause in milliseconds between two batches, for the same reason.
Need help automating AI Agent with n8n?
A person reads every message.
AI Agent in n8n, the questions that come next
01Is the AI Agent node free in n8n?
02What credentials does the n8n AI Agent node need?
03What are the limits of the AI Agent node?
04What do you need to connect at minimum to run an agent?
05n8n or Make for building an agent?
Get our weekly integration tips.
No spam. Unsubscribe anytime.

