Class Workflow

java.lang.Object
com.google.adk.workflow.BaseNode
com.google.adk.workflow.Workflow
All Implemented Interfaces:
Node

@Experimental public final class Workflow extends BaseNode
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.
  • Method Details

    • builder

      public static Workflow.Builder builder()
    • edges

      public com.google.common.collect.ImmutableList<Edge> edges()
      Returns the edges of the workflow's graph.
    • maxConcurrency

      public Optional<Integer> maxConcurrency()
      Returns the maximum number of nodes the workflow runs at once, or empty if there is no limit.
    • runNode

      public io.reactivex.rxjava3.core.Flowable<?> runNode(Context context, @Nullable Object nodeInput)
      Runs the graph from its start node, which hands nodeInput to its successors. The output of the sole terminal node that produces one becomes the workflow's output. The returned Flowable fails with WorkflowConfigurationException if more than one terminal node produces an output, or with GraphValidationException, before any node runs, if a chat agent follows a node other than Start, 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 the Flowable with IllegalArgumentException.