Hands-on·14 min read

n8n AI Agent Tutorial: Build One, Then Test What Breaks

What an n8n AI agent is, the parts of the AI Agent node (chat model, Simple Memory, tools, $fromAI, Max Iterations, Force Tool Call), a step-by-step build on n8n 2.48.7 with a free local model, n8n pricing per execution as of November 2026, n8n vs Zapier, Make and LangGraph, the 2026 security advisories, and a test of tools, memory, restarts and a failing API.

By the Crio.Do team · Last updated 23 November 2026

Short answer

An n8n AI agent is a workflow built around the AI Agent node: you attach a chat model, optional memory and tools, and the model decides which tool to call. In our test on n8n 2.48.7 with a local 3B model, the agent got 1 of 4 sums right without tools and 4 of 4 with the Calculator, answered 3 of 3 order questions only once the order tool was attached, and lost its Simple Memory on a container restart.

On this page
  1. What is an n8n AI agent?
  2. Parts of an agent workflow
  3. Build one step by step
  4. The test
  5. What the test showed
  6. When to use n8n
  7. n8n pricing
  8. n8n vs Zapier, Make, LangGraph
  9. Before production
  10. Limits of this test
  11. FAQ

What is an n8n AI agent?

n8n is a workflow automation tool: you join boxes called nodes on a canvas, and each node does one job, such as "receive a webhook", "read a Google Sheet" or "send a Slack message". The name is short for "nodemation" and, in the project's own words, "is pronounced as n-eight-n".

An n8n AI agent is a workflow built around the AI Agent node. The docs describe it in one line: "Connect a chat model and one or more tools, and the agent decides which tools to call to complete a task." The difference from a normal workflow is who picks the next step. In a normal workflow you draw every arrow. In an agent, the language model reads the request, looks at the tools you attached, and decides which one to call, with which inputs, and when to stop.

Think of a normal workflow as a train on fixed tracks. An AI agent is a taxi driver with a set of keys: you say where you want to go, and the driver picks the roads. The keys are the tools. If you did not hand over a key, the driver cannot open that door.

Under the hood, "n8n's AI nodes use LangChain's JavaScript framework", and the agent "implements LangChain's tool calling interface". The older agent types (ReAct, Conversational, Plan and Execute, SQL, OpenAI Functions) are gone: "All AI Agent nodes now work as a Tools Agent". n8n 3.0, in early access as of 23 November 2026, removes the old version of the node completely.

The parts of an n8n AI agent workflow

The AI Agent node is a cluster node: "a root node that you extend with sub-nodes, such as a chat model, tools, and memory." On the canvas the sub-nodes hang under the agent instead of sitting in the main line. A working agent has four parts.

PartWhat it doesCommon choices in n8n
TriggerStarts one run and carries the user's message inChat Trigger (hosted or embedded chat), Webhook, a schedule, a form, an app event
Chat modelThe language model that decides what to doThe Tools Agent docs list OpenAI, Anthropic, Groq, Mistral Cloud and Microsoft Foundry. Ollama (local models) is not on that list, but it worked in our test
MemoryKeeps the last few messages of a conversation so the agent can refer backSimple Memory (in the n8n process), Postgres, Redis, MongoDB, Zep, Xata, Motorhead
ToolsThe actions the model may takeCalculator, Code, HTTP Request, Call n8n Workflow, MCP Client Tool, Vector Store, Wikipedia, SerpApi and app nodes

The AI Agent node's own settings that matter most:

  • Prompt (User Message). With a Chat Trigger the node reads the chatInput field automatically. With any other trigger switch it to Define below and point it at your field, for example {{ $json.body.message }}. Forgetting this is the most common first error.
  • System Message. The standing instructions. The default is "You are a helpful assistant".
  • Max Iterations. How many model turns the agent may take before it gives up. "Defaults to 10."
  • Return Intermediate Steps. Adds the list of tool calls to the output. Turn it on while you build; it is the only way to see what the agent actually did.
  • Enable Streaming. On by default. It needs a trigger that can stream (the Chat Trigger, or a Webhook with Response Mode set to Streaming).
  • Force Tool Call on First Iteration (an option in the n8n 2.48.7 node). In the node's own words it is "Useful for smaller models that otherwise skip tool calls". We tested whether it helps.

Two details trip people up:

  • $fromAI() lets the model fill a tool parameter. In an HTTP Request Tool you can write a URL like /orders/{{ $fromAI('order_id') }}, and the model supplies the order number. The arguments "aren't references to existing values"; they are hints that tell the model what to put there.
  • Simple Memory lives inside the n8n process. The node itself warns that it "is not compatible with Queue Mode or Multi-Main setups". It keeps the last 5 interactions by default (Context Window Length = 5 in n8n 2.48.7). We tested what happens to it on a restart.

n8n AI agent tutorial: build one step by step

