Class Workflow
java.lang.Object
com.google.adk.workflow.BaseNode
com.google.adk.workflow.Workflow
- All Implemented Interfaces:
Node
A graph of nodes that is itself a node, so a workflow can go wherever a node can, including in
another workflow. Building a workflow validates its graph and throws
GraphValidationException for a malformed one.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Workflow.Builderbuilder()com.google.common.collect.ImmutableList<Edge> edges()Returns the edges of the workflow's graph.Returns the maximum number of nodes the workflow runs at once, or empty if there is no limit.io.reactivex.rxjava3.core.Flowable<?> Runs the graph from its start node, which handsnodeInputto its successors.Methods inherited from class BaseNode
config, description, inputSchema, name, outputSchema, rerunOnResume, stateSchema, validateOutgoingEdges, waitForOutputModifier and TypeMethodDescriptionconfig()Returns the node's retry policy and execution timeout.Returns what the node does, for humans and for a model that may call it.Optional<com.google.genai.types.Schema> Returns the schema the node's input must match.final Stringname()Returns the name that identifies the node within its graph.Optional<com.google.genai.types.Schema> Returns the schema that the node's output value must match.booleanReturnstrueif a resumed node runs again from scratch, rather than completing with the resuming answer as its output.Optional<com.google.genai.types.Schema> Returns the schema of the state keys that the node and its children may write; a child inherits it unless it declares its own.protected voidvalidateOutgoingEdges(Collection<Edge> edges) ThrowsGraphValidationExceptionif this node cannot serve theedgesthat leave it, such as an edge for a route it never emits.booleanReturnstrueif the node stays re-triggerable until it produces an output or a route, instead of completing when its run completes.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Node
requiresAllPredecessorsModifier and TypeMethodDescriptiondefault booleanReturnstrueif the node runs only once every predecessor has completed, receiving all their outputs keyed by node name, as a fan-in node does.
-
Method Details
-
builder
-
edges
Returns the edges of the workflow's graph. -
maxConcurrency
-
runNode
Runs the graph from its start node, which handsnodeInputto its successors. The output of the sole terminal node that produces one becomes the workflow's output. The returnedFlowablefails withWorkflowConfigurationExceptionif more than one terminal node produces an output, or withGraphValidationException, before any node runs, if a chat agent follows a node other thanStart, the workflow runs inside another one, or an agent that a graph agent node hands off to has a name that cannot be a node name. If the workflow has an output schema, the terminal output is checked against it, and a mismatch fails theFlowablewithIllegalArgumentException.
-