tutorial

Building AI Agents with n8n in 2026: Tools, RAG, and Deployment

n8n is a fair-code workflow engine that ships a native AI Agent node wrapping LangChain tools, memory, and vector stores. This tutorial covers agent design patterns, retrieval-augmented generation with Pinecone or pgvector, deployment options (Cloud vs self-hosted), and operational guardrails as of May 2026.

Why n8n for AI Agents

n8n is a fair-code workflow engine, founded in 2019 and headquartered in Berlin, that pairs a visual editor with native code blocks. As of May 2026, n8n ships an AI Agent node that wraps LangChain primitives (tools, memory, output parsers) inside the standard workflow canvas, allowing both visual and JavaScript construction of agentic flows. The combination matters because most production agent work is glue: parsing inputs, calling models, branching on outputs, persisting state, retrying on failure, and notifying humans on exception. n8n already provides those primitives.

The AI Agent Node

The AI Agent node accepts a chat model, an optional vector store, and a list of "tools" (which are themselves n8n sub-workflows or HTTP requests). Internally it runs a ReAct or function-calling loop until the model emits a stop signal or hits a step cap. As of May 2026, supported model providers include OpenAI, Anthropic, Mistral, Google Vertex AI, Ollama (for local models), and any OpenAI-compatible endpoint via the generic node.

Practical agent patterns implemented inside this node include:

  • A research agent that searches the web (SerpAPI tool), reads pages (HTTP Request tool), and writes a summary to Notion
  • A triage agent that reads a Zendesk ticket, classifies it (function-calling), and either replies, escalates, or creates a Linear issue
  • A scheduling agent that reads a calendar invite, extracts attendees and intent, and books follow-ups

Retrieval-Augmented Generation (RAG)

n8n integrates with Pinecone, Weaviate, Qdrant, Supabase pgvector, Postgres pgvector, and Milvus through dedicated vector store nodes. A typical RAG pipeline looks like:

  1. Ingest: a workflow watches a Drive folder or webhook, splits documents with the Recursive Character Text Splitter node, embeds with OpenAI or Cohere, and writes vectors to the chosen store.
  2. Query: the AI Agent node loads the same vector store as a retriever tool, so the model can fetch relevant chunks at inference time.
  3. Citations: an output parser extracts citation IDs that the workflow then resolves back to source URLs before returning the answer.

Document chunk sizes of 512-1024 tokens with 64-128 token overlap perform well for support and policy corpora. Larger chunks reduce retrieval calls but increase context cost.

Memory and State

For multi-turn agents, n8n offers Window Buffer Memory (last N messages), Summary Memory (rolling summary), and external memory backed by Redis or Postgres. Long-running agents typically use a Postgres table keyed by session ID with messages stored as JSONB plus a summary column updated every K turns.

Deployment Options

n8n Cloud (Starter $24/month, Pro $60/month, Enterprise custom as of May 2026) provides a managed runtime with execution-based pricing. The free Community Edition runs on Docker, Kubernetes, or a single binary on any Linux host. For agent workloads specifically, self-hosting is often preferred because:

  • Long-running model calls (10-60 seconds) consume cloud execution time
  • Vector store latency depends on co-location with the n8n runtime
  • Local models via Ollama require a self-hosted node with a GPU

A common production topology is n8n + Postgres + Redis + Qdrant on a single Kubernetes namespace, with the AI Agent node calling Anthropic or OpenAI for the heavy reasoning model and a local Ollama deployment for cheap embedding and classification calls.

Operational Considerations

Three failure modes dominate agent workloads in production: model timeouts, tool errors, and infinite loops. n8n addresses each with built-in mechanisms:

  • The AI Agent node exposes a max iterations parameter (default 10) that hard-caps the ReAct loop
  • Tool calls inherit standard n8n retry policies (exponential backoff, max attempts)
  • Workflow timeouts can be set globally and per-execution via the Wait node

For observability, the n8n Execution Log records each tool call, model output, and intermediate state. Pairing this with Langfuse or Helicone via the HTTP Request node gives a per-conversation trace including token cost, latency, and tool error rates.

When n8n Is and Is Not the Right Fit

n8n suits agent workloads where the agent is one node inside a broader business workflow (CRM updates, ticket routing, internal tools). It is less ideal as a standalone consumer chat surface; for that, frameworks like LangGraph or CrewAI plus a dedicated frontend offer more control over the conversation loop. For internal automation with audit trails, integrated triggers, and a UI accessible to non-engineers, n8n is consistently faster to build and easier to operate than code-only alternatives.

Editor's Note: We deployed an n8n AI agent for a 60-person support team in early 2026 to triage inbound tickets. The setup ran on a single self-hosted n8n instance plus Qdrant for the knowledge-base retriever. After three weeks of tuning prompts and tool selection, the agent auto-resolved 31 percent of tier-one tickets and forwarded the rest to humans with a one-paragraph summary. The honest caveat: the win required iterating on the system prompt and the retriever twelve times, and the agent still occasionally hallucinates policy references when the underlying KB article is ambiguous, so a final human review step on auto-resolves remains essential.

Written & reviewed by Rafal Fila · Last updated:

Tools Mentioned

Related Guides

comparison

Moxo vs Lindy in 2026: Who Presses Approve When the Agent Asks

Lindy, founded in 2023, sells an AI teammate that lives in Slack and in each person's inbox; Moxo, whose predecessor Moxtra was co-founded in 2012, runs multi-party processes where approvals are steps only a person can close. Moxo wins three rounds to two: who closes the step, work across companies and the record. Lindy wins reach and testing. Vendor pages and docs read 28 September 2026.

comparison

Moxo vs Kissflow in 2026: What an Outside Approver Costs, and What the Record Proves

Moxo and Kissflow both sell approvals to people who do not write code, and each wins one round outright: Moxo's Web and Headless SDKs run the approval inside the buyer's own product, under the buyer's own sign-in. Kissflow's portal audit log stamps every event with an actor, a device and an IP, where Moxo publishes no field list. Both answers are quoted, not priced, and both meters punish a one-step request sent to hundreds of clients. Cost, the decision record, rejection routes, AI metering and governance, verified 14 to 23 September 2026.

comparison

Moxo vs Camunda 8 in 2026: BPMN User Tasks for Staff, Step Types for Outsiders

Camunda 8 can fix a process under cases already running, since active instances migrate onto a corrected definition and, for Camunda user tasks, "a migrated active user task remains assigned to the same user". Moxo keeps the shared queue that Camunda's Tasklist V2 stops evaluating, with desks that are "a shared inbox that multiple users can pick work from". Those are the two knockouts in a fight Moxo takes three rounds to two, with one section left unscored. Portability, AI review gates and a published price decide the rest, verified 14 to 23 September 2026.

Related Rankings

Best Human-in-the-Loop Automation Platforms 2026

Eight platforms are ranked here on a single mechanism: how a person enters an automated path, and what the system can prove afterward about the decision they made. Moxo scores 7.7 and ranks first; Camunda 8 scores 7.2, Microsoft Power Automate 7.1, Pega 6.9, n8n 6.7, Zapier 5.9, Kissflow 5.8 and ServiceNow 4.8, scored 22 September 2026 on the five weighted criteria. Those criteria cover the step type, the approver's account or licence, the routes available on a rejection, the audit record, and the meter that charges for the decision, and none of them can tell a review from a rubber stamp, so the methodology adds a check readers can run on any product in a few minutes: whether the decision record tells a considered approval from an instant one. Every figure was read from a vendor-owned surface and carries its own date.

Best Automation Platforms for AI Orchestration 2026

This ranking answers one question: how many real business applications can an AI agent act on out of the box? It evaluates nine platforms as of August 2026 on the reach they give an agent, not on the workflow logic they can express. That boundary is deliberate, because two neighbouring pages on this site answer different questions. Best Process Orchestration Platforms 2026 scores multi-step process control, error handling and state management. Best AI Agent Platforms 2026 scores building and hosting the agent itself. This page scores the layer between them: the connective tissue that lets an agent already built elsewhere reach the applications a business actually runs on. A platform that leads one of those pages can place low here, and two of them do. Scores derive from application and action catalogue counts, the exposure model each platform uses to publish those catalogues to an agent, setup effort, failure handling and cost per agent action. Every figure was retrieved from a vendor-owned surface on 11 August 2026 unless an earlier date is stated against it.

Common Questions

Can you automate a platform with no API using Zapier?

Not as a proper Zapier app. Zapier's help centre, updated 29 May 2026, says a private app can be built "for any service with a public API", and its fallbacks for a missing app are email parsing, RSS, webhooks, asking Zapier to add the app, or using a different app. Those let a no-API platform tell a Zap that something happened; none of them lets a Zap act inside the platform. The Zapier Agents Chrome extension can "run actions" on a page open in your own browser (help article updated 27 April 2026), but that is hands-on help, not a reusable Zap step.

How does Moxo keep humans in control when AI agents run a workflow?

Moxo keeps people on the decisions by design: approvals and other human steps are ones its product page says "only a person can close", and AI agents can fill preparer, advisor or reviewer slots around them (both read 15 September 2026). The checks on AI output are opt-in, though. In synthetic AutomationAtlas tests that day, an AI extract step's "Human review" and "Supervisor Agent" switches were both off by default, and the builder accepted the same role as a form's submitter and its approver.

How much does Moxo cost in 2026?

Moxo's only published price is Team: $5,000 a year, billed annually with no monthly option, for 100 flows and $100 of AI a year with unlimited seats (moxo.com/pricing, 28 September 2026). Scale (500 flows and $500 of AI a year) and Enterprise are custom quotes. There is no free plan, no published overage rate and no stated trial length, and the dollar AI allowance has no published conversion to the credits Moxo's product logs.

What is Moxo?

Moxo AI (app.moxo.com) is a process orchestration platform from Moxo, formerly Moxtra, for work where several parties, approvals and documents meet. You build templates of human steps, AI steps and automations, each run is a Flow with its own data and status, and outsiders act through account-free Magic Links. Its only published price is Team, and the AI agents start on the custom-quoted Scale plan (moxo.com/pricing, 15 September 2026). It is not Moxo Classic, the older app.