This is the exact setup we used, on a MacBook (Apple M1 Pro), with n8n 2.48.7 in Docker and a free local model in Ollama. No account and no API key are needed. If you prefer the editor, the same four nodes can be dragged onto the canvas; the CLI route below is what lets us rebuild the test in one go.

  1. Get a model. Install Ollama and pull a small model that supports tool calling: ollama pull qwen2.5:3b (1.9 GB).
  2. Start n8n. The README's command is docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n. Open http://localhost:5678.
  3. Point n8n at Ollama. Inside Docker, localhost means the container, not your laptop. The docs say to "use host.docker.internal as the host address instead of localhost", so the Ollama credential's base URL is http://host.docker.internal:11434. On Linux add --add-host host.docker.internal:host-gateway to the docker command.
  4. Build the workflow. Webhook (POST) → AI Agent, with three sub-nodes: Ollama Chat Model, Simple Memory and your tools. Our script below writes this as workflow JSON.
  5. Publish it. Since n8n 2.0 there is no Active toggle: "The new workflow publishing system replaces the previous active/inactive toggle." From the CLI: n8n publish:workflow --id=<ID>. Imported workflows start unpublished.
  6. Call it. curl -X POST localhost:5678/webhook/w-tools -H 'Content-Type: application/json' -d '{"session":"s1","message":"What is the status of order 1042?"}'

make_workflows.py (writes the four workflows we tested)

"""Writes the n8n workflows used in the test (import with `n8n import:workflow --separate --input=/kit/workflows`).
Every workflow: Webhook (POST, respond when last node finishes) -> AI Agent (prompt = body.message)
with an Ollama Chat Model (qwen2.5:3b, temperature 0) and Simple Memory keyed on body.session.
  w-notools : no tools
  w-tools   : Calculator + HTTP Request Tool (GET /orders/{order_id})
  w-force   : w-tools + 'Force Tool Call on First Iteration'
  w-maxiter : w-tools with Max Iterations = 3 (run against the FLAKY api)"""
import json, os, pathlib
OUT = pathlib.Path(__file__).resolve().parent / "workflows"
OUT.mkdir(exist_ok=True)
SYSTEM = ("You are the order help desk of an online store. Use the calculator for any arithmetic. "
          "Use the order_lookup tool to get an order's status; never guess an order status. "
          "Answer in one or two short sentences.")


def wf(key, tools, extra_opts=None):
    opts = {"systemMessage": SYSTEM, "maxIterations": 10, "returnIntermediateSteps": True, "enableStreaming": False}
    opts.update(extra_opts or {})
    nodes = [
        {"id": f"{key}-hook", "name": "Webhook", "type": "n8n-nodes-base.webhook", "typeVersion": 2.2,
         "position": [0, 0], "webhookId": f"{key}-hook",
         "parameters": {"httpMethod": "POST", "path": key, "responseMode": "lastNode", "options": {}}},
        {"id": f"{key}-agent", "name": "AI Agent", "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 3.1,
         "position": [300, 0],
         "parameters": {"promptType": "define", "text": "={{ $json.body.message }}", "options": opts}},
        {"id": f"{key}-model", "name": "Ollama Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
         "typeVersion": 1, "position": [200, 250],
         "parameters": {"model": "qwen2.5:3b", "options": {"temperature": 0, "numCtx": 4096}},
         "credentials": {"ollamaApi": {"id": "ollamaLocal01", "name": "Ollama local"}}},
        {"id": f"{key}-mem", "name": "Simple Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
         "typeVersion": 1.4, "position": [350, 250],
         "parameters": {"sessionIdType": "customKey", "sessionKey": "={{ $json.body.session }}", "contextWindowLength": 5}},
    ]
    conns = {
        "Webhook": {"main": [[{"node": "AI Agent", "type": "main", "index": 0}]]},
        "Ollama Chat Model": {"ai_languageModel": [[{"node": "AI Agent", "type": "ai_languageModel", "index": 0}]]},
        "Simple Memory": {"ai_memory": [[{"node": "AI Agent", "type": "ai_memory", "index": 0}]]},
    }
    if tools:
        nodes += [
            {"id": f"{key}-calc", "name": "Calculator", "type": "@n8n/n8n-nodes-langchain.toolCalculator",
             "typeVersion": 1, "position": [500, 250], "parameters": {}},
            {"id": f"{key}-http", "name": "order_lookup", "type": "n8n-nodes-base.httpRequestTool", "typeVersion": 4.5,
             "position": [650, 250],
             "parameters": {"toolDescription": "Get the status, courier and delivery date of one order by its order number",
                            "method": "GET",
                            "url": "=http://host.docker.internal:8799/orders/{{ $fromAI('order_id', 'the order number, digits only', 'string') }}",
                            "options": {}}},
        ]
        for t in ("Calculator", "order_lookup"):
            conns[t] = {"ai_tool": [[{"node": "AI Agent", "type": "ai_tool", "index": 0}]]}
    w = {"id": key.replace("-", "") + "0000000000"[: 16 - len(key.replace("-", ""))], "name": key, "nodes": nodes,
         "connections": conns, "settings": {"executionOrder": "v1"}, "active": False, "pinData": {}}
    (OUT / f"{key}.json").write_text(json.dumps(w, indent=2))
    return w["id"]


ids = {k: wf(k, t, o) for k, t, o in [
    ("w-notools", False, None),
    ("w-tools", True, None),
    ("w-force", True, {"forceToolCallOnFirstIteration": True}),
    ("w-maxiter", True, {"maxIterations": 3}),
]}
(OUT.parent / "workflow_ids.json").write_text(json.dumps(ids, indent=2))
print(ids)

setup.sh (import, publish, start)

#!/bin/bash
# Import, publish and start the test n8n (n8n 2.48.7, Docker). Run from kit/.
# Ollama must be running on the host with qwen2.5:3b pulled; orders_api.py serves port 8799.
set -e
IMG=docker.n8n.io/n8nio/n8n:latest
DATA=/tmp/w2n8n/data   # n8n's database, credentials and encryption key
python3 make_workflows.py
(PORT=8799 nohup python3 orders_api.py > /dev/null 2>&1 &)
CLI="docker run --rm -e N8N_DIAGNOSTICS_ENABLED=false -v $DATA:/home/node/.n8n -v $PWD:/kit --entrypoint n8n $IMG"
$CLI import:credentials --input=/kit/credentials.json   # Ollama base URL http://host.docker.internal:11434
$CLI import:workflow --separate --input=/kit/workflows
for id in wnotools00000000 wtools0000000000 wforce0000000000 wmaxiter00000000; do
  $CLI publish:workflow --id=$id
done
docker run -d --name w2n8n -p 127.0.0.1:5678:5678 -e N8N_DIAGNOSTICS_ENABLED=false -e GENERIC_TIMEZONE=Asia/Kolkata -v $DATA:/home/node/.n8n $IMG

We tested an n8n AI agent with a small local model

Most n8n agent tutorials stop at "it answered". We wanted to know what the agent node actually does for you, so we built the agent above and tried to break it. Everything ran on one laptop: n8n 2.48.7 in Docker, Ollama 0.24.0 with qwen2.5:3b at temperature 0, and a tiny order-status API written in standard-library Python. Nothing left the machine.

The job: an order help desk for an online store. The system message says: use the calculator for any arithmetic, use the order_lookup tool for order status, and "never guess an order status". The API knows four orders (1042 shipped, 1077 processing, 2210 delivered, 3305 cancelled) and returns a 404 error for anything else.

orders_api.py

"""Tiny order-status API the n8n agent calls through its HTTP Request Tool (stdlib only).
GET /orders/<id> -> 200 JSON for a known order, 404 for an unknown one.
FLAKY=1 makes every request fail with 500 (used for the max-iterations test).
Every request is appended to requests.log so we can count what the agent really called."""
import json, os, time
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer

ORDERS = {
    "1042": {"order_id": "1042", "status": "shipped", "courier": "BlueDart", "eta": "2026-11-25"},
    "1077": {"order_id": "1077", "status": "processing", "courier": None, "eta": "2026-11-28"},
    "2210": {"order_id": "2210", "status": "delivered", "courier": "Delhivery", "eta": "2026-11-20"},
    "3305": {"order_id": "3305", "status": "cancelled", "courier": None, "eta": None},
}
LOG = os.path.join(os.path.dirname(os.path.abspath(__file__)), "requests.log")


class H(BaseHTTPRequestHandler):
    def do_GET(self):
        with open(LOG, "a") as f:
            f.write(f"{time.time():.3f} {self.path}\n")
        if os.environ.get("FLAKY") == "1":
            return self._send(500, {"error": "upstream timeout"})
        parts = self.path.strip("/").split("/")
        if len(parts) == 2 and parts[0] == "orders":
            o = ORDERS.get(parts[1])
            return self._send(200, o) if o else self._send(404, {"error": f"no order {parts[1]}"})
        self._send(404, {"error": "not found"})

    def _send(self, code, body):
        b = json.dumps(body).encode()
        self.send_response(code)
        self.send_header("Content-Type", "application/json")
        self.send_header("Content-Length", str(len(b)))
        self.end_headers()
        self.wfile.write(b)

    def log_message(self, *a):
        pass


if __name__ == "__main__":
    ThreadingHTTPServer(("0.0.0.0", int(os.environ.get("PORT", "8799"))), H).serve_forever()

Four workflows, identical except for the tools and two settings:

WorkflowTools attachedChanged setting
w-notoolsNone
w-toolsCalculator, order_lookup (HTTP Request Tool)
w-forceCalculator, order_lookupForce Tool Call on First Iteration = on
w-maxiterCalculator, order_lookupMax Iterations = 3

