Package-level declarations
Types
The base class for units of work in a workflow graph. A Workflow is itself a node, so graphs nest, and every agent is one too.
Decides for each input whether a FunctionNode run asks the user to approve it, set through FunctionNode.Builder.requireConfirmation. It runs on the workflow's coroutine before the body, so it must not block, and an exception it throws fails the run.
Thrown by com.google.adk.kt.agents.Context.runNode when the dispatched child fails: error is the child's failure and errorNodePath the path of the node that failed.
A chain of edges for Java callers, positioned at a node. EdgesBuilder.from starts a chain, and each call adds the same edges as the edges DSL function of the same name and continues from its target.
A block that declares edges or routes on a T builder. In Kotlin, pass a lambda with the builder as its receiver. In Java, pass a lambda that takes the builder as an argument, with no Unit to return.
A workflow Node backed by a suspending function that returns an O and may emit Events. An input that does not decode as I throws NodeInputValidationException; an output that is not an O or a Content, has no JSON form, or fails an explicit schema throws IllegalArgumentException.
A workflow graph failed validation. Raised when the graph is built, not when it runs.
The body of a FunctionNode set through FunctionNode.Builder.body. A Java body is blocking code, so it does not run on the dispatcher of the coroutine that collects the run: it runs on the dispatcher passed to FunctionNodes, by default a view of Dispatchers.IO without its thread limit, so it may block, for example to wait for a child or for InteropContextView.emit, without stalling the workflow. A waiting body holds its thread: the default starts one thread per body that waits at the same time, and a dispatcher an app passes needs a free thread for every such body, so a single-threaded or small bounded one can hang the run. Bound a fan-out with the maxParallelWorkers of parallelOf, or pass a bounded dispatcher when bodies wait for nothing.
Base class for node failures raised by the workflow runtime, such as NodeTimeoutException. A node can also throw this class or a subclass it defines; error events and RetryConfig.exceptions name each failure by its simple class name. List it in RetryConfig.exceptionClasses to retry this class and every subclass.
Nodes grouped by nodes(...) or a fan-out then, which EdgesBuilder.joinTo connects to a JoinNode.
A chain of edges for Java callers, positioned at a NodeGroup from a fan-out or EdgesBuilder.from.
Raised when a node's runtime input fails validation.
A node exceeded its configured timeout. An ordinary exception, so a timed-out node is still eligible for retry.
An edge started by EdgesBuilder.on, which has a source and its routes but no target yet. EdgesBuilder.then completes it.
A chain of edges for Java callers, positioned at a routed edge started by EdgeChain.on; then completes it.
A node's request for user input, which pauses the workflow until a matching response arrives.
How a node is retried when it raises.
A value on a workflow edge, and the value a node emits to select which of its outgoing edges are followed. An edge fires when the value it carries matches one the node emitted.
The receiver of an EdgesBuilder.route block, which maps each route the source node may emit to a target node, written on("billing") then billing or "billing" then billing. Mapping one route to several nodes fans out on that route.
A routing-map entry started by RouteMapBuilder.on whose routes have no target yet. then completes it.
Routes that select a single edge, which fires once when its source emits any of them. Separate edges to the same target would fire once each. Build one with anyOf(...) in the workflow DSL.
Marks where a graph starts. Never runs: the scheduler seeds its successors directly.
A graph of nodes, and a Node itself so graphs nest, assembled and validated on construction (throwing GraphValidationException if malformed) and run concurrently as predecessors finish.
Thrown when a workflow or node configuration is invalid.
Functions
Returns a workflow node that runs this tool as a fixed step: the predecessor's output becomes the tool's arguments, and the tool's result becomes the node's output.
Returns the edges declared by graphDefinition for a Workflow; workflow builds both in one step.
Creates a FunctionNode that runs block, which uses context.state, context.updateState and requestInput. An edge into it builds only if the predecessor's output schema fits its input schema; inferred output schemas require every field, inferred input schemas only fields without defaults.
Creates a FunctionNode as the other node overload does, asking the user to approve a run only when requireConfirmation returns true for its decoded input.
Wraps node so it runs concurrently on each item of a list input and returns the results in input order. node's configuration and schemas apply to each item's run; the fan-out node declares no input or output schema. Java callers use FunctionNode.parallelOf.
Returns a node that runs node once per item of a list input concurrently and outputs the items' outputs as a list in input order. A text-only Content input, unless node is a function node taking Content, is read as JSON so a JSON list fans out; text that is not JSON arrives as a string. Any other non-list input runs as a single item.
Creates a FunctionNode that runs block concurrently on each item of a list input and returns the results as a List of O in input order. A text-only Content input, unless I is Content, is read as JSON so a JSON list fans out. Any other non-list input runs as one item.
Creates a fan-out FunctionNode as the other block-form parallelNode does, asking to approve an item's run only when requireConfirmation returns true for it. The predicate runs on each item's run with no answer yet; once the item has asked, the answer decides. A rejected item outputs as in node.
From a node's body, asks the user for input once per run and ends it. With rerunOnResume = true the body reruns and reads the answer from ctx.resumeInputs[interruptId]; ctx.resumeInputs[id] ?: requestInput(id) asks again on a null answer responseSchema allows. Otherwise the answer, checked against any responseSchema, is the node's output.
Builds a Workflow from the edges graphDefinition declares.