ParallelAgent
A shell agent that runs its sub-agents in parallel in an isolated manner.
This approach is beneficial for scenarios requiring multiple perspectives or attempts on a single task, such as:
Running different algorithms simultaneously.
Generating multiple responses for review by a subsequent evaluation agent.
Constructors
Types
Fluent builder for ParallelAgent, provided primarily for Java callers. Any property left unset falls back to the same default as the constructor.
Properties
List of callbacks to run after the agent executes.
List of callbacks to run before the agent executes.
The node's retry policy and execution timeout.
What the node does, for humans and for a model that may call it.
When true, the run fails with IllegalArgumentException if this agent transfers to its parent, and the next user turn after the parent transfers to this agent goes to an earlier agent, usually the parent, instead of staying here. Set this on utility sub-agents the parent calls and returns from (translators, summarizers, classifiers); leave it false for sub-agents that should keep handling follow-up turns (e.g. billing, support).
When true, the run fails with IllegalArgumentException if this agent transfers to a peer under the same parent. Typically set together with disallowTransferToParent on one-shot utility agents.
Checks the input as JSON; the node receives the checked value unless it takes a Content. An edge fails to build when the predecessor's output schema admits values this one rejects; what that schema leaves open (no type, undeclared keys, undescribed ARRAY items) is checked at run time.
Validates the output value the node emits with the same rules, and the checked value is the output. A value set with Context.setOutput and a message-as-output event's content are not checked.
Whether the node runs only once every predecessor has completed, receiving all their outputs keyed by node name. A fan-in node overrides this to true.
On resume, whether to run the node again from scratch rather than completing it with the resuming answer as its output.
Declares the state keys the node uses. Child nodes inherit it unless they declare their own.
Whether the node stays re-triggerable until it produces an output or a route, instead of completing when runNode returns. A node that never produces either then waits forever, which is a graph-authoring error.
Functions
Runs the node and normalizes each raw emission of runNode into an Event: null and Unit are skipped, a RequestInput becomes an adk_request_input interrupt event, an Event keeps its content and has its output validated, and any other value becomes the output.
Public entry point for executing the agent asynchronously (text-based).
Runs this agent over a live (bidirectional streaming) connection, taking the user's input from the LiveRequestQueue on parentContext; closing the queue ends the run. Only a context the runner opens for a live run, or one a live parent agent passes down, carries that queue.
Runs this agent as a graph node by driving its runAsync lifecycle, so an agent placed in a workflow graph executes exactly as it would under a runner. Its events are forwarded as the node's output and its author is tracked; the node runner stamps each event's path.