Build Your AI Team with n8n: A Practical Guide to Multi-Agent Systems

Use n8n to orchestrate a multi-agent workflow where a Supervisor routes requests to General, Tool, and RAG specialist Agents.
This article walks through building a Multi-Agent System using n8n and Google Gemini. A Supervisor Agent analyzes incoming requests and routes them to three specialist sub-Agents: a General Agent for everyday Q&A, a Tool Agent for calculations, and a RAG Agent that retrieves company data from a Pinecone vector database. n8n's Call n8n Workflow Tool node mounts each sub-Agent as a callable tool, while Gemini handles both conversational reasoning and text embedding. The result is a clearly structured, easily extensible low-code architecture for AI applications that need to handle diverse task types.
What Is a Multi-Agent System?
AI Agents are nothing new — they can understand user queries, invoke the right tools, generate answers, and even take concrete actions. But when an application needs to handle multiple types of tasks simultaneously, a single Agent often falls short. This is exactly where Multi-Agent Systems come in: they break different tasks down across dedicated Agents, each of which works within the same system in a collaborative way.
Here's a concrete example: an application might receive three distinct types of questions — general knowledge questions, math-related questions, and questions about a company's internal documents. Rather than forcing one all-purpose Agent to handle everything, you can create three specialized Agents, each focused on what it does best. This model of "professional specialization, coordinated collaboration" is the core idea behind multi-agent architecture.
The Central Role: How the Supervisor Agent Orchestrates
The first critical question in a multi-agent system is: who handles a given user request? The answer is a Supervisor Agent, which plays the role of coordinator.

When a user request enters the system, the Supervisor Agent first analyzes it, determines which category it belongs to, and then hands it off to the most appropriate specialist Agent. Once that Agent finishes processing, it returns the result to the Supervisor, which then formats the answer and delivers it back to the user. The entire flow looks like this:
- User request enters the system
- Supervisor Agent analyzes the request
- Selects and invokes the most suitable specialist Agent
- Specialist Agent processes the request and returns the result
- Supervisor Agent formats the answer and replies to the user
The strength of this architecture lies in its clarity of responsibility — each Agent only needs to focus on its own domain, while the complexity of routing is centralized in the Supervisor layer.
Building It with n8n + Gemini
In practice, this system is built around two key components: n8n handles workflow orchestration, deciding when to call which Agent and how to connect and manage workflows; Gemini provides the LLM intelligence, handling request comprehension, reasoning, and answer generation.

The complete system consists of three specialist sub-Agents and one Supervisor Agent, each corresponding to the scenarios discussed above.
The Three Specialist Sub-Agents
General Agent: Handles general user questions. Built using "when executed by another workflow" as the trigger node, connected to an AI Agent node, with Google Gemini chat model as the LLM.
Tool Agent: Specializes in math and calculation questions. It extends the base AI Agent node with a Calculator Tool, and is responsible for delivering results whenever a calculation-related question comes in.
RAG Agent: Handles company-related questions. This is the most structurally complex of the three — it connects to a Pinecone vector database as a tool, where company documents are pre-stored in vector form.

Inside the RAG Agent, Google Gemini's embedding model handles the conversion of natural language into vectors. When a company-related question enters the workflow, the system retrieves matching vector data from Pinecone based on the query, then passes it to the Gemini model to generate the final answer. This is RAG (Retrieval-Augmented Generation) working exactly as intended.
What is RAG? RAG (Retrieval-Augmented Generation) is a technical paradigm that combines external knowledge bases with large language models. The core idea is to dynamically retrieve relevant document chunks at inference time rather than "baking" all knowledge into model parameters — then feed those retrieved results as context to the LLM for answer generation. This approach offers two key benefits: it addresses the knowledge cutoff problem in LLMs, and it allows models to access private or internal proprietary data without retraining or fine-tuning. Vector databases like Pinecone serve as the "memory store" — documents are pre-converted into high-dimensional vectors and stored, and at query time the system vectorizes the question using the same embedding model, then finds the most relevant document chunks via similarity search (e.g., cosine similarity), before passing them to the LLM for a synthesized response.
Assembling the Supervisor Agent
The Supervisor Agent's workflow is named "multi-agent assistant". Its trigger node is set to "when chat message received", it also uses Gemini as the LLM, and it's configured with a Memory module to maintain conversation context.
The key step is tool configuration: using n8n's Call n8n Workflow Tool node, each of the three sub-Agent workflows is mounted as a callable tool. This gives the Supervisor the ability to invoke the General, Tool, and RAG Agents on demand.
A note on the tools used: n8n is an open-source workflow automation platform that supports visual drag-and-drop orchestration and can be self-hosted. Unlike SaaS tools such as Zapier, n8n lets developers connect services and APIs through "Nodes" and has native built-in support for AI Agents — including AI Agent nodes, LLM model nodes, vector store nodes, and the Call n8n Workflow Tool node used in this guide. The latter is the key to multi-agent architecture: it allows one workflow (the Supervisor) to mount another workflow (a sub-Agent) as a callable tool, enabling a layered Agent scheduling system without writing code. Gemini is Google DeepMind's multimodal large language model series, offering both a Chat Model for conversational reasoning and an Embedding Model for text vectorization — serving as the "brain" and the "text-to-searchable-vector" engine in this setup, respectively.
Testing It Out: Three Question Types, Three Routes
Once the system is assembled, three scenarios can be validated:
- When a general question about Python is asked, the Supervisor routes it to the General Agent, and the Gemini model generates a direct answer.
- When a calculation question is posed, the Supervisor invokes the Tool Agent, which uses the mounted Calculator tool to compute the result.
- When a company-related question comes in, the Supervisor calls the RAG Agent, which retrieves data from the Pinecone vector store before returning an answer.

To recap the complete architecture: user requests enter the system via a chat trigger, the Supervisor Agent analyzes the input — general questions go to the General Agent, math questions go to the Tool/Calculator Agent, and company questions go to the RAG Agent. All orchestration is handled by n8n, and every Agent's intelligence is powered by Gemini.
Closing Thoughts: Specialization and Coordination Are Everything
The value of a multi-agent system doesn't lie in the number of Agents, but in giving each one a clear, well-defined responsibility and coordinating them in an orderly fashion through a Supervisor Agent. The General Agent, Tool Agent, and RAG Agent in this example each connect to different tools and data sources, together forming a scalable, collaborative system.
For developers looking to get hands-on, n8n's visual workflow editor dramatically lowers the barrier to orchestration. Combined with Gemini's LLM capabilities and Pinecone's vector retrieval, you can quickly spin up your own "AI team." As the variety of tasks grows, you simply add new specialist Agents and mount them to the Supervisor — and the entire system scales smoothly.
Related articles

Felix Rieseberg Personal Homepage
Felix Rieseberg's personal homepage sparks attention on Hacker News. This article covers the Slack engineer's technical background, the rise and fall of nativefier, and the value of a developer homepage as a tech calling card.

@ai-sdk/vue 3.0.306 Patch Release Syncs with [email protected] Update
@ai-sdk/vue 3.0.306 released, synced with [email protected]. A routine patch release for the Vercel AI SDK ecosystem with no public API changes; the Vue adapter layer stays version-aligned with the core package.

Gemini 4 Argon API Launches: The Era of Million-Token Output Begins
Google launches Gemini 4 Argon with sparse MoE architecture, up to 1M output tokens, and a 68.90% Vals Index score, available across API, AI Studio, and the Gemini app.