Skip to main content

8 July 2026

AI Agents

How to Build Your First AI Agent with n8n (No-Code)

A hands-on, no-code guide to building your first AI agent in n8n: the AI Agent node, chat model, tools, memory, plus a real support-triage example.

How to Build Your First AI Agent with n8n (No-Code), AI Agents, n8n analysis by Amjid Ali.

I build AI agents in n8n almost every week, both as an n8n Ambassador and in client delivery, and the question I hear most from business leaders is the same one: “Can we actually do this without hiring an engineer?” The honest answer surprises people.

Yes, you can build a genuinely useful AI agent without writing a single line of code, and n8n is one of the cleanest ways to do it. The visual canvas, the drag-and-drop nodes, and the plain-English configuration mean a curious operations manager can stand up a working agent in an afternoon. In this guide I will walk you through the shape of that build so you understand what each piece does and why it matters. This is not a screenshot safari. It is the mental model you need so the tool stops feeling like magic and starts feeling like plumbing you control.

What is an AI agent, briefly?

An agent is software that receives some input, reasons about it, and then decides which actions to take to reach a goal you gave it. The n8n AI Agent node documentation puts it well: an agent “receives data, makes rational decisions, and acts within its environment to achieve specific goals.” The key word is decides. A normal automation does exactly what you drew. An agent works out the “how” for itself, calling whatever tools it needs, in whatever order makes sense.

If you want the full conceptual grounding before you build, I wrote a plain-language primer here: /insights/what-is-an-ai-agent-the-operator-primer. For this piece, that one sentence is enough. Agent equals a model plus tools plus the freedom to choose.

What is the difference between a workflow and an agent?

This trips up nearly everyone, so let me make it concrete.

A workflow is a fixed pipeline. New email arrives, extract the sender, look up the account, post to Slack. Every run takes the same path. It is reliable and predictable, and for most business tasks that is exactly what you want.

An agent is a decision-maker that lives inside a workflow. You hand it a goal (“triage this support ticket and either answer it or escalate it”) and a set of tools, and it figures out the sequence. Maybe it searches your knowledge base first, maybe it checks the order status, maybe it does both, maybe neither. The model chooses at runtime.

The beautiful part of n8n is that you are not forced to pick one philosophy. You wrap agent autonomy inside deterministic guardrails: a normal trigger, a normal set of steps, and an AI Agent node doing the fuzzy reasoning in the middle. If you want to go deeper on how these two styles combine at scale, see my reference patterns for agent architecture.

Do I need to know how to code?

No. I mean it. The entire core build is forms and dropdowns. You will write plain English in a system prompt, and you will pick options from menus. Code only enters the picture if you want a bespoke tool or an unusual data transformation, and even then it is optional. I have shipped support agents and research assistants for clients without a single custom line. Your job here is thinking clearly about the goal and the tools, not remembering syntax.

What you need before you start

Three things, and only three.

  1. An n8n instance. Either a free n8n Cloud trial or a self-hosted Community Edition instance. Either is fine to learn on.
  2. An API key for a language model. OpenAI, Anthropic, Google Gemini, or a local model. This is the agent’s brain.
  3. A clear, small goal. Do not try to build a company-wide oracle on day one. Pick one job: “answer tier-one support questions and escalate the rest,” or “research a company and summarise it.” Narrow wins.

That is the whole shopping list. Now let us build.

The building blocks

Before the walk-through, here is the anatomy. In n8n, an agent is a “root node” (the AI Agent) surrounded by “sub-nodes” that plug into slots underneath it. Memorise this table and the canvas stops being mysterious.

Node / slotWhat it doesExample
Chat TriggerStarts the conversation and gives you a chat windowUser types “Where is my order?”
AI Agent nodeThe orchestrator that reasons and decides which tool to callRuns as a “Tools Agent”
Chat Model (sub-node)The brain that does the actual thinkingOpenAI Chat Model, Anthropic Chat Model, Google Gemini Chat Model
Tool (sub-node)A capability the agent can choose to useHTTP Request Tool, Calculator, a sub-workflow, a vector store
Memory (sub-node)Remembers earlier turns in the conversationSimple Memory node

The AI Agent node needs a chat model and at least one tool to function. Memory is optional but you will almost always want it for anything conversational.

Step 1: Create the workflow and add a trigger

Open n8n and create a blank workflow. Add a Chat Trigger node as your starting point. Per the Chat Trigger documentation, this node “is used when building AI workflows for chatbots and other chat interfaces,” and every message a user sends triggers one full run of your workflow. It gives you a hosted chat window out of the box, so you can talk to your agent while you build it. Later you can embed that chat on your website or swap the trigger for a webhook, a form, or an email trigger.

Key takeaway: the trigger is how the outside world reaches your agent. Start with Chat Trigger because it gives you an instant test surface.

Step 2: Add the AI Agent node

Connect an AI Agent node to your trigger. As of recent n8n versions, there is only one agent type to worry about: the Tools Agent. Older versions offered several types, but the docs confirm all AI Agent nodes now operate as the Tools Agent that used to be the recommended setting, and old workflows keep working. One fewer decision for you.

Inside the node, the most important field is the system prompt. This is where you write, in plain English, who the agent is and how it should behave. Something like: “You are a friendly support assistant for an online store. Answer questions using your tools. If you cannot resolve an issue or the customer is upset, escalate to a human.” Be specific about boundaries. The system prompt is your steering wheel.

Step 3: Connect a chat model (the brain)

Under the AI Agent node you will see small connection slots. Click the one labelled Chat Model and pick your provider: OpenAI Chat Model, Anthropic Chat Model, Google Gemini Chat Model, or a local model. Paste in your API key as a credential, choose a model, and you are done. This sub-node is the reasoning engine. Everything the agent “thinks” happens here. If you are unsure which provider to choose, my rundown of the best agent platforms and frameworks for 2026 compares the trade-offs.

Step 4: Give it a tool or two (the hands)

An agent with no tools can only talk. Tools are what let it do things. Click the Tool slot and add one. Good starting tools:

  • HTTP Request Tool so the agent can call any API, for example your order-status endpoint.
  • Calculator for reliable arithmetic.
  • A sub-workflow as a tool, which lets you wrap an existing n8n process and hand it to the agent as a capability.
  • A vector store tool so the agent can search your knowledge base or documents.

Here is the part people miss: the agent decides whether to call a tool based on the tool’s name and description. Write those descriptions carefully and in plain English, because they are effectively part of the prompt. “Use this to look up the delivery status of a customer order by order number” is a good description. “getData” is not.

Key takeaway: tools are the difference between a chatbot and an agent. Name and describe each tool as if you were explaining it to a new colleague, because that is exactly what the model reads.

Step 5: Add memory

Attach the Simple Memory node to the Memory slot. The Simple Memory documentation explains that it lets you “persist chat history in your workflow” so the agent remembers earlier messages without you resending them. Two settings matter: the session key, which separates one customer’s conversation from another, and the context window length, which controls how many past messages the model sees. One note for production: Simple Memory is not compatible with n8n running in queue mode, because it cannot guarantee every memory call reaches the same worker. When you scale up, swap it for an external store like Postgres or Redis memory.

Step 6: Test it

Click the chat window on your Chat Trigger and start a conversation. Ask your agent a real question. Watch the execution view light up node by node. You can see exactly what the model decided, which tool it called, what the tool returned, and how the agent phrased its reply. This transparency is n8n’s superpower for beginners. When something goes wrong, and it will, you can see precisely where. Iterate on your system prompt and tool descriptions until the behaviour is solid.

A simple real example: a support-triage agent

Let me make this tangible. A support-triage agent I build often looks like this: a Chat Trigger receives the customer message. The AI Agent node, running an Anthropic or OpenAI chat model, reads it against a system prompt that says “resolve tier-one questions, escalate everything else.” It has two tools: an HTTP Request Tool that checks order status, and a sub-workflow tool that creates a ticket in the helpdesk and pings a human on Slack. Simple Memory keeps the thread coherent. A customer asks where their order is, the agent calls the order-status tool, answers directly, and closes the loop. A customer asks for a refund, the agent recognises it is out of scope and calls the escalation tool. That is a real, useful agent, and there is not a line of code in it.

Should you self-host or use the cloud?

Both run the exact same agent, so this is about operations, not capability.

n8n Cloud is the fast path. Plans start at around 20 euros a month for the Starter tier, and n8n prices by execution rather than by step, so a complex agent with many nodes still counts as one execution per run. Great for learning and for teams that do not want to manage servers.

Self-hosted Community Edition is free and source-available. You run it on your own infrastructure, which means your data never leaves your environment, you get unlimited executions, and you control the governance story end to end. This is what I reach for with clients who have data-residency or compliance requirements. If enterprise self-hosting is where you are heading, I go deep on it in my ambassador’s guide to n8n for enterprise AI workflows.

The governance note you cannot skip

An agent that can act is an agent that can act wrongly. Before you point one at anything that matters, apply two principles.

Least privilege. Give each tool the narrowest scope that gets the job done. A support agent needs read access to order status, not write access to your billing system. Scope every API credential accordingly.

Human sign-off on consequential actions. For anything irreversible or sensitive, refunds, sending external emails, changing records, route the agent’s proposed action through a human approval step before it executes. n8n makes this easy with a wait-for-approval node in the path. This maps directly to the reference patterns I use in production, and it is the single biggest thing that separates a demo from something you can trust in a business. Autonomy is a dial, not a switch. Turn it up slowly.

Key takeaway: build the agent in an afternoon, but earn its permissions over weeks. Least privilege and human sign-off are what let you sleep at night.

You now have the full shape: trigger, agent, brain, hands, memory, then guardrails. Pick one small job, build it this week, and watch it work. That first “it actually did the thing” moment is genuinely brilliant, and it is a lot closer than you think.

I am Amjid Ali, an AI and technology leader in Melbourne and an official n8n Ambassador. If you want help designing or governing agents for your business, get in touch.

Frequently asked.

How do I build an AI agent in n8n without writing any code?
Add a Chat Trigger, drop in an AI Agent node, then attach three sub-nodes: a chat model (the brain), one or two tools (the hands), and optionally a memory node. You configure each in a form, write a plain-English system prompt, then click Test. No scripting is required to get a working agent running end to end.
What is the difference between an n8n workflow and an AI agent?
A workflow follows a fixed path you draw by hand: step one, then two, then three. An AI agent uses a language model to decide, at runtime, which tools to call and in what order to reach a goal you describe in words. The agent lives inside a workflow, so you get autonomy where you want it and deterministic steps everywhere else.
Do I need to know how to code to build an AI agent with n8n?
No. The core build (trigger, AI Agent node, chat model, tools, memory) is entirely visual, driven by dropdown menus and text fields. You only reach for code if you need a custom transformation or a bespoke tool. Most business-facing agents, like support triage or research assistants, ship with zero lines written by you.
Should I use n8n Cloud or self-host n8n for AI agents?
Start on n8n Cloud (from around 20 euros a month) to learn fast without server admin. Move to the free, source-available Community Edition when you want data to stay on your own infrastructure, need unlimited executions, or must meet strict governance and residency rules. The workflows you build are portable between the two.
How does memory work for an AI agent built in n8n?
Attach the Simple Memory node to your AI Agent. It persists chat history so the agent remembers earlier turns in a conversation without you resending them. You set a session key to separate one user's thread from another, and a context window length to control how many past messages the model sees. Memory is optional but essential for real conversations.

Picked by shared topic. The through-line is agentic AI shipped into production, not the pilot theatre.

Read another.