How to Use the n8n AI Agent Node: A Practical Guide (2025)

The AI Agent node is what separates n8n from every other automation tool. A normal AI node answers a question. An agent decides what to do — it can search the web, query a database, call an API, and chain those actions together to accomplish a goal. Here's how to actually use it.

Agent vs. plain LLM call: the key difference

A plain OpenAI node is a one-shot: prompt in, text out. An agent runs a reasoning loop. Given a goal and a set of tools, it decides which tool to call, reads the result, and decides what to do next — repeating until it has an answer. That loop is what lets it handle open-ended tasks.

The three ingredients

  • Model: the LLM doing the reasoning (GPT-4o, Claude, etc.). Connect a chat model node.
  • Tools: what the agent can do — HTTP requests, a calculator, a vector store search, or even other n8n workflows.
  • Memory: optional conversation history so the agent remembers previous turns.

Ready to automate?

See a production agent in action — get the n8n AI Research Agent that autonomously searches the web and writes deep reports.

Get the Template on Gumroad →

Step 1: Add the AI Agent node

Drop in the AI Agent node and connect a chat model (e.g. OpenAI Chat Model) to its "Model" input. At minimum, this gives you a conversational agent. The power comes from adding tools.

Step 2: Give it tools

Connect tool nodes to the agent's "Tool" input. Each tool needs a clear description — this is how the agent knows when to use it. For example, an HTTP Request tool described as "Search the web for current information about a topic" tells the agent to reach for it when it needs fresh facts.

Step 3: Write the system prompt

The system prompt defines the agent's role and boundaries. Be specific:

"You are a research assistant. Use the web search tool to find current information. Always cite sources. If you can't verify a fact, say so rather than guessing. Return your answer as a structured report."

Step 4: Add memory (for chatbots)

For a conversational agent, connect a memory node (Window Buffer Memory or a database-backed memory) so the agent remembers the conversation. Skip this for single-shot task agents.

Real examples of agents worth building

  • Research agent: web search + summarization → cited report on any topic.
  • CRM agent: tools to look up, create, and update contacts via natural language.
  • Support agent: RAG search over your docs + escalation to a human.
  • Data agent: text-to-SQL tool that answers questions about your database.

Common mistakes

  • Vague tool descriptions: the agent can't use a tool it doesn't understand. Describe each one precisely.
  • Too many tools: start with 2-3. More tools means more chances for the agent to pick wrong.
  • No guardrails: constrain the agent in the system prompt so it doesn't take unwanted actions.

Where to go next

Start with a read-only agent (search, look up, summarize) before giving it tools that write or take actions. Once you trust its behavior, expand its capabilities. Agents are the highest-leverage thing you can build in n8n today.


Ready to automate? Get this template on Gumroad

This ready-to-import n8n workflow saves you hours of setup. Import it, connect your accounts, and go live.

Get the Template on Gumroad →