Resources · n8n integration

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

Why automate

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.

Connections

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 Modelai_languageModelrequired
  • Memoryai_memoryoptional
  • Toolai_tooloptional
  • Output Parserai_outputParseroptional
01Chat ModelThe chat model reads the prompt, decides whether a tool is needed, and writes the final text. It is the one port you cannot skip.

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.
Use cases
one model drives the whole agent, and you can swap it later without touching the tools.
02MemoryMemory carries what was said in earlier runs, so the agent follows a conversation instead of treating every item as a first contact.

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.
Use cases
a helpdesk bot that stops asking twice for the same order number. If an old template throws an error in Simple Memory, remove the sub-node and add it again to get the current version.
03ToolTools are what the agent can do besides talk. It reads their descriptions, picks one, sends it arguments, and folds the result into its answer.

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.
Use cases
an agent that quotes a real total instead of a plausible one.
04Output ParserThe output parser shapes what comes out of the agent, turning free text into fields the rest of the workflow can read.

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.
Use cases
a classification that lands straight in a spreadsheet column.
Parameters

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.

01

Source for Prompt (User Message)

promptType

What 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 the chatInput field from a Chat Trigger wired straight into the agent.
  • Connected Guardrails Node (guardrails): reads guardrailsInput from 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 }}.
Use cases
a no prompt specified error means switching to Define below. An expression resolving to nothing gives the 400 invalid value for content error.
02

Require Specific Output Format

hasOutputParser

What 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.
Use cases
a triage agent that must answer with a category and a priority, because the branch after it compares values rather than reading sentences.
03

Enable Fallback Model

needsFallback

What 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.
Use cases
a nightly agent that processes yesterday's tickets and should not leave the queue untouched because one provider had a bad hour.
04

System Message

options.systemMessage

What 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.
Use cases
telling the agent to use the calculator for every amount and to refuse any question outside the product catalog.
05

Max Iterations

options.maxIterations

What 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.
Use cases
an agent stuck calling the same tool over and over stops on its own, and the execution log shows where the loop started.
06

Return Intermediate Steps

options.returnIntermediateSteps

What 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.
Use cases
debugging an agent that returns a wrong number, since the steps show which tool it called and what came back. Handy while building, noisy once the workflow is live.
07

Automatically Passthrough Binary Images

options.passthroughBinaryImages

What 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.
Use cases
a mailbox agent that receives a photo of a damaged parcel and has to describe what it sees before opening a claim. It only makes sense with a model that accepts images.
08

Tracing Metadata

options.tracingMetadata

What 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, arrayValue and objectValue.
  • Value: the content itself, often an expression like {{ $json.customerId }}.
Use cases
tagging every run with the account it belongs to, then finding them all when one client reports a strange answer.
09

Auto-save highlighted data

options.autoSaveHighlightedData

What 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.
Use cases
an agent that runs all day and needs to be searched by ticket rather than by hour. On a plan that does not include the feature, leave it alone and filter elsewhere.
10

Enable Streaming

options.enableStreaming

What 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.
Use cases
a chat interface where the text appears progressively. Behind a trigger that cannot stream, the option changes nothing.
11

Batch Processing

options.batching

What 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.
Use cases
a nightly run over a full export, where a burst of calls would get rejected and a steady pace gets through.
Need help

Need help automating AI Agent with n8n?

A person reads every message.

FAQ

AI Agent in n8n, the questions that come next

01Is the AI Agent node free in n8n?
Yes. The node ships with n8n as part of its AI package, on n8n Cloud as well as on a self-hosted instance, with nothing to install and no extra cost on the n8n side. A workflow behaves the same in both places. What is not free is the model: the provider you connect through the chat model sub-node bills its own API calls under its own terms, and n8n adds nothing to that. So an agent left running on a large volume costs money at the provider, not at n8n. Auto-save highlighted data is the one option tied to a plan, on Pro or Enterprise in the cloud, Enterprise or a registered Community Edition when you self-host.
02What credentials does the n8n AI Agent node need?
None. The agent has nothing to authenticate: no credential field, no Authentication selector, nothing to set up on the account side. The key lives one level down, on the chat model sub-node you connect to the Chat Model port, and that sub-node carries the credential of its provider. Same for a tool that talks to an external service: the credential belongs to the tool, not to the agent. That is also why the node fails immediately when the Chat Model port is empty. Connect the model, fill its credential once, and it can be reused by every other workflow on the instance.
03What are the limits of the AI Agent node?
This page covers 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, so the SQL, ReAct, Plan and Execute and OpenAI Functions variants are no longer options you pick. Node version 1 is removed from n8n 3.0, which means a workflow still using it stops working after that upgrade. A chat model is required and at least one tool should be connected. An older workflow may also show fewer options than the ones described here, since the parameters listed come from the latest version of the node.
04What do you need to connect at minimum to run an agent?
A chat model, and at least one tool. The Chat Model port is required and blocks the execution when empty. The Tool port is technically optional, but an agent without a tool is just a model call with extra steps. To start, connect a chat model from a provider whose key you already have, add the Calculator as a first tool, and leave Memory and Output Parser empty. Once that runs, add Simple Memory to keep a conversation going, then a Structured Output Parser with Require Specific Output Format when the answer has to feed another node.
05n8n or Make for building an agent?
It depends on where the data has to live. n8n can be self-hosted with Docker or npm, or used on n8n Cloud, and the workflow is identical in both cases, which matters when prompts and customer data should stay on your own infrastructure. Make is hosted, with no self-hosting option, and billed per operation, so the cost follows the volume of steps rather than the machine. Both build visually. The real questions are hosting, control over the data, the cost model and how comfortable the team is with each canvas.
Hack'celeration Lab

Get our weekly integration tips.

No spam. Unsubscribe anytime.