workflows.fit
Back to n8n workflows
n8n templateFreeBy Robert Breen

Beginner manager agent with sub-agent tools

This guide walks you through building an intelligent AI Agent in n8n that routes tasks to the appropriate sub-agent using the new @n8n/n8n-nodes-langchain agent framework. You’ll create a Manager Agent that evaluates ...

AILangchainCore NodesLm Chat Open AiMemory Buffer WindowAgent ToolAgent
Loading interactive preview...

Template notes

This guide walks you through building an intelligent AI Agent in n8n that routes tasks to the appropriate sub-agent using the new @n8n/n8n-nodes-langchain agent framework. You’ll create a Manager Agent that evaluates user input and delegates it to either an Email Agent or a Data Agent—each with its own role, memory, and OpenAI model.

This is perfect for use cases where you want a single entry point but intelligent branching behind the scenes.

---

🔧 Step 1: Set Up the Manager Agent

Start by dragging in an Agent node and name it something like ManagerAgent. This agent will act as the “brain” of your system, analyzing the user's input and determining whether it should be handled by the email-writing sub-agent or the data-summary sub-agent.

Open the node’s settings and paste the following into the System Message:

You are an AI Manager that delegates tasks to specialized agents. Your job is to analyze the user's message and decide whether it requires:

An EmailAgent for writing outreach, follow-up, or templated emails, or