A runner script sent each question to the workflow's webhook, a new memory session per question, and recorded the reply, the tool calls n8n reported (Return Intermediate Steps), and how many requests actually reached the API. The answers were graded by the script: a maths answer counts only if the exact number appears in the reply; an order answer counts only if it names the right status and no other.

run.py

"""Runs the n8n AI Agent test against the workflows from make_workflows.py (stdlib only).
Usage: python3 run.py <phase> where phase is one of: tools | tools2 | memory | restart-before | restart-after | flaky
Appends one JSON line per call to results.jsonl and prints a readable line per call."""
import json, re, sys, time, urllib.request, pathlib, hashlib
HERE = pathlib.Path(__file__).resolve().parent
N8N = "http://localhost:5678/webhook/"
LOG = HERE / "requests.log"
TIMEOUT = 900  # first run used 300 s; one w-tools maths call timed out at 300 s and stopped that phase


def ask(wf, session, message, tag):
    before = LOG.read_text().count("\n") if LOG.exists() else 0
    body = json.dumps({"session": session, "message": message}).encode()
    req = urllib.request.Request(N8N + wf, data=body, headers={"Content-Type": "application/json"})
    t = time.time()
    try:
        with urllib.request.urlopen(req, timeout=TIMEOUT) as r:
            code, raw = r.status, r.read().decode()
    except urllib.error.HTTPError as e:
        code, raw = e.code, e.read().decode()
    except TimeoutError:
        code, raw = "timeout", json.dumps({"output": f"(no reply within {TIMEOUT} s)"})
    dt = time.time() - t
    try:
        data = json.loads(raw)
    except ValueError:
        data = {"raw": raw}
    if isinstance(data, list):
        data = data[0] if data else {}
    steps = data.get("intermediateSteps") or []
    tools = [s.get("action", {}).get("tool") for s in steps]
    tool_inputs = [s.get("action", {}).get("toolInput") for s in steps]
    after = LOG.read_text().count("\n") if LOG.exists() else 0
    rec = {"tag": tag, "wf": wf, "session": session, "message": message, "http": code, "seconds": round(dt, 2),
           "output": data.get("output", data.get("message", data.get("raw"))), "tools": tools,
           "tool_inputs": tool_inputs, "api_requests": after - before}
    with open(HERE / "results.jsonl", "a") as f:
        f.write(json.dumps(rec) + "\n")
    out = str(rec["output"]).replace("\n", " ")
    print(f"[{tag}] {wf} {code} {dt:5.1f}s tools={tools} api={rec['api_requests']} :: {out[:160]}", flush=True)
    return rec


MATH = [
    ("What is 4837 * 2919?", 4837 * 2919),
    ("What is 98765 * 4321?", 98765 * 4321),
    ("What is 3 items at 1,249 plus 2 items at 799, plus 18% GST on the total?", (3 * 1249 + 2 * 799) * 1.18),
    ("What is 2 to the power 20?", 2 ** 20),
]
ORDERS = [("What is the status of order 1042?", "shipped"), ("What happened to order 3305?", "cancelled"),
          ("What is the status of order 9999?", None)]
STATUS = ("shipped", "processing", "delivered", "cancelled")


def nums(text):
    return [float(x) for x in re.findall(r"-?\d+(?:\.\d+)?", str(text).replace(",", ""))]


def grade_math(out, want):
    return any(abs(n - want) <= max(0.011, abs(want) * 1e-9) for n in nums(out))


def grade_order(out, want):
    o = str(out).lower()
    if want:
        return want in o and not any(s in o for s in STATUS if s != want and s not in want)
    return not any(s in o for s in STATUS)


def graded(wf, tag, i, q, want, grade):
    r = ask(wf, f"{wf}-{tag[0]}{i}", q, tag)
    with open(HERE / "graded.jsonl", "a") as f:
        f.write(json.dumps(dict(r, correct=grade(r["output"], want), want=want)) + "\n")


phase = sys.argv[1]
if phase == "tools2":
    # Resume after the 300 s timeout: what the first pass did not reach; w-force cut to the GST question + orders.
    done = {(json.loads(l)["wf"], json.loads(l)["message"]) for l in (HERE / "graded.jsonl").read_text().splitlines()}
    plan = [("w-tools", MATH[2:], ORDERS), ("w-force", MATH[2:3], ORDERS)]
    for wf, math, orders in plan:
        for i, (q, want) in enumerate(MATH):
            if (q, want) in math and (wf, q) not in done:
                graded(wf, "math", i, q, want, grade_math)
        for i, (q, want) in enumerate(ORDERS):
            if (wf, q) not in done:
                graded(wf, "order", i, q, want, grade_order)
