Hello everyone. I'm new to building workflows in callin.io.
I need some assistance completing my workflow.
I've set up an AI agent designed to receive package requests from clients and log them into Google Sheets, as well as address client inquiries.
My goal is to delegate tasks among different agents.
So, I've created a main AI agent responsible for understanding the client's request and routing it to the appropriate agent.
If the request is a question, the Consultant agent should provide the answer.
If it's a shipping request, the Package Manager agent should handle it.
However, I'm struggling to figure out how to make the main AI agent dispatch tasks to the other two agents.
I've explored various approaches without success.
I would greatly appreciate your help.
Hi there!
Instead of utilizing multiple agents in your primary workflow, consider structuring it with sub-workflows. You can employ a system prompt to guide the main agent on when to engage each sub-workflow tool. Here's an illustration:
The approach detailed in this post leverages a sub-workflow as a tool. How to Pass Subflow Outputs Back to the Main Flow: Resolving Return Value Issues - #2 by rbreen
If this solution addresses your query, please mark it as the solution to assist others.
You can utilize a switch node to manage the flow between your main and sub-workflows. Ensure your primary AI agent formats the data into a structured JSON format by enabling the "Require Specific Output Format" option. Within this setting, specify your JSON example by clicking the plus icon next to the output parser and selecting "Structured Output Parser JSON." Provide a sample JSON containing the necessary data and a field for the switch. This setup will allow you to process data conditionally based on the output of the initial AI agent.
Hopefully, that explanation is clear. Alternatively, you could have a main agent that employs tools to invoke sub-workflows containing AI agents. The choice is yours.
Hi there. I attempted the suggested approach, but I'm consistently running into an error. I reviewed several tutorials and even tried to resolve this with ChatGPT, without success. I've linked the 'consultant' tool to the AI agent, but I'm unsure why the message 'How do I send a package?' is not being transmitted to the other workflow (consultant).
Thank you, but this method doesn’t quite work.
Hi there!
In your sub-workflow, please use the following as the prompt. Configure it as defined below, and pass in {{json.query}}.
If this doesn't resolve the issue, kindly share both of your callin.io workflows within a code block here on the forum. This will greatly assist in troubleshooting.
Robert
Could you please demonstrate that? I didn't quite grasp your explanation.
Here’s a video. Copy the sub workflow and paste it into the workflow tool.