Hi everyone. I’m new to building workflows in n8n.
I need a little help finishing my workflow.
I created an AI agent that should accept package requests from clients and send them to Google Sheets, as well as answer client questions. I want to delegate tasks between agents.
So, I made a main AI agent whose job is to understand the client’s request and forward it to the agent that can handle it.
If it’s a question, the Consultant agent should respond.
If it’s a shipping request, the Package Manager agent should handle it.
But I can’t figure out how to make the main AI agent send tasks to the other two agents.
I’ve tried many different options, but nothing has worked so far.
Instead of using multiple agents in your main workflow, set it up with sub workflows. Use a system prompt to tell the main agent when to use each sub workflow tool. Here’s an example.
u can use a switch, between the main and subs, sure need to get the main ai agent to format the data out structed ie use json by using "Require Specific Output Format
" tick that box in the ai agent, specify the json example by selecting the plus on output parser and picking Structured Output Parser json, provide an example json with the data and a field for the switch and u should be able to only process depending on the first ai agent out.
Hope that makes sense, or you could have a main agent which uses tools, to call subworkflows which have ai agents in? up to you
Hi @rbreen . I tried doing as you suggested, but I keep encountering an error every time. I watched many guides before writing here and also tried to solve this problem with ChatGPT, but it didn’t work. I connected the “consultant” tool to the AI agent, but I can’t understand why the message “How do I send a package?” isn’t being passed on to the other workflow (consultant).