elif phase == "tools":
    for wf in ("w-notools", "w-tools", "w-force"):
        for i, (q, want) in enumerate(MATH):
            r = ask(wf, f"{wf}-m{i}", q, "math")
            r2 = dict(r, correct=grade_math(r["output"], want), want=want)
            with open(HERE / "graded.jsonl", "a") as f:
                f.write(json.dumps(r2) + "\n")
        for i, (q, want) in enumerate(ORDERS):
            r = ask(wf, f"{wf}-o{i}", q, "order")
            r2 = dict(r, correct=grade_order(r["output"], want), want=want)
            with open(HERE / "graded.jsonl", "a") as f:
                f.write(json.dumps(r2) + "\n")
elif phase == "memory":
    ask("w-tools", "mem-a", "Hi, my name is Asha and my order number is 1077.", "mem")
    ask("w-tools", "mem-a", "What is my name?", "mem")
    ask("w-tools", "mem-a", "What is the status of my order?", "mem")
    ask("w-tools", "mem-b", "What is my name?", "mem-other-session")
elif phase == "restart-before":
    ask("w-tools", "mem-r", "Hi, my name is Ravi.", "restart")
    ask("w-tools", "mem-r", "What is my name?", "restart-before")
elif phase == "restart-after":
    ask("w-tools", "mem-r", "What is my name?", "restart-after")
elif phase == "flaky":
    ask("w-maxiter", "flaky-3", "What is the status of order 1042?", "flaky-max3")

Then four more checks on w-tools: does Simple Memory remember a name in the same session, does another session see it, does it survive a restart of the n8n container, and what happens with Max Iterations = 3 when the API fails every call.

What the test showed

Results of 18 graded questions plus the memory, restart and failure checks, all run on 23 November 2026. The full replies are in the run log below.

No toolsCalculator + order_lookupSame + Force Tool Call
Maths answers right1 of 44 of 41 of 1
Order questions right0 of 33 of 33 of 3
Runs that called a tool0 of 77 of 74 of 4
Median seconds per run256783

1. The tools did the work the model could not. Without tools, the 3-billion-parameter model got three of four sums wrong. It said 4837 × 2919 is "1,396,5013" (the answer is 14,119,203). It misread "3 items at 1,249" as "5 items" and gave "$9,306.6" for a total of 6,307.10. The only one it got right was 2 to the power 20, a number every model has seen a thousand times. With the Calculator attached it called the tool every time and got all four right, including "$6,307.10" for the GST question.

2. It did not invent order statuses, but it did not answer either. Our system message names the order_lookup tool. With no tool attached, the model replied "Please check the order status using our order_lookup tool" to all three order questions. That is safer than a made-up status, but it is useless to a customer. With the tool attached, all three were right, and for order 9999 it said the order "does not exist in our system" instead of guessing.

3. n8n ran an agent with no tools at all. The docs say "You must connect at least one tool sub-node to an AI Agent node". In n8n 2.48.7 our published no-tools workflow ran 7 times without a single error. So the rule is not enforced at run time; the model just has nothing to call.

4. Force Tool Call made no difference here. qwen2.5:3b already called a tool on every question that needed one, so forcing the first call changed no answer. It may still help a model that skips tools; ours did not.

5. Simple Memory worked, and the model still forgot. In one session we said "Hi, my name is Asha and my order number is 1077", then asked "What is my name?". The agent replied: "It seems your question about "What is my name?" might have been a misunderstanding." We pulled the prompt n8n actually sent to the model out of n8n's execution data: the earlier message was there, word for word. n8n did its job; the small model did not read its own history. A different session, as it should, did not know the name at all.

6. Memory keeps old tool results, and the agent reused one. The same prompt showed that n8n stores the tool call and the tool's JSON reply in memory, not just the chat text. When we then asked "What is the status of my order?", the agent answered from memory, with no new order_lookup call, repeating the earlier reply word for word. That is fine for 30 seconds. For a status that changes, it is a stale answer that looks fresh. If freshness matters, say so in the system message ("always call order_lookup, even if you have checked before") or keep tool results out of memory.

7. A restart wiped the memory. We told a new session "Hi, my name is Ravi.", and it answered "Your name is Ravi." when asked. Then we ran docker restart on the n8n container and asked again. The reply: "Names are not stored in the system as they are private information." The prompt n8n sent after the restart had no trace of Ravi. Simple Memory lives in the n8n process, so a deploy, a crash or an update forgets every conversation. The docs warn about queue mode; they do not mention restarts.

8. A failing API did not cause a loop. With the API returning HTTP 500 on every call and Max Iterations set to 3, the agent called order_lookup once, got the error back as the tool result, and replied "It seems there was an issue processing the request." It did not retry and did not invent a status. One request reached the API.

9. One run is one execution, however many steps. n8n logged 27 executions for our 27 webhook calls. A typical order question took two model calls and one API call inside one execution. That is the unit n8n bills on its hosted plans.

