What Is an n8n AI Agent?

n8n is a workflow automation tool (open source and self-hostable, with a cloud version) that connects apps like Gmail, Slack, Google Sheets and databases. Its AI Agent node adds an LLM that can decide which tools to call to finish a task, instead of following a fixed path.

That means you can build things like "answer customer emails using our docs and order database" or "research a lead and draft an outreach message" visually, with little code.


🎯 Quick Answer (30-Second Read)

  • AI Agent node = a chat model + memory + one or more tools; the agent decides which tools to call.
  • At least one tool is required. Tools can be other n8n nodes (Sheets, HTTP Request, databases), code, sub-workflows or MCP servers.
  • Agent type: from n8n 1.82.0, all AI Agent nodes work as a Tools Agent; the old agent-type setting is deprecated.
  • Trigger it from a chat, a webhook, a schedule, a form or an app event (new email, new ticket).
  • Keep it reliable: clear system prompt, few well-described tools, human approval for risky actions.

How an n8n Agent Is Wired

flowchart LR T["Trigger
(Chat, Webhook,
Gmail, Schedule)"] --> A["🤖 AI Agent node"] M["Chat model
(Claude, OpenAI, Gemini...)"] -.->|"sub-node"| A MEM["Memory
(conversation history)"] -.->|"sub-node"| A T1["Tool: Google Sheets
(order lookup)"] -.->|"sub-node"| A T2["Tool: HTTP Request
(your API)"] -.->|"sub-node"| A T3["Tool: MCP server"] -.->|"sub-node"| A A --> OUT["Next steps
(send reply, create ticket,
notify Slack)"]

The AI Agent is a root node with sub-nodes plugged in underneath: one chat model, optional memory, and the tools it may use.


Example: A Customer Support Agent

Goal: answer "Where is my order?" messages by looking up the order in a Google Sheet.

Step 1: Add a Trigger

Add a Chat Trigger (for testing in n8n's chat window), or a Gmail/WhatsApp/webhook trigger for real messages.

Step 2: Add the AI Agent Node

Connect the trigger to an AI Agent node. In its options, write a system message:

You are a support assistant for an online store.
- Use the "Order Lookup" tool to find order status by order ID.
- If the customer hasn't given an order ID, ask for it.
- Never invent order details. If the order isn't found, say so and offer human help.
- Keep replies under 80 words, friendly and clear.

Step 3: Connect a Chat Model

Plug in a chat model sub-node (for example Anthropic Claude or OpenAI) and add your API credentials. For simple support tasks, a fast, cheaper model is often enough.

Step 4: Add Memory

Add a memory sub-node so the agent remembers earlier messages in the conversation (for example, the order ID the customer gave two messages ago). Use a persistent store such as Postgres or Redis for production rather than in-memory storage.

Step 5: Add Tools

Add a Google Sheets tool configured to look up a row by order ID, and give it a clear name and description:

Order Lookup — Finds an order's status, courier and expected delivery date by order ID.

The agent reads this description to decide when to use the tool, so be specific.

Step 6: Test

Open the chat, ask "Where is order 4512?" and watch the execution log: you'll see the agent call Order Lookup, read the result and reply.


How the Agent Decides

sequenceDiagram participant C as Customer participant A as AI Agent participant L as Chat model participant S as Order Lookup (Sheets) C->>A: "Where is order 4512?" A->>L: Message + system prompt + tool list L-->>A: Call Order Lookup(4512) A->>S: Look up 4512 S-->>A: Shipped, Delhivery, arrives 24 Nov A->>L: Tool result L-->>A: "Your order shipped with Delhivery..." A-->>C: Reply

Tool Ideas

Tool Use it for
HTTP Request Call any API (your backend, CRM, payment status)
Database tools (Postgres, MySQL) Look up or update records
Google Sheets / Airtable Simple data stores
Call another workflow Reuse a multi-step workflow as one tool
Code Calculations or data reshaping
MCP servers Plug in tools exposed via Model Context Protocol (How to Build an MCP Server)

Making Agents Reliable

Watch out: an agent with access to "send email," "issue refund" or "delete record" tools can do real damage if it misunderstands. Put a human approval step (for example, a Slack or email approval) before irreversible actions.
  • Few, focused tools with clear names and descriptions
  • A specific system prompt with rules and examples
  • Limit iterations so loops can't run away
  • Log executions and review failures weekly
  • Use deterministic nodes for steps that don't need AI (agents for decisions, normal nodes for routine logic)
  • Watch token costs: long memory and verbose tool outputs add up (Tokenization in LLMs Explained)

Frequently Asked Questions

What is the AI Agent node in n8n?

It's a node that combines a chat model with tools and optional memory so an LLM can decide which tools to call to complete a task. You connect at least one tool sub-node, such as an HTTP request, database, app integration, sub-workflow or MCP server.

Is n8n free for AI agents?

n8n's community edition can be self-hosted for free, while n8n Cloud has paid plans. Either way, you pay the AI model provider (such as Anthropic or OpenAI) for the tokens your agent uses.

n8n vs coding an agent: which is better?

n8n is faster for connecting business apps and building internal automations visually, with built-in integrations and logs. Code (with an agent SDK or framework) gives more control for complex logic, testing and custom products. Many teams prototype in n8n and move core flows to code later.


Conclusion

An n8n AI agent is a trigger, an AI Agent node, a chat model, memory and a few well-described tools. Start with one focused job like order-status support, write a specific system prompt, test in the chat panel, add human approval for risky actions, and expand tools only when the agent handles the basics reliably.


Sources

Last verified: 2 November 2026.


Related reads: AI Agent Frameworks Compared · How AI Agents Work · How to Build an MCP Server in Python · Best No-Code Tools for SaaS

I write about building with AI and how real products work. Follow on LinkedIn or X, or invite me to speak.