A bank's document pipeline in Google's Agent Development Kit (ADK) must always run extract → validate → summarise, in that order. It is built as an LlmAgent coordinator with the three agents as sub_agents and an instruction to use them in order, but traces show the validator is sometimes skipped. What is the best fix?
Show the answer and explanation
Correct answer: D, Run them under a SequentialAgent, which executes its sub-agents in a fixed order without an LLM choosing, and pass results through session state with each agent's output_key.
Explanation Agent Frameworks
Google's Agent Development Kit (ADK) offers two ways to coordinate sub-agents:
LlmAgent with sub_agents | Workflow agents | |
|---|---|---|
| Who picks the next agent | the model, by transferring control to a sub-agent | code: the agent type fixes the flow |
| Order guaranteed | no | yes |
| Types | – | SequentialAgent (in order), ParallelAgent (concurrently), LoopAgent (repeat) |
"Use them in order" is still a request to the model, so a step can be skipped whenever the model decides it is unnecessary. A SequentialAgent runs its sub-agents one after another, every time, without an LLM making the orchestration decision; the sub-agents themselves can still be LLM agents.
Data moves through session state: give the extractor output_key="extracted" so its final response is saved to state["extracted"], and reference {extracted} in the validator's instruction; do the same for the summariser.
Why the alternatives fail:
- Temperature 0 makes decoding greedier but does not turn an LLM routing decision into a guarantee.
ParallelAgentruns its sub-agents concurrently, so the summariser cannot wait for validated data. Parallel branches also share session state, so they need distinct keys.LoopAgentruns all its sub-agents in order on each iteration and repeats until a maximum number of iterations is reached or a sub-agent escalates; three iterations would run the pipeline three times (one iteration would merely imitate aSequentialAgent). It suits generate-and-critique loops.
Recent ADK 2.x releases deprecate these three classes (they still run) in favour of a graph-based Workflow, whose edges fix the order in the same way. The principle is unchanged: when order is a requirement, enforce it in code rather than in a prompt.
Interview tip: "deterministic where you can, LLM-driven where you must" is a good one-line summary.