10. Speed is the real cost of a small local model. On a busy laptop, runs that used a tool had a median of 67 seconds; without tools, 25 seconds. Every tool run needs at least two model calls (decide, then answer). One maths run took longer than our 300-second client timeout. n8n kept the execution going after we disconnected and finished it in 6 minutes 7 seconds, so a timeout on your side does not stop the work on n8n's side.

run.log (every reply as printed by run.py, cut at 160 characters; full replies in results.jsonl)

[math] w-notools 200  68.5s tools=[] api=0 :: The product of 4837 and 2919 is 1,396,5013.
[math] w-notools 200  47.3s tools=[] api=0 :: The result of 98765 * 4321 is 4260844265.
[math] w-notools 200  64.3s tools=[] api=0 :: The total cost for 5 items at 1,249 and 2 items at 799 with an 18% GST is $9,306.6.
[math] w-notools 200  20.1s tools=[] api=0 :: 2 to the power of 20 is 1,048,576.
[order] w-notools 200  24.5s tools=[] api=0 :: Please check the status of order 1042 using our order_lookup tool.
[order] w-notools 200  12.4s tools=[] api=0 :: Please check the order status using our order_lookup tool.
[order] w-notools 200  13.0s tools=[] api=0 :: Please check the order status using the order_lookup tool as I cannot access real-time data.
[math] w-tools 200 214.0s tools=['Calculator'] api=0 :: The result of 4837 * 2919 is 14119203.
[math] w-tools 200 218.2s tools=['Calculator'] api=0 :: The result of 98765 * 4321 is 426763565.
TimeoutError: timed out   <- client gave up after 300 s (37-line traceback shortened)
[mem] w-tools 200 152.1s tools=['order_lookup'] api=1 :: Your order with number 1077 is currently in the processing status and we expect it to be delivered on November 28, 2026 via courier. Please check back for updat
[mem] w-tools 200  19.5s tools=[] api=0 :: It seems your question about "What is my name?" might have been a misunderstanding. Could you please provide more details or clarify what information you're loo
[mem] w-tools 200  24.0s tools=[] api=0 :: Your order with number 1077 is currently in the processing status and we expect it to be delivered on November 28, 2026 via courier. Please check back for updat
[mem-other-session] w-tools 200  12.2s tools=[] api=0 :: Names are not stored in the system as they are private information. How can I assist you further with your order today?
[restart] w-tools 200   7.4s tools=[] api=0 :: Hello Ravi, how can I assist you today?
[restart-before] w-tools 200   7.3s tools=[] api=0 :: Your name is Ravi.
[restart-after] w-tools 200  41.6s tools=[] api=0 :: Names are not stored in the system as they are private information. How can I assist you further with your order today?
[flaky-max3] w-maxiter 200 119.4s tools=['order_lookup'] api=1 :: It seems there was an issue processing the request. Please provide another order number or contact customer support for assistance.
ALL DONE
[math] w-tools 200 192.3s tools=['Calculator'] api=0 :: The total cost for 3 items at $1,249 plus 2 items at $799, including a 18% GST on the total is $6,307.10.
[math] w-tools 200  67.3s tools=['Calculator'] api=0 :: 2 to the power 20 is 1048576.
[order] w-tools 200  46.5s tools=['order_lookup'] api=1 :: The order 1042 is shipped with BlueDart and the expected time of arrival (ETA) is November 25, 2026.
[order] w-tools 200  54.9s tools=['order_lookup'] api=1 :: Order 3305 has been cancelled and there is no courier information or estimated time of arrival.
[order] w-tools 200  53.3s tools=['order_lookup'] api=1 :: It seems that the order with number 9999 does not exist in our system. Please check the order number and try again.
[math] w-force 200 132.1s tools=['Calculator'] api=0 :: The total cost for 3 items at $1,249 plus 2 items at $799, including a 18% GST on the total is $6,307.10.
[order] w-force 200  95.3s tools=['order_lookup'] api=1 :: The order 1042 is shipped with BlueDart and the expected time of arrival (ETA) is November 25, 2026.
[order] w-force 200  61.9s tools=['order_lookup'] api=1 :: Order 3305 has been cancelled and there is no courier information or estimated time of arrival.
[order] w-force 200  69.9s tools=['order_lookup'] api=1 :: It seems that the order with number 9999 does not exist in our system. Please check the order number and try again.
TOOLS2 DONE

The TimeoutError line is the 300-second timeout from point 10. It stopped that first pass. The tools2 phase then re-ran the questions the first pass never reached, with a 900-second timeout.

When an n8n AI agent is the right choice

  • Good fit: the agent is one step in a business process. For example, a support inbox that reads a ticket, looks up the order, drafts a reply and posts it to Slack for approval. n8n already has the triggers, the app nodes, credentials, retries and an execution log you can open.
  • Good fit: you want to self-host for data reasons and run a local model. Our whole test ran with no cloud account and no API key.
  • Think twice: the agent's reasoning is the product (multi-step planning, custom loops, evaluations in CI). A code framework such as LangGraph gives you that control, and tests that live next to the code.
  • Think twice: a high-volume public chatbot on a hosted plan. Every message is an execution, so a busy bot uses the allowance fast. Count before you commit.

