
An agent that sorts your emails, another that prepares your quotes, a third that watches your inventory. Two years ago, this took a developer and six months. Today, with n8n, an SME leader can build their own in a morning, without writing a line of code, on a machine they control.
Key Takeaways
- n8n is an open-source automation platform that lets you build AI agents by drag-and-drop, without coding
- The free, self-hosted version runs on a plain VPS for €10 a month and keeps your data on your own premises
- A first email agent can be built in 2 hours and can save 5 hours a week
- Pricing per execution (rather than per step) makes n8n more economical than Make or Zapier on complex workflows
- Since July 2026, five pre-built agents can be imported in one click from the AI Agent node
What exactly is n8n?
n8n (pronounced "n-eight-n," short for "nodemation") is a workflow automation platform created in Berlin by Jan Oberhauser and released in 2019. It connects your apps, your APIs, and your AI models in a visual interface: you assemble blocks, n8n runs them.
The tool was long a challenger to Zapier and Make. The release of n8n 2.0 in January 2026 changed that: native support for AI agents via LangChain, more than 70 AI nodes, persistent agent memory, and compatibility with self-hosted LLMs.
Three features set it apart:
- Open source (fair-code license). The code is viewable and auditable. You can install it on your own infrastructure, without depending on a third-party cloud.
- Pricing per execution. You pay for triggering the workflow, not for each step. A 10-step workflow triggered 1,000 times a month uses 1,000 executions, not 10,000. The gap with Make or Zapier grows mechanically on complex processes.
- Deliberately low-code. You can do everything visually, but if you need to go further, you can inject JavaScript or Python directly into a Code node.
AI agent vs. traditional automation: what changes
Traditional automation follows a fixed path. You define each step in advance. If the process falls outside that path, the automation breaks.
An AI agent receives a goal and tools, then decides the steps itself. Here's the concrete difference:
| Criterion | Traditional automation | AI agent |
|---|---|---|
| Logic | Fixed path (if this, then that) | Autonomous decision |
| Adaptability | None | Adapts to context |
| Setup | Every step defined by hand | A goal and tools |
| Concrete example | "For every new email, send an acknowledgment" | "Read my emails, sort them by urgency, draft replies for the urgent ones" |
Automation follows a path. The agent chooses its own.
The 4 components of an AI agent in n8n
To build an agent that works, you need four elements. No more, no less.
1. The AI Agent node: the brain
This is the heart of the system. It receives a request, reasons, and decides which tool to use. Under the hood, the node runs a ReAct loop (Reason + Act): the model thinks through the task, calls a tool, observes the result, then reasons again, and repeats until the goal is reached.
Every reasoning step and every tool call show up in n8n's execution log. You can see why the agent made a given decision. That's valuable for debugging.
Since July 2026, the AI Agent node offers five pre-built agents importable in one click: a voice assistant, a Telegram agent, a task management agent on Google Sheets, an email-sorting agent, and a personal assistant. Each one imports the complete workflow. An excellent starting point before building a custom one.
2. The system prompt: the instructions
The system prompt is your agent's job description. You tell it who it is, what it must do, and the rules to follow. The more precise the prompt, the more reliable the agent.
A good system prompt contains four elements:
- The role ("You are a professional email assistant for an accounting firm")
- The rules ("Never reply to a client without my written approval")
- The expected output format
- The edge cases ("If the email contains a .zip attachment, don't open it and flag it")
3. Connected tools: the arms
Tools are the APIs and services the agent has access to. n8n offers native connectors for Gmail, Google Calendar, Slack, WhatsApp, Notion, Airtable, and hundreds of other applications. If a service has no dedicated connector, the HTTP Request node lets you call any documented API.
4. Memory: the context
Without memory, your agent forgets everything between two messages. It starts from scratch at every interaction. n8n offers four memory backends:
- In-memory (Buffer): context for the current session, reset on restart. For testing.
- Redis: memory persistent across sessions. For production.
- Postgres: durable, queryable memory. Useful for analyzing conversation history.
- Motorhead: long-term memory, automatically summarized. For very long conversations.
Start with in-memory to validate the logic, switch to Redis or Postgres once the agent is running for real.
Building your first email agent: the step-by-step tutorial
The email agent is the "Hello World" of AI agents. Simple, useful, and immediately profitable. Here's how to build it in five steps.
Step 1: install n8n self-hosted
n8n Community Edition is free and offers unlimited executions. You install it on a VPS (a virtual private server) for around €10 a month. One Docker command is enough:
docker run -d --name n8n -p 5678:5678 \
-v n8n_data:/home/node/.n8n \
-e N8N_SECURE_COOKIE=false \
docker.n8n.io/n8nio/n8n
You then access the interface at http://your-ip:5678. For professional use, add a domain name and an SSL certificate.
A cloud version (starting at €24 a month for 2,500 executions) also exists. It suits testing or teams with no technical skill. But for an SME processing customer data, self-hosting is the logical choice: the data stays on your own infrastructure, GDPR compliance is straightforward, and there's no limit on executions.
Step 2: connect the email trigger
In the n8n interface, create a new workflow. Add an Email Trigger (IMAP) node and connect your Gmail inbox (or any account that supports IMAP). Every new email received triggers the workflow automatically. Allow five minutes.
Step 3: add the AI Agent node
Add an AI Agent node and connect it to an LLM. n8n offers native nodes for Claude, GPT-4, Gemini, Mistral, as well as the option to connect to a local LLM via Ollama.
In the system prompt, write:
You are an email assistant. Sort each incoming email into one of these four categories: URGENT, TO HANDLE, INFORMATIONAL, SPAM. For URGENT ones, prepare a draft reply. For INFORMATIONAL ones, write a one-sentence summary. For SPAM, do nothing. Never reply to an email without my explicit approval.
Step 4: wire up the output actions
Depending on the classification, the agent triggers different actions:
- URGENT: create a draft reply in Gmail + Slack notification
- TO HANDLE: add a Gmail label + entry in a Google Sheet
- INFORMATIONAL: archive + summary in a dedicated Slack channel
- SPAM: delete or move to trash
Each branch is wired up in a few clicks. The AI Agent node passes along its classification; Switch nodes route the flow to the right action.
Step 5: test and adjust
Send yourself about ten varied test emails: a supplier invoice, an urgent customer request, a newsletter, a message from a colleague. Check that the agent classifies them correctly. Adjust the prompt if needed. Repeat.
Total build time: about two hours. Time saved per week: five hours minimum, on email sorting alone.
Sub-agents: the key to a reliable system
A common mistake: trying to build a single agent that does everything. Emails, calendar, CRM, quotes, customer support. The result is an agent that does everything poorly.
The right approach is sub-agents: a master agent that receives requests and routes them to specialized agents.
- Master agent: receives the message, understands the intent, routes it to the right sub-agent
- Email sub-agent: everything related to the inbox
- Calendar sub-agent: appointments and availability
- CRM sub-agent: contact records and the sales pipeline
Each sub-agent has its own system prompt, its own tools, and its own specialization. The result is more reliable than a single monolithic agent, and easier to maintain: if the email sub-agent has a problem, the others keep running.
The cost criterion that changes everything
n8n's pricing is a strong argument for SMEs. Unlike Make or Zapier, n8n bills per execution, not per step.
Take a concrete example. A 10-step workflow (checks, enrichment, API calls, notifications) triggered 1,000 times a month:
| Platform | Units consumed | Estimated monthly cost |
|---|---|---|
| n8n (self-hosted) | 1,000 executions | ~€10 (VPS only) |
| n8n (Cloud Starter) | 1,000 executions | €24 |
| Make | 10,000 operations | ~€100 and up |
| Zapier | 10,000+ tasks | Variable, often higher |
The longer and more complex a workflow gets, the wider the gap grows in n8n's favor.
And the self-hosted version, free under its license, has no cap on the number of executions. For an SME deploying several agents in production, that's a structural advantage.
n8n and confidentiality: the argument that counts
This is the point that sets n8n apart for a French SME. The self-hosted version runs the entire platform (workflows, data, calls to models) on your own infrastructure.
You can go further by connecting a local LLM via Ollama (Mistral, Llama, etc.). In this setup, no data leaves your network. Not your customers' emails, not your quotes, not your contact records. This is an increasingly common requirement in regulated sectors: law firms, accounting firms, healthcare professions.
This architecture meets GDPR constraints without extra bureaucracy. There's no data-processing agreement to negotiate with an American SaaS vendor, no confidentiality clause to check line by line. The server is yours, and so is the data.
FAQ
Do you need to know how to code to build an AI agent with n8n?
No. The interface is entirely visual: you assemble blocks by drag-and-drop. Setting up an agent goes through drop-down menus (choosing the LLM, entering the system prompt, selecting tools). If you know how to use a spreadsheet and set up an email rule, you have the skills needed.
How much does an AI agent on n8n cost?
Self-hosted: about €10 a month for the VPS, plus API calls to the language models (a few cents per execution for GPT-4, even less for Claude or Mistral). With a local LLM via Ollama, the cost of API calls drops to zero. On n8n Cloud: starting at €24 a month for 2,500 executions.
What's the difference between n8n, Make, and Zapier?
Zapier is the simplest, but its per-task pricing penalizes complex workflows. Make offers a good visual balance for branching scenarios. n8n is the only one of the three that can be self-hosted, that bills per execution, and that natively supports AI agents with persistent memory. It's also the only one that lets you inject JavaScript or Python code into a workflow.
Is n8n really free?
The self-hosted Community Edition is free with no limit on executions. You only pay for hosting (VPS, electricity) and any API calls to external LLMs. The fair-code license allows commercial use without restriction as long as you don't resell n8n itself as a service.
Can n8n connect to our business software?
Yes, in three ways. First, through the hundreds of native connectors (Google Workspace, Microsoft 365, Slack, Notion, Airtable, etc.). Second, through the HTTP Request node, which can call any documented API, including your accounting software or your ERP. Third, since version 2.0, through MCP (Model Context Protocol) nodes, which standardize connections to tools.
How do you secure an AI agent that accesses our data?
Three essential measures. One: host n8n on your own infrastructure, never on a shared cloud. Two: isolate credentials by project (a marketing project doesn't get access to the accounting project's keys). Three: use local LLMs for workflows that handle sensitive data, and reserve cloud APIs for tasks where confidentiality isn't a concern.
We'll handle your first AI agent
Building an AI agent with n8n is within reach of an SME leader who's comfortable with digital tools. But there's a gap between the theory and an agent running in production on your real data: choosing the VPS, configuring Docker, securing access, fine-tuning the system prompt.
That's exactly what we do at NexeAI. We install n8n on your infrastructure (or ours, if you prefer), we build your first agents with you, and we train you to become self-sufficient. No black box, no perpetual subscription, no dependency.
Let's talk about your project for a free audit of your automatable processes.
If you first want to understand what an AI agent can concretely do in your sector, check out our dedicated AI agents page, or discover how we support SMEs in their automation.


