# n8n for AI agents: the self-hostable, execution-priced platform

> n8n is a fair-code, source-available workflow automation platform with a native AI Agent node, self-hosting, and execution-based pricing. It is the self-hostable, execution-priced, code-friendly option among the big three - reach for it when you want data residency and code escape hatches; skip it when you want zero ops or the simplest no-code glue.

*By Muhammad Idrees · Published June 29, 2026*

## Key takeaways

- n8n bills per execution - one full workflow run regardless of node count - so a 50-node agent run costs the same as a 2-node run, unlike Zapier (per task) or Make (per credit).
- The native AI Agent node is LangChain-based and model-agnostic (OpenAI, Anthropic, Gemini, Mistral, local via Ollama, any OpenAI-compatible endpoint), with memory sub-nodes and two-way MCP - not a bolt-on add-on.
- Self-hosting the free Community Edition gives unlimited executions and full data residency; prompts and credentials never leave your infrastructure - the deciding factor when data cannot leave on-prem.
- It is fair-code under the Sustainable Use License, not MIT or Apache: free for internal use with real JS and Python escape hatches, but you own the server, upgrades, and backups and cannot resell it as a competing hosted service.

## By the numbers

- **1 execution = 1 run** - n8n bills per full workflow run regardless of node count, keeping multi-step AI agent runs cheap and predictable. ([source](https://n8n.io/pricing/))
- **400+ nodes** - Built-in integrations any workflow can expose to an agent as a tool, plus the HTTP Request node for any public API. ([source](https://n8n.io/ai-agents/))

n8n is a fair-code, source-available workflow automation platform you can self-host or run in the cloud, pairing a visual node canvas with real JS and Python and a native AI Agent node. Of the big three automation tools, it is the one built for engineers who want to own the system rather than rent a closed SaaS black box. In my builds I reach for n8n the moment prompts and credentials cannot leave our own infrastructure.

## What is n8n, and what makes it different for AI work?

n8n is a workflow automation tool: you wire triggers and actions into a flow that runs on a schedule, a webhook, or an event. What separates it for AI work is not the canvas - every tool has one - but three properties an AI engineer actually cares about.

First, you can self-host the Community Edition, so data stays in your environment. Second, it prices per execution rather than per action, which keeps multi-step agent runs cheap. Third, the AI Agent, LLM, memory, and MCP nodes ship in core, so building an agent is first-class rather than bolted on. That combination is why "n8n for AI agents" has become a default answer for teams that have outgrown no-code glue.

## Is n8n free and open source?

n8n is fair-code under the Sustainable Use License - the source is public and free to self-host for your own internal automation, but it is not MIT or Apache licensed. The Community Edition runs unlimited executions at no cost; you pay only for the server you run it on. The line you cannot cross is reselling n8n as a competing hosted product without an enterprise agreement.

The paid n8n Cloud and Enterprise tiers exist for teams that want the software without the operations: they add SSO, Git-based version control, multiple environments, and governance on top of the same engine. So "is n8n free" has an honest two-part answer - the engine is free to run yourself, and you pay either in server ops or in a subscription that removes them.

## How is n8n pricing different from Zapier and Make?

The three tools meter completely differently, and at volume the difference dominates the bill. Zapier counts a task for every successful action. Make counts a credit for every module action. n8n counts one execution per whole-workflow run, no matter how many nodes fire inside it. A ten-step agent that calls four tools is ten-plus billable units on Zapier or Make and a single execution on n8n. If you want the deeper distinction between fixed automations and model-driven agents, I cover it in the companion post on automation versus agentic workflows; here the point is narrower - n8n is the cheapest of the three to run a busy agent.

| Dimension | n8n | Zapier | Make |
| --- | --- | --- | --- |
| Hosting / ownership | Self-host (Docker/Postgres) or managed Cloud; data can stay in your env | Fully managed cloud SaaS; no self-host | Managed cloud SaaS only (no self-host) |
| AI & agent support | Native AI Agent node (LangChain-based); model-agnostic LLM, memory, RAG, two-way MCP | Native Zapier Agents + memory, BYO-Model, Copilot, AI Guardrails | Native AI Agents (beta), per-agent model choice, Reasoning panel, MCP server |
| Pricing model | Per execution (one whole-workflow run) | Per task (each successful action) | Per credit (one per module action) |
| Branching / loops | Strong - IF/Switch/Merge, loops, sub-workflows, code nodes | Linear-first - filters + Paths, no native loop/iterator | Strong - routers, iterators, aggregators, error handlers on a canvas |
| Code extensibility | High - native JS and Python Code nodes, HTTP node for any API | Limited - Code by Zapier (JS/Python snippets) | Medium - Make Code App (JS/Python sandbox, beta) |
| Learning curve | Steeper - node graph, expressions, optional self-host | Gentlest - linear trigger/action editor + Copilot | Easy-to-moderate - intuitive visual canvas |
| Best for | Dev teams wanting self-host control, data residency, code/agent tooling | Fast cross-app glue across the widest catalog, zero ops | Data-heavy, branching AI pipelines with visual debugging, no servers |

## Is n8n good for building AI agents?

Yes, and the AI Agent node is the reason. It is a LangChain-based orchestrator that wires a language model, a set of tools, and memory into a tool-calling agent directly on the canvas - you describe the goal and connect the pieces, and the node runs the plan-act-observe loop for you.

- Model-agnostic LLMs - OpenAI, Anthropic Claude, Google Gemini, Mistral, Cohere, Hugging Face, and local models via Ollama or any OpenAI-compatible endpoint, swappable without rebuilding the workflow.
- Memory sub-nodes - a window buffer or summary memory for short context, plus Postgres or Redis nodes for persistent memory keyed by session.
- Retrieval - Postgres with pgvector and other vector-store nodes give the agent RAG over your own data.
- Tools - any of the 400-plus integration nodes can be exposed to the agent as a callable tool, and the HTTP Request node turns any API into one.
- Two-way MCP - the MCP Client Tool consumes external MCP servers, and the MCP Server Trigger exposes your workflows as tools to clients like Claude Desktop or Cursor.

## Can n8n run Python and JavaScript?

Yes - the Code node runs native JavaScript and Python, so you can reshape data before and after an LLM call without leaving the workflow. The visual canvas handles most of a pipeline; drop into a Code node for the edge cases, and reach for raw LangChain or LangGraph only when you need full programmatic control of the agent loop.

One precise caveat: on n8n Cloud the Python option cannot import arbitrary third-party libraries, so library-heavy Python work needs a self-hosted instance. The skeleton below shows the shape of a minimal agent workflow - a webhook in, an agent wired to a chat model and memory.

```json
{
  "nodes": [
    { "name": "Webhook", "type": "n8n-nodes-base.webhook" },
    { "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent" },
    { "name": "Anthropic Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic" },
    { "name": "Window Buffer Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow" }
  ],
  "connections": {
    "Anthropic Chat Model": { "ai_languageModel": [["AI Agent"]] },
    "Window Buffer Memory": { "ai_memory": [["AI Agent"]] },
    "Webhook": { "main": [["AI Agent"]] }
  }
}
```

## Should you self-host n8n or use n8n Cloud?

Self-hosting buys data residency and unlimited free executions, and it costs you the operations: Docker, Postgres, a reverse proxy with TLS, backups, and upgrades are yours to run. n8n Cloud reverses that trade - a monthly fee for zero ops plus SSO, Git version control, and environments. My rule is simple: self-host when data cannot leave your infrastructure or you run high enough volume that free executions matter, and use Cloud when nobody on the team will own a server.

## When should you NOT use n8n?

- A non-technical team that wants the simplest possible linear automations - Zapier is a gentler climb.
- You want zero operations and nobody will maintain a self-hosted instance.
- You are a commercial SaaS that wants to embed or resell the automation engine - the Sustainable Use License restricts that.
- You only need a handful of trivial app-to-app triggers and will never touch code, agents, or self-hosting.
- You are on n8n Cloud and need library-heavy Python - that requires self-hosting.

For AI engineers who want control, data residency, and native agent tooling, n8n is the default of the big three. Everyone else should weigh the operational cost honestly before choosing it over a managed tool.

## Frequently asked questions

### Is n8n free and open source?

n8n is fair-code under the Sustainable Use License - source-available and free to self-host for internal use, but not MIT or Apache licensed. The Community Edition runs unlimited executions for free (you pay only for your own server), though you cannot host it as a competing commercial service without an enterprise license.

### Is n8n good for building AI agents?

Yes - it ships a native AI Agent node built on LangChain that wires an LLM, tools, and memory into autonomous tool-calling agents on the canvas. It is model-agnostic across OpenAI, Anthropic, Gemini, Mistral, and local models via Ollama, with memory sub-nodes, RAG support, and two-way MCP for exposing or consuming tools.

### How is n8n pricing different from Zapier?

Zapier bills per task (each action), while n8n bills per execution - one full workflow run no matter how many nodes it contains. For multi-step or agentic workflows that is much cheaper and more predictable, and the self-hosted Community Edition runs unlimited executions for free.

### Should I self-host n8n or use n8n Cloud?

Self-host when sensitive data or prompts cannot leave your infrastructure, or when you run high volume and want unlimited free executions - at the cost of owning Docker, backups, and upgrades. Use n8n Cloud when you want zero ops plus governance like SSO, Git version control, and environments without maintaining a server.

## Sources

- [n8n - GitHub repository (license, integrations)](https://github.com/n8n-io/n8n)
- [n8n Pricing - official plans and execution model](https://n8n.io/pricing/)
- [n8n AI Agents - official product page](https://n8n.io/ai-agents/)
- [Sustainable Use License - n8n Docs](https://docs.n8n.io/sustainable-use-license/)
- [Zapier Plans & Pricing](https://zapier.com/pricing)
- [Make Pricing & Subscription Packages](https://www.make.com/en/pricing)

## Related posts

- [Zapier for AI automation: is the breadth worth the per-task bill?](https://adrees.dev/blog/zapier-for-ai-automation)
- [Make.com for AI automation: is the visual middle ground worth it?](https://adrees.dev/blog/make-com-for-ai-automation)
- [AI automation vs agentic workflows: what's the difference?](https://adrees.dev/blog/ai-automation-vs-agentic-workflows)

---

More writing: https://adrees.dev/blog · Start a project: https://adrees.dev/#contact · Email: adreesdev@gmail.com
