Package com.google.adk.workflow
Class Workflow.Builder
java.lang.Object
com.google.adk.workflow.Workflow.Builder
- Enclosing class:
- Workflow
Builder for
Workflow. Only the name is required. Unlike other nodes, a workflow reruns
from scratch when resumed unless rerunOnResume turns that off.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the workflow.config(NodeConfig config) description(String description) edges(Consumer<? super EdgesBuilder> graphDefinition) Sets the edges thatgraphDefinitionadds to a newEdgesBuilder.inputSchema(@Nullable com.google.genai.types.Schema inputSchema) maxConcurrency(int maxConcurrency) Sets the maximum number of nodes to run at once, which must be at least 1.outputSchema(@Nullable com.google.genai.types.Schema outputSchema) rerunOnResume(boolean rerunOnResume) stateSchema(@Nullable com.google.genai.types.Schema stateSchema) waitForOutput(boolean waitForOutput)
-
Method Details
-
name
-
edges
-
edges
-
edges
Sets the edges thatgraphDefinitionadds to a newEdgesBuilder.For example:
.edges(g -> g.fromStart().chain(a, b)). -
description
-
maxConcurrency
Sets the maximum number of nodes to run at once, which must be at least 1. A workflow without one has no limit. -
rerunOnResume
-
waitForOutput
-
config
-
inputSchema
@CanIgnoreReturnValue public Workflow.Builder inputSchema(@Nullable com.google.genai.types.Schema inputSchema) -
outputSchema
@CanIgnoreReturnValue public Workflow.Builder outputSchema(@Nullable com.google.genai.types.Schema outputSchema) -
stateSchema
@CanIgnoreReturnValue public Workflow.Builder stateSchema(@Nullable com.google.genai.types.Schema stateSchema) -
build
Builds the workflow.- Throws:
IllegalArgumentException- if the workflow's name or the name of a node in its graph is empty or contains/,@, or.GraphValidationException- if the graph is malformed, for example ifStartcannot reach one of its nodes
-