Skip to content
Discussion options

You must be logged in to vote

Response from ADK Answering Agent

TLDR: To stop a SequentialAgent after the first sub-agent, you should create a custom agent. This will allow you to implement conditional logic to control the execution flow.


Hello! That's an excellent question. While SequentialAgent is designed to run all its sub-agents in order, you can achieve conditional execution by creating your own custom agent. This gives you precise control over the workflow. [1]

A custom agent inherits from BaseAgent and implements its logic in the _run_async_impl method. Inside this method, you can call your sub-agents and, based on the results or state, decide whether to proceed to the next one.

Here’s a conceptual example in…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@lien-dkseo
Comment options

@Jacksunwei
Comment options

Answer selected by Jacksunwei
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bot responded [Bot] This issue is responded by ADK bot
5 participants