Whichever you pick, the lessons from our run carry over. Give the model tools for anything exact (maths, live data). Keep real state in a real database, not in process memory. Read what was actually sent to the model before you blame the framework.

n8n pricing: what an AI agent costs to run

n8n charges per execution, and "An execution is a single run of a workflow." It does not matter how many tool calls or model turns happen inside the run. The pricing page says it directly: n8n bills "regardless of complexity". Prices as shown on n8n.io/pricing on 23 November 2026 (in euros, billed annually; no rupee prices are shown):

PlanPriceExecutionsWhere it runs
Community EditionFreeNo plan limit (your own server)Self-hosted, from GitHub
Starter20€/month2.5K a monthHosted by n8n
Pro50€/month10K a monthHosted by n8n
Business667€/month40K a monthSelf-hosted only
EnterpriseContact salesCustomHosted or self-hosted

The catch for chatbots: "Every message to the Chat Trigger executes your workflow. This means that one conversation where a user sends 10 messages uses 10 executions". A support bot that answers 500 conversations a month with 5 messages each uses 2,500 executions, which is the whole Starter allowance. The model's own cost (OpenAI, Anthropic tokens) is extra unless you run a local model.

Self-hosting the Community Edition is free under the Sustainable Use License, which is "fair-code", not open source. You "may use or modify the software only for your own internal business purposes or for non-commercial or personal use." You can charge clients for building their workflows; you cannot host n8n as a service for clients to build their own, or white-label it.

n8n vs Zapier, Make and LangGraph for AI agents

n8nZapierMakeLangGraph
What it isVisual workflow tool with an AI Agent nodeHosted automation (Zaps)Hosted visual automation (scenarios)Python/JS library: "a low-level orchestration framework and runtime for long-running, stateful agents"
You pay perWorkflow execution, any number of stepsTask: "Each successful action in a Zap counts as a separate task."Credit: "Non-AI apps: 1 operation equals 1 credit."Nothing for the open-source library; you pay for your own hosting and model
Self-hostYes (Community Edition)NoNoYes (it is your code)
Who builds itAnyone; code optional (Code node, Code Tool)Non-developersNon-developersDevelopers
Best forAgents that sit inside business workflows and call many appsSimple app-to-app automationsVisual multi-step scenariosCustom agent logic, loops and state you control line by line

The billing row decides a lot for agents. One agent run can make several tool calls. On n8n that is still one execution. On Zapier each successful action step is a task, and on Make each module run uses credits. For AI steps, Make bills custom provider connections by operations and you pay the provider directly for tokens.

n8n vs LangGraph is a different question. Both can run the same tool-calling loop (n8n's agent is LangChain underneath). Pick n8n when the agent is one step in a business process and you want 1,500+ app integrations, credentials and retries for free. Pick LangGraph when the agent's logic is the product: custom branching, long-running state, tests in code. Our LangGraph tutorial builds one from scratch.

Before you put an n8n agent in production

An agent can call real APIs with real credentials, chosen by a model. In 2026 the n8n project published several high-severity advisories that touch exactly the agent features. From the GitHub security advisories for n8n-io/n8n:

AdvisorySeverityPublishedFixed in
Expression Sandbox Escape via $fromAI Prototype Leak Leads to Host RCE (GHSA-9x83-43r8-5hwc)High19 Aug 20261.123.73, 2.35.4, 2.36.2
Inline Agent Node-Tool Introspection Decrypts Any Instance Credential Without Ownership Check (GHSA-9rhv-fhr8-7q5r)High16 Sep 20262.39.6, 2.40.1
NoSQL Injection in MongoDB Chat Memory Node Allows Unauthenticated Cross-Session Chat History Disclosure (GHSA-w24g-6454-7w7f)High16 Sep 20261.123.80, 2.39.6, 2.40.1
RCE in the n8n Main Process via Path Traversal in MCP Node-Schema Loading (GHSA-6h4x-896x-fw5m)High5 Aug 20262.33.4, 2.34.1
Agent Workflow Tool Bypasses Sub-Workflow Caller Policy (GHSA-7hgx-277f-7vmg, CVE-2026-86996)Medium2 Sep 20262.37.7, 2.38.2
  • Stay current. Every fix above is in 2.48.7, the stable release as of 23 November 2026 (published 20 November 2026). If you self-host an older 2.x release, check each advisory's affected versions and upgrade.
  • Set your own N8N_ENCRYPTION_KEY and back it up. n8n generates one on first launch and uses it to encrypt saved credentials; queue-mode workers need the same key.
  • Gate risky tools. n8n can "require human approval before the AI Agent executes specific tools", sent through chat, Slack or Telegram. Use it for anything that sends, edits or deletes.
  • Use real memory in production. Simple Memory is for testing; use Postgres or Redis memory once you run more than one n8n process.
  • Keep the Code node isolated. n8n 2.0 runs all Code node executions on task runners and blocks environment variables by default; the docs recommend task runners in external mode for stronger isolation.

For the attacks themselves (prompt injection, poisoned tool output), read prompt injection and guardrails and MCP security.

Limits of this test

  • One small model, one machine. qwen2.5:3b at temperature 0 on an Apple M1 Pro, through an x86 build of Ollama 0.24.0 that ran on the CPU, while other jobs were running. A larger model (or a hosted one) would likely recall the name in point 5, and would be much faster. The timings show the shape of the cost (tool runs need two model calls), not numbers to plan around.
  • Few questions. 18 graded questions, each asked once. That is enough to show what n8n does in each case, not to give an accuracy rate for the model.
  • Force Tool Call got 4 questions, and only on a model that already used its tools. We cannot say whether the setting helps a model that skips tools.
  • Webhook, not Chat Trigger. We used a Webhook so a script could drive the test. The Chat Trigger passes sessionId and chatInput for you; the agent and memory behave the same.
  • A toy API. Four hard-coded orders, no authentication, no rate limits. A real API adds auth errors and slow responses that are worth testing the same way.
  • Prices and versions change. Plan prices, execution limits and advisories are as of 23 November 2026; n8n ships a release most weeks.

Frequently asked questions

What is an n8n AI agent?

It is an n8n workflow built around the AI Agent node. You connect a chat model, optional memory and one or more tools, such as a calculator or an HTTP request, and the model decides which tool to call, with which inputs, and when to stop. Since n8n 1.82.0 every AI Agent node works as a Tools Agent.

Is n8n free to use for AI agents?

The self-hosted Community Edition is free under the Sustainable Use License, for internal business, personal or non-commercial use, and the AI Agent node is included. Hosted plans started at 20 euros a month for 2,500 executions as of 23 November 2026. Model costs are separate unless you run a local model.

What does n8n stand for?

n8n is short for nodemation, and the project says it is pronounced n-eight-n. The founder, Jan Oberhauser, chose node because the editor is a node view built on Node.js, and mation from automation. He shortened it because the full name was too long to type every time in the command line.

Can n8n use a local model with Ollama?

Yes. Add an Ollama Chat Model sub-node and an Ollama credential. If n8n runs in Docker, set the base URL to http://host.docker.internal:11434, because localhost inside the container is not your laptop. Pick a model that supports tool calling; we tested qwen2.5:3b on n8n 2.48.7.

Does n8n Simple Memory survive a restart?

No. In our test on n8n 2.48.7 the agent remembered a name in the same session, then forgot it after a docker restart of the n8n container. Simple Memory lives inside the n8n process and does not work in queue mode, so use Postgres or Redis chat memory for anything real.

How many executions does an n8n chatbot use?

One per message. n8n counts one execution for each run of a workflow, whatever happens inside it, and every message sent to a Chat Trigger starts a new run. So a conversation of 10 messages uses 10 executions, however many tool calls the agent makes while answering them.

Should I use n8n or LangGraph for an AI agent?

Use n8n when the agent is one step in a business process and needs many app integrations, saved credentials and retries without writing code. Use LangGraph when the agent's logic is the product: custom branching, long-running state and tests in code. n8n's AI nodes are built on LangChain's JavaScript framework.

Crio AI Engineering

Build agents that work outside a demo

Crio's AI Engineering program is project-first: you build LLM apps, RAG pipelines and tool-using agents, then learn to evaluate, secure and ship them. Talk to the team about whether it fits you.

Sources

  1. AI Agent node documentation (Tools Agent) · n8n
  2. AI Agent node: common issues · n8n
  3. Simple Memory node documentation · n8n
  4. Ollama Chat Model node: common issues (Docker and host.docker.internal) · n8n
  5. Let AI specify tool parameters with $fromAI() · n8n
  6. Chat Trigger node documentation · n8n
  7. n8n v2.0 breaking changes · n8n
  8. CLI commands (import:workflow, publish:workflow) · n8n
  9. LangChain in n8n · n8n
  10. n8n README (Docker quick start, what n8n means) · n8n on GitHub
  11. n8n releases (n8n@2.48.7, 20 Nov 2026) · n8n on GitHub
  12. n8n security advisories · n8n on GitHub
  13. Sustainable Use License · n8n
  14. n8n pricing (as of 23 Nov 2026) · n8n
  15. Zapier pricing (tasks) · Zapier
  16. Make: credits · Make
  17. LangGraph overview · LangChain

Facts are quoted from the pages above as fetched on 23 November 2026; the Simple Memory default (5) and the Force Tool Call description come from the node definitions exported from n8n 2.48.7 itself. The test kit (workflows, API, runner, every reply) is reproduced on this page.

Last updated: