⚡ Quick verdict
- Fastest start → n8n Cloud. Sign up at n8n.io with "Get started free" — cloud plans include a 14-day trial, no credit card.
- Free forever → self-hosted Community Edition. Free with unlimited executions; you only pay for the server (~a few dollars a month on a small VPS).
- The agent recipe: Chat Trigger → AI Agent node (Tools Agent) → chat model + API credential → tools → Simple Memory.
- Test before you go live: n8n's built-in chat window lets you run the agent while you build — activate the workflow only when it behaves.
We may earn a commission if you buy through our links, at no extra cost to you.
n8n is the automation platform that AI-agent builders graduated to. It started as an open-source Zapier alternative, but its AI support is now its headline feature: a dedicated AI Agent node with tool-calling, memory, and several agent types, sitting inside a visual workflow canvas where every other node — HTTP requests, code, databases, 400+ app integrations — becomes a tool the agent can use. That combination is why n8n dominates "build your own AI agent" tutorials in 2026.
This is a researched setup guide, not a live lab test. Every step below is verified against n8n's official documentation, its AI-agent tutorials, and current setup guides from September 2026 (sources at the bottom). UI labels shift a little between n8n versions, so if a button says "Create workflow" instead of "New workflow" on your screen, you're in the right place. Where pricing appears, treat it as a snapshot and confirm at n8n.io/pricing before buying.
What you'll need
- An n8n instance — cloud (free trial) or self-hosted (free forever). Step 1 covers both.
- An LLM API key — OpenAI is the best-documented path (create one at platform.openai.com/api-keys). Anthropic and Gemini credentials work too, and Ollama covers local models.
- About an hour — roughly 30–45 minutes for the first build, plus testing time.
Step 1: Get n8n running — cloud or self-hosted
You have two honest options. n8n Cloud is the path of least resistance: go to n8n.io, click "Get started free," sign up with your email, and you land in the workflow editor with a 14-day trial on cloud plans. No server to manage, no Docker, no certificates. Start here unless you have a reason not to.
The self-hosted route is free forever under n8n's fair-code (Sustainable Use License) Community Edition, with unlimited workflow executions. The verified quick path from current setup guides is a single Docker command:
docker run -it --rm --name n8n -p 5678:5678 n8nio/n8n
Then open http://localhost:5678 in your browser and create your owner account. The trade-off is yours: cloud costs money but removes infrastructure; self-hosting costs nothing but makes you the sysadmin. For a first agent, cloud wins.
Step 2: Create a workflow and add a trigger
Click the create/new workflow button in the top right — you'll get an empty canvas with a trigger prompt. Every workflow needs a starting point, and for an AI agent you want one of three:
- Chat Trigger — the testing favorite. It spins up a chat window inside n8n so you can talk to your agent while building. Pick this for your first build.
- Manual Trigger — runs the workflow when you click a button. Good for ad-hoc runs.
- Webhook or Schedule Trigger — for production: an external app calls your agent, or it runs on a timer.
Select "Add first step," search for Chat Trigger, and add it — defaults are fine for testing. (Thinking production already? The Webhook trigger gives you a URL callable from your site, a form, or a chat widget.)
Step 3: Add the AI Agent node
Hit the add-node connector on the trigger, search for AI Agent, and connect it. The key choice is the agent type:
- Tools Agent (default) — the model decides which tools to call. Best all-round; use this unless you have a reason not to.
- Conversational Agent — for back-and-forth dialogue with history.
- ReAct Agent — explicit reason-and-act loops for complex multi-step reasoning.
- Plan and Execute Agent — decomposes the task into a plan first, then works through it.
Start with Tools Agent. The honest insight from n8n's docs: simpler tasks often don't need an agent at all (a plain LLM chain is cheaper), while content-heavy or multi-tool tasks are where agents earn their keep.
Step 4: Connect a chat model (the agent's brain)
The AI Agent node has sub-node inputs for model, memory, and tools. Click the + on the model input and add an OpenAI Model node. When it asks for credentials, open Credentials → Add credential and add your OpenAI API key — credentials live separately from workflows, so never paste secrets into prompts or nodes.
No OpenAI key? Anthropic and Gemini credentials work the same way, and Ollama covers local models. While iterating, use a cheap fast model — you'll burn dozens of test calls.
Step 5: Give the agent tools (its hands)
An agent without tools is just a chatbot. Click the + on the tool input and attach what your agent actually needs — each tool becomes something the agent can call while it works:
- Wikipedia Tool — grounded factual lookups.
- Calculator — arithmetic the LLM shouldn't guess at.
- HTTP Request Tool — call any external API.
- Code Tool — run JavaScript or Python inline for custom logic.
- Workflow Tool — call another n8n workflow, which is how you build multi-agent systems (one orchestrator agent delegating to worker agents).
The discipline: add only the tools the task needs. Every extra tool is another decision the model can get wrong, and every tool call is another step in the billed loop. Start with one or two, watch the agent's reasoning in the execution log, and add more only when it demonstrably needs them.
Step 6: Add memory so it remembers the conversation
Without memory, every chat message is a fresh stranger. Click the + on the memory input and add Simple Memory — a window buffer that keeps the last N messages as context. Set the context window to something modest (5–10 messages) to start; longer memory is better conversation at the cost of more tokens per call. For persistent memory across sessions, n8n supports vector stores and database-backed memory, but Simple Memory is the right default for a first agent.
Step 7: Set guardrails — system prompt and loop limits
Two settings separate a demo from something you can trust. First, write a real system prompt: who the agent is, what it's allowed to do, what it must never do, and the answer format you want. "You are a helpful assistant" is not a system prompt — a good one names the role, the tools, and the boundaries.
Second, set a max iterations limit so the agent can't spin forever if it gets confused — five to ten cycles is sane for simple agents. This is the cheapest insurance you'll ever buy: one stuck agent in a loop burns your LLM budget while you sleep.
Step 8: Test in the chat window, then activate
With the Chat Trigger in place, n8n gives you a chat window inside the editor. Talk to your agent: ask it things you know the answers to, try to confuse it, and watch each execution in the log to see which tools it called. When the output is wrong, fix in this order: (1) tighten the system prompt, (2) fix the tool descriptions, (3) reconsider the tool set, (4) change the model.
Once it behaves reliably, save the workflow and toggle it active. On recent n8n versions, workflows sit in draft mode until you explicitly publish/activate them — a welcome safety net. From here, swap the Chat Trigger for a Webhook or Schedule trigger for production, and watch the Executions view for the first few days.
What it costs
n8n bills per workflow execution — one full run counts as one, no matter how many nodes it touches. That's a genuinely agent-friendly model: a 20-node agent run costs the same as a 2-node one, unlike Zapier and Make where every step burns usage. The catch: your LLM API calls are billed separately by the model provider, and an agent looping through tools can make a lot of them.
| Plan | Price | Executions / month | Best for |
|---|---|---|---|
| Community (self-hosted) | Free | Unlimited | Developers comfortable running a server |
| Starter | ~€24/mo | 2,500 | Freelancers, first agents |
| Pro | ~€60/mo | 10,000 | Growing teams, real workloads |
| Business | ~€800/mo | 40,000 | Mid-size companies, SSO/Git |
| Enterprise | Custom | Custom | Large organizations |
Pricing snapshot from September 2026 reporting — confirm current figures at n8n.io/pricing. Cloud plans include a 14-day free trial; paid plans add unlimited users and unlimited active workflows.
Next steps
Once your first agent runs reliably: swap the trigger to a Webhook so your site or app can call it; go multi-agent with the Workflow Tool — an orchestrator delegating to specialist workers; start from a template in n8n's library; and add observability — our LLM observability tools roundup covers tracing agents in production. Prefer code over canvas? See our Claude Agent SDK guide; want the no-code route? Our Make AI agents guide. If a managed platform fits better than self-hosting, see our AI chatbot builders comparison.
Frequently asked questions
Do I need to code to build an n8n AI agent?
No. A basic agent is point-and-click: Chat Trigger, AI Agent node, a chat model, a few tools, and memory. You only need code — JavaScript or Python in the Code node — when you want custom logic the ready-made nodes don't cover.
How much does running an n8n AI agent cost?
n8n's self-hosted Community Edition is free with unlimited executions — you only pay for the server. Cloud plans start around €24/month for 2,500 executions. Your LLM API usage is billed separately by the model provider. Treat figures as a snapshot and confirm at n8n.io/pricing.
What's the difference between Tools Agent and the other n8n agent types?
Tools Agent is the default all-round type — the model decides which tools to call. Conversational Agent focuses on dialogue, ReAct Agent does explicit reason-and-act loops for complex reasoning, and Plan and Execute Agent plans first then executes. Start with Tools Agent.
Can I self-host n8n for free?
Yes. The Community Edition is free under n8n's fair-code license with unlimited workflow executions. The verified quick path: docker run -it --rm --name n8n -p 5678:5678 n8nio/n8n, then open http://localhost:5678 and create your owner account. You pay only for the server.
Which AI model should I use with n8n?
OpenAI models are the most documented path — add an OpenAI credential and pick a chat model. Anthropic and Gemini credentials also work, as do local models via Ollama. Any model supporting tool calling works with the Tools Agent; use a cheap fast model while iterating.
Is n8n better than Make or Zapier for AI agents?
For technical users, yes: native AI agent nodes, full code access, local-LLM support, and per-execution billing make n8n the strongest agent platform of the three. Make is easier to learn; Zapier is simplest but bills per step, which gets expensive for agent loops.
Sources
- n8n official docs — AI agent intro tutorial (Chat Trigger + AI Agent node)
- n8n node reference — AI Agent types (Tools, Conversational, ReAct, Plan and Execute)
- AllAboutAI — n8n AI Agent setup walkthrough (memory, loop limits)
- Medium (Jan 2026) — building your first AI agent with n8n
- AffMaven — n8n pricing 2026 (plans, executions, trial)
- ConnectSafely — n8n cloud pricing guide 2026
- CloudZero — n8n pricing 2026, every plan and the execution math