Everyone is talking about AI agents and smart workflows. But where do you actually build them? More and more, the answer is n8n. It is an open-source automation platform that pairs a visual canvas with AI models like GPT and Claude, so part of your repetitive work gets handled by an agent instead of a person. This guide explains what n8n AI is, what you can build, which models you connect and when to do it yourself versus have it built. No hype, just a practical picture for SMBs.

For the broader context, also read our guide to AI automation for SMBs. Still unsure which tool fits? First compare Zapier, Make and n8n side by side.

An AI agent in n8n has three parts: a language model, memory, and the tools the agent is allowed to use.

What is n8n, and what makes it “AI”?

n8n is an open-source workflow automation platform that wires apps, data and AI models together on a visual canvas. The “AI” part lives in dedicated nodes: since 2024 n8n has an AI Agent node plus separate nodes for language models, memory and vector stores, built on the LangChain framework (n8n documentation).

That difference matters. A plain workflow follows fixed steps: when an email arrives, add a row to a spreadsheet. An AI workflow lets the model decide. A customer question comes in? The agent works out whether it is a quote request, a complaint or a simple question, and picks the next step itself.

n8n is popular for a reason. The project sits at more than 190,000 stars on GitHub with 400+ ready-made integrations (GitHub, 2026). That means a lot of connections already exist, and a large community that shares examples.

What can you build with n8n and AI?

In short: anything involving text, decisions or documents. AI automation is no longer a toy. According to McKinsey, 78 percent of organisations now use AI in at least one business function (McKinsey, State of AI). n8n is one of the places where that becomes concrete.

A few examples we build often in practice:

  • Smart email handling. Incoming mail gets read, categorised and given a draft reply, ready for a human to send.
  • Document processing. Invoices, contracts or quotes get read, the right fields extracted and pushed into your accounting or CRM.
  • Answering customer questions. A chatbot on your own data that answers with source references, instead of making something up.
  • Lead qualification. New leads get enriched, scored and routed to the right person.
  • Content and reporting. Summaries, weekly reports or social drafts that are ready automatically.

More concrete cases sit in our real-world AI automation examples. The pattern is always the same: a task that eats time and needs little judgement goes to the agent.

How does an AI agent work in n8n?

An AI agent in n8n has three building blocks that you wire into the AI Agent node: a language model, memory and tools. The model does the thinking, memory holds the conversation, and tools are the actions the agent may take.

Here is what that looks like in practice:

  • The chat model is the brain. You pick GPT-4o or Claude, for example. This model reads the question and decides what should happen.
  • The memory keeps the agent aware of earlier messages, so a conversation stays coherent.
  • The tools are what the agent can call: search a database, query an API, send an email or run a calculation.

The neat part is that the agent chooses which tool to use. Ask for last month’s revenue and it reaches for the database tool. Ask for a summary and the model does it directly. That keeps one workflow flexible, even when the questions go in every direction.

Which AI models can you connect?

Almost every major language model works in n8n. You connect them through their API with a key, and per node you choose which model that step uses. So you can run a cheap model for simple tasks and a stronger one for the real thinking.

Model / provider What it is strong at Cost model
OpenAI (GPT-4o) Broad tasks, tool use, fast Per token (API)
Anthropic (Claude) Long documents, reasoning, safe output Per token (API)
Google (Gemini) Multimodal, large context window Per token (API)
Local (Ollama, Llama) Data stays on your server, no API cost Hosting only

The local option is interesting for European companies. With Ollama you run an open model on your own server, so sensitive data never goes to a US provider. You trade a little quality against the biggest models, but for many tasks that is fine. What running such an agent costs per month, we break down in our guide to AI agent costs.

Can you work with your own data? RAG in n8n

Yes, and for most companies that is the real point. A language model knows nothing about your manuals, contracts or prices. With RAG (retrieval-augmented generation) you give the agent access to your own documents, so it answers based on your data instead of guessing.

In n8n you build that with a handful of nodes: you turn your documents into embeddings, store those in a vector database (Qdrant, Pinecone or Supabase, for example) and let the agent search there before it answers. The result is a chatbot or assistant that points to the right source. How that works technically, we cover in building an AI agent on your own data with RAG. That is often the difference between a nice demo and something your colleagues actually trust.

Is n8n free, and what does it cost?

The software itself is free. n8n is open-source under a fair-code licence, so you pay nothing for the platform. Your costs sit in two things: hosting and the token usage of your AI model.

  • Self-hosting starts at around €10 per month on a VPS. You handle updates and backups yourself. If you would rather skip that, look at n8n self-hosting versus a managed setup.
  • n8n Cloud begins around €20 per month and takes server management off your plate.
  • Tokens you pay separately to the AI model. A few cents per conversation, but at thousands per month it adds up.

So do not budget for “free software” alone. The real cost sits in running and maintaining it, exactly like any automation.

How do you build your first AI workflow in n8n?

Want to start yourself? The base pattern is always the same. These six steps take you from empty canvas to a working agent:

  1. Pick your trigger. A chat message, an incoming email, a webhook or a fixed schedule. This starts the workflow.
  2. Add the AI Agent node and connect a chat model (GPT-4o or Claude, for example) with your API key.
  3. Give the agent tools. Think a search action, a database node or an API call, so the agent can actually do something.
  4. Add memory if it is a conversation, so context carries between messages.
  5. Test with real examples and adjust the instruction (the prompt) until the agent responds well consistently.
  6. Go live and monitor. Self-hosted or in the cloud, with logging so you can see what the agent does.

For your first project: keep it small. One task, one clear outcome. Good preparation saves a lot, and our checklist for automating a process is a handy starting point.

When is n8n the right choice, and when is it not?

n8n is strong when you need connections, custom logic or control over your data, and less suited when you only want a simple, off-the-shelf integration. Pick it for the flexibility and you take on some maintenance in return. That trade-off is best made up front.

Pick n8n when:

  • You want to combine AI with real actions in your own systems (CRM, database, accounting).
  • You want to keep sensitive data self-hosted inside the EU.
  • You need logic no standard integration solves, and you want to use code nodes.

Look elsewhere when:

  • You only want to connect two apps without AI. A lighter tool is often live faster.
  • Nobody on your team wants to run a server and n8n Cloud feels too limiting.
  • The task is one-off. Manual work is cheaper than building and maintaining a workflow.

Build it yourself or have it built?

Honest answer: a simple AI workflow you can build yourself. n8n is approachable enough to set up a mail assistant or a basic chatbot in an afternoon. For a demo or an internal experiment, that is the fastest route.

It changes once something real is at stake. An agent on sensitive data, with source references, error handling and access control, is a different story. Then it comes down to the nodes nobody shows in a screenshot: retries, validation, logging and secure connections. We cover the trade-off between clicking it together and having it built in no-code versus custom automation.

At TopDevs we build these workflows on n8n and deliver them with full code ownership. Every flow is a JSON file you can export yourself, so no lock-in. And do not treat the agentic wave as hype: Gartner expects that by 2028 around 33 percent of enterprise software will include a form of agentic AI, up from less than 1 percent in 2024 (Gartner). The tooling is maturing fast. Start small now and you are ahead later.

TopDevs is a Dutch software agency that builds custom software, AI integrations and automations. Want to spar about what n8n could do for your process? Book a no-obligation call and we will look together at where the win is.