How do I run a longrunning function tool within a Sequential/Loop Agent? #3545
Replies: 3 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: The Hello! That's a great question about handling asynchronous operations within a When a The intended architecture for this scenario involves your client application managing the "pending" state. Here is a breakdown of the recommended workflow:
A great reference for this pattern is the A2A Human-in-the-Loop Sample Agent [1]. In this example, a root agent delegates an approval task. It receives a "pending" response and the workflow pauses. A human manager then interacts with the system to provide the approval, which then allows the process to continue. While this is different from having the I hope this helps clarify the designed behavior and provides a path forward! [1] A2A Human-in-the-Loop Sample Agent - https://github.com/google/adk-python/blob/main/contributing/samples/a2a_human_in_loop/README.md |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Arvind-Raman-1 , it is likely that you are missing the resumablity config setting in the App level, see: https://google.github.io/adk-docs/runtime/resume/#add-resumable-configuration |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m building a SequentialAgent with two sub-agents (A → B). One of A’s actions needs manual approval before it runs, so I wrapped it with a long-running function tool that returns a pending state until I approve/deny it.
The issue: when Sub-agent A hits the approval step and returns pending, the SequentialAgent doesn’t pause. It just keeps going and executes Sub-agent B anyway. I only want B to run after A finishes and yields its approved event.
I’ve tried catching the pending status inside run_async, but every approach I’ve tried either breaks the sequence or exits the entire flow.
Has anyone found a clean way to force the SequentialAgent to actually wait for a sub-agent’s long-running tool to resolve before continuing?
Beta Was this translation helpful? Give feedback.
All reactions