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:
- 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.
- Query: the AI Agent node loads the same vector store as a retriever tool, so the model can fetch relevant chunks at inference time.
- 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.
Tools Mentioned
n8n
Workflow automation for technical teams
Workflow AutomationSupabase
Open-source Firebase alternative with PostgreSQL, auth, Edge Functions, and vector embeddings
ETL & Data PipelinesCrewAI
Open-source Python framework for building and orchestrating multi-agent AI systems
AI Agent PlatformsLangflow
Visual low-code platform for building AI agents and RAG applications with drag-and-drop components
AI Agent PlatformsRelevance AI
No-code AI agent builder for business tasks with multi-step workflows, knowledge base integration, and team collaboration.
AI Agent PlatformsActivepieces
No-code workflow automation with self-hosting and AI-powered features
Workflow AutomationRelated Guides
Client Portals vs Workflow Orchestration Platforms: What Changes When External Parties Act Inside a Process
What changes when a client or supplier has to act inside your process, not just watch it? This guide compares four client portals with four orchestration platforms on how outsiders get in, whether you pay for them and what the audit log records, from vendor sources read 14 and 15 September 2026.
Moxo vs Zapier in 2026: Human Approval Steps, External Participants and Pricing
Moxo and Zapier both put a person in front of an automated decision, from opposite ends: Moxo builds the process out of human steps and attaches AI, while Zapier pauses an automation for a reviewer through its Human in the Loop app. This guide compares approvers, rejection, AI approval, audit logs, governance and pricing, verified 14 and 15 September 2026.
Keystroke vs n8n in 2026: Agent-Built TypeScript vs the Visual Canvas
Keystroke, launched in July 2026 by Y Combinator W24 company Sprint Labs, is a code-first automation platform where AI coding agents write workflows as TypeScript in the user's repository. n8n, founded in 2019, is the most widely deployed source-available visual workflow platform, with 200,000+ users and a $2.5 billion valuation. This comparison covers the agent-authored versus canvas building models, durable execution, licensing (Elastic License 2.0 vs the Sustainable Use License), verified July 2026 pricing including Keystroke's usage metering, and the maturity gap between a days-old platform and an established ecosystem.
Related Rankings
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.
Best Durable Workflow Engines for Production in 2026
A ranked list of the best durable workflow engines for production deployments in 2026. Durable workflow engines persist execution state to a database so that long-running workflows survive process restarts, deployments, and infrastructure failures. The ranking covers Temporal, Prefect, Apache Airflow, Camunda, Windmill, and n8n. Tools were evaluated on production reliability, developer experience, scalability, open-source health, and documentation quality. The shortlist intentionally mixes code-first engines (Temporal, Prefect, Airflow) with hybrid visual platforms (Camunda, Windmill, n8n) to reflect how production teams actually choose workflow engines in 2026.
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.
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.
How much does Moxo cost in 2026?
Moxo's only published price is Team: $500 a month in the monthly view or $5,000 a year in the yearly view, for 100 flows and $100 of AI a year with unlimited seats (moxo.com/pricing, 15 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.