Class BaseNode

java.lang.Object
com.google.adk.workflow.BaseNode
All Implemented Interfaces:
Node
Direct Known Subclasses:
BaseAgent, JoinNode, Workflow

@Experimental public abstract class BaseNode extends Object implements Node
Base class for nodes in a workflow graph. It is meant for the framework's own nodes; to write a node, implement Node. Subclasses implement Node.runNode(Context, Object), and the framework turns each emission into an Event.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    BaseNode(String name, String description)
    Creates a node with every property other than its name and description at its default.
    protected
    BaseNode(String name, String description, boolean rerunOnResume, boolean waitForOutput, NodeConfig config, @Nullable com.google.genai.types.Schema inputSchema, @Nullable com.google.genai.types.Schema outputSchema, @Nullable com.google.genai.types.Schema stateSchema)
    Creates a node; each parameter sets the Node property of the same name.
  • Method Summary

    Modifier and Type
    Method
    Description
    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 String
    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.
    boolean
    Returns true if 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 declaring the state keys the node uses.
    boolean
    Returns true if 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, wait

    Methods inherited from interface Node

    requiresAllPredecessors, runNode
    Modifier and Type
    Method
    Description
    default boolean
    Returns true if the node runs only once every predecessor has completed, receiving all their outputs keyed by node name, as a fan-in node does.
    io.reactivex.rxjava3.core.Flowable<?>
    runNode(Context context, @Nullable Object nodeInput)
    Runs the node on nodeInput, the output it receives from its predecessors.
  • Constructor Details

    • BaseNode

      protected BaseNode(String name, String description)
      Creates a node with every property other than its name and description at its default.
    • BaseNode

      protected BaseNode(String name, String description, boolean rerunOnResume, boolean waitForOutput, NodeConfig config, @Nullable com.google.genai.types.Schema inputSchema, @Nullable com.google.genai.types.Schema outputSchema, @Nullable com.google.genai.types.Schema stateSchema)
      Creates a node; each parameter sets the Node property of the same name.
  • Method Details

    • name

      public final String name()
      Description copied from interface: Node
      Returns the name that identifies the node within its graph.
      Specified by:
      name in interface Node
    • description

      public String description()
      Description copied from interface: Node
      Returns what the node does, for humans and for a model that may call it.
      Specified by:
      description in interface Node
    • rerunOnResume

      public boolean rerunOnResume()
      Description copied from interface: Node
      Returns true if a resumed node runs again from scratch, rather than completing with the resuming answer as its output.
      Specified by:
      rerunOnResume in interface Node
    • waitForOutput

      public boolean waitForOutput()
      Description copied from interface: Node
      Returns true if the node stays re-triggerable until it produces an output or a route, instead of completing when its run completes.
      Specified by:
      waitForOutput in interface Node
    • config

      public NodeConfig config()
      Description copied from interface: Node
      Returns the node's retry policy and execution timeout.
      Specified by:
      config in interface Node
    • inputSchema

      public Optional<com.google.genai.types.Schema> inputSchema()
      Description copied from interface: Node
      Returns the schema the node's input must match.
      Specified by:
      inputSchema in interface Node
    • outputSchema

      public Optional<com.google.genai.types.Schema> outputSchema()
      Description copied from interface: Node
      Returns the schema that the node's output value must match. The content of a message-as-output event is not checked against this schema.
      Specified by:
      outputSchema in interface Node
    • stateSchema

      public Optional<com.google.genai.types.Schema> stateSchema()
      Description copied from interface: Node
      Returns the schema declaring the state keys the node uses. Child nodes inherit it unless they declare their own.
      Specified by:
      stateSchema in interface Node