How I Built a Multi-Agent AI System in n8n Using Sub-Workflows example

Hey,

So I created this to help explain,

This is my main agent, which has access to subworkflows with ai agents in them. it acts like the brain and decides what sub-agent should handle the request.

next I connect the other agents via tools on the main agent, each call goes to these:

  • ResearchAgent
    this one just calls another AI agent workflow with specific instructions for doing research (e.g. “look up current social media trends for skincare” or “explain how RAG works”).
    the main agent passes along the original question + a clear goal so the sub-agent knows what to do.
  • Agent Confirm
    this has access to admin tools. its sub-agent can run workflows like my GitHub backup.
    the instruction is always explicit, like:
    "Run the GitHub backup workflow in agent confirm"
    the agent doesn’t guess — it only does what it’s told.
  • DocumentAgent
    this one is for working with files. it looks up the filename on Google Drive, pulls the doc, then stores it in Supabase for RAG-style access.
    it’s paired with another AI agent that gets instructions like:
    "Analyze this invoice and return the total due and due date."
    or
    "Answer: What company sent this invoice, and what is the payment method listed?"

:repeat: all sub-agents only act based on clear input passed to them — no assumptions.
:bulb: the main agent always gives specific context and goal for each task.

they each live in their own subworkflow, with their own langchain agent + tool setup.

there kick off different things like:

  • ResearchAgent sending structured data back
  • Agent Confirm executing workflows
  • DocumentAgent retrieving docs + answering questions on them

the main agent just delegates → waits → replies.
never acts alone. just routes tasks to the right tool and returns the output once it’s all done.

This isn’t complete but works to show how you can structure them also :slight_smile:

Hope this helps.

3 Likes