Skip to content
Discussion options

You must be logged in to vote

SequentialAgent runs every sub-agent in order. There is no built-in "stop the rest" flag.

Patterns that work:

  • Put the condition in shared session state. Don't use SequentialAgent. Use a LoopAgent (or a small custom BaseAgent) that checks the state after each step and returns.
  • after_agent_callback on a sub-agent can set escalate / skip remaining work if you handle that in a parent you wrote. The stock sequential runner will still schedule the next name.
  • Split into two sequentials and only invoke the second from an LLM / custom agent when the condition is false.

I would not sprinkle if state['stop']: return into every sub-agent and still wrap them in SequentialAgent. The parent will call …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by llalitkumarrr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants