mirror of
https://github.com/run-llama/llama_deploy.git
synced 2026-07-15 13:15:40 -04:00
Nested workflows execution as tool call with distributed services not routed to distributed service instance. #96
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @danielbrown-se on GitHub (Sep 19, 2024).
So i have a 'primary' workflow service that references a number of other agent based workflows that are also deployed as independent services using the llamadeploy system.
In the old llamaagents approach i could wire the 'workflow agent' as a ToolService with metadata, and tool calls would go via the control plane and utilise the distributed service instance to run the tool call.
I dont seem to be seeing this behaviour using the new llamadeploy and workflows approach (but its def possible im missing something obv).
This does add the workflow and i can manually call the run method from a step (or even a tool call); however my use of it is that it is called as a tool in a standard ReAct workflow process. This approach seems to call the sub workflow in the same service process as the primary workflow, I expected that it would work in a similar fashion to the old ServiceTool approach where a new task would be created for the tool call to be executed by the 'tool service' (which for all intents and purposes in this example is another deployed agent being used as a tool).
Could you confirm that nested workflows are expected to be run in process or should these generate new tasks in the same way the old 'TOOL_CALL' messages worked with ToolServices.
Appologies if I have misunderstood or am presuming features and thanks for any help you may be able to offer.
Danny
@logan-markewich commented on GitHub (Sep 19, 2024):
Hey Danny,
Yea, the entire UX has changed quite a bit from llama-agents to llama-deploy. I should probably just delete the extra services (I thought I'd find a use for them, but workflows are so general, I don't really see the value currently)
If you want replicate the experience of the tool service, I would write a workflow for a react agent, and a workflow for calling tools.
Luckily for us, we have an example of a react agent: https://docs.llamaindex.ai/en/stable/examples/workflow/react_agent/
To replicate the tool service, I would write a workflow like
Then in the agent example, we can modify the tool calling step to use this workflow
Now, if both the tool workflow and agent are deployed, it will automatically make calls to the remote tool workflow