Build Your First n8n AI Agent Workflow
Build an n8n AI agent by installing the free self-hosted Community edition or a Cloud plan starting at €20/mo for 2,500 executions, then wiring an AI Agent node to a trigger and any tool nodes it needs. Billing is per execution, not per step, so a long agent workflow costs the same as a short one.
What you need first
You need either a self-hosted n8n instance or an n8n Cloud account before you can build an AI agent workflow. The Community edition is free and available on GitHub, so if you already have a VPS or a machine that can run Docker, self-hosting costs nothing beyond the server itself. If you'd rather skip infrastructure entirely, Cloud Starter is listed at €20/mo billed annually for 2,500 workflow executions with unlimited steps per execution — n8n does not publish a USD price for this tier, so budget in euros.
| Option | Cost | What you get |
|---|---|---|
| Community (self-hosted) | Free | Full workflow engine, AI agent nodes, you manage the server |
| Cloud Starter | €20/mo (annual) | 2,500 executions/mo, unlimited steps |
| Cloud Pro | €50/mo (annual) | 10,000 executions/mo |
| Cloud Business | €667/mo (annual) | 40,000 executions/mo |
Beyond the platform itself, you'll want an API key for whatever LLM you plan to use inside the AI Agent node, and a rough sense of what tools the agent needs to call — an HTTP request node, a database node, or a custom code step. Because n8n handles code steps and AI agent nodes natively, you're not limited to prebuilt integrations the way you are in most no-code builders.
Step-by-step
Start by creating a new workflow and adding a trigger — a manual trigger for testing, or a webhook if the agent needs to respond to external events. From there, drag in the AI Agent node and connect your model credentials; this is where you configure which LLM the agent reasons with and what system prompt frames its behavior.
Next, attach tool nodes as sub-nodes of the AI Agent — these are the actions the agent can decide to take, whether that's an HTTP Request node hitting an API, a code node running custom logic, or a database node reading and writing records. Each tool node needs a clear name and description, because the agent picks which tool to call based on that description alone. Test the workflow incrementally: run it after adding each tool rather than wiring five tools at once and debugging blind. Because billing is per execution and not per step, you can iterate freely inside a single test run without worrying about per-node cost the way you would on platforms that charge by task.
Once the core loop works, add error handling around any tool node that calls an external API, since a failed HTTP call inside an agent run can otherwise silently break the agent's reasoning chain. Finally, decide whether you're staying on Community edition long-term or moving to Cloud — if your execution volume is under 2,500 runs a month, Cloud Starter's €20/mo is a reasonable trade for not managing a server yourself.
Common problems
The most common problem is confusing per-step and per-execution billing expectations — because n8n only counts full workflow runs, teams often over-budget for Cloud tiers assuming a complex agent workflow will burn through their execution quota faster than it actually does. A 40-step agent workflow costs exactly the same single execution as a 2-step one.
Self-hosted users most often run into upgrade and backup neglect: because Community edition is free, it's easy to stand up an instance and never revisit it, which becomes a real problem when a security patch ships and your instance is out of date. Treat self-hosting as an ongoing maintenance commitment, not a one-time setup task.
Cloud users occasionally get surprised by the euro-denominated pricing, since n8n does not publish a USD price for any Cloud tier — your actual dollar cost shifts with the exchange rate month to month, which matters more once you're budgeting a team's automation spend at the Business tier's €667/mo.
What to do next
Once your first agent workflow is stable, decide whether self-hosting still makes sense as your execution volume grows — our n8n self-hosting guide covers getting a VPS running in 20 minutes if you want to avoid Cloud pricing altogether. If you're evaluating n8n against other automation platforms before committing further, n8n vs Zapier and n8n vs Make both cover where n8n's per-execution billing and code-step flexibility hold up against SaaS-only competitors.
The practical path forward is to build one real agent workflow end to end — not a toy demo — before deciding between self-hosting and Cloud. Execution-based billing means the decision comes down to server management tolerance and predictable monthly volume, not a per-task cost calculation. If your team is already running other workflows through Zapier or Make, Zapier vs Make is worth a read to understand what you'd be migrating away from before you standardize on n8n for agent work.
It's worth revisiting your tier choice every few months as usage settles. A team that starts on Cloud Starter's 2,500 executions often finds an agent workflow that fires on every inbound webhook eats that quota faster than a scheduled batch job would, so watch your execution count in the first few weeks rather than assuming the free tier's behavior will hold at scale. If you consistently blow past 2,500 executions, Cloud Pro's 10,000-execution allowance at €50/mo is the next step up before Business becomes worth considering. And if uptime and data residency matter more than convenience, self-hosting the Community edition on your own infrastructure keeps you off the euro-denominated pricing ladder entirely, at the cost of owning patching and backups yourself.
Frequently asked questions
Is n8n free for building AI agents?
Yes, the Community edition is free and self-hostable from GitHub — you only pay for the server you run it on. n8n's paid Cloud plans start at €20/mo for 2,500 workflow executions if you'd rather not manage hosting yourself.
How does n8n charge for AI agent workflows?
n8n bills per workflow execution, not per step inside that workflow. That means an AI agent run with ten tool calls and a code step costs the same single execution as a two-node workflow, which matters a lot once an agent starts branching.
Do I need to self-host n8n to build an agent?
No. Self-hosting the Community edition is free but means you own upgrades, backups, and uptime. Cloud Starter at €20/mo for 2,500 executions is the managed alternative if you'd rather not run a VPS.
What's the biggest gotcha when starting with n8n AI agents?
Cloud pricing is published in euros, not US dollars, so your actual monthly cost moves with the exchange rate. The jump from Cloud Pro to Cloud Business is also steep, so plan your execution volume before committing to a tier.
Recommended next
Related comparisons
- n8n Self-Hosting Guide: VPS Setup in 20 Minutesself host n8n
- Best Zapier Alternatives (Cheaper Per Task)zapier alternatives
- Best Automation Tool for AI Agent Workflowsbest automation tool ai agents
- Best Make.com Alternativesmake.com alternatives
- Best Automation Tool for Small Businessbest automation tool small business