Interface Node

All Known Implementing Classes:
BaseAgent, BaseNode, JoinNode, LlmAgent, LoopAgent, ParallelAgent, PlannerAgent, RemoteA2AAgent, SequentialAgent, Start, Workflow

public interface Node
A unit of work in a workflow graph. Node names must be unique within a graph. Every member except name() and description() is experimental, so implementing this interface is too.
  • Method Summary

    Modifier and Type
    Method
    Description
    default NodeConfig
    Returns the node's retry policy and execution timeout.
    default String
    Returns what the node does, for humans and for a model that may call it.
    default Optional<com.google.genai.types.Schema>
    Returns the schema the node's input must match.
    Returns the name that identifies the node within its graph.
    default Optional<com.google.genai.types.Schema>
    Returns the schema that the node's output value must match.
    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.
    default boolean
    Returns true if a resumed node runs again from scratch, rather than completing with the resuming answer as its output.
    io.reactivex.rxjava3.core.Flowable<?>
    runNode(Context context, @Nullable Object nodeInput)
    Runs the node on nodeInput, the output it receives from its predecessors.
    default Optional<com.google.genai.types.Schema>
    Returns the schema declaring the state keys the node uses.
    default boolean
    Returns true if the node stays re-triggerable until it produces an output or a route, instead of completing when its run completes.
  • Method Details

    • name

      String name()
      Returns the name that identifies the node within its graph.
    • description

      default String description()
      Returns what the node does, for humans and for a model that may call it.
    • rerunOnResume

      @Experimental default boolean rerunOnResume()
      Returns true if a resumed node runs again from scratch, rather than completing with the resuming answer as its output.
    • waitForOutput

      @Experimental default boolean waitForOutput()
      Returns true if the node stays re-triggerable until it produces an output or a route, instead of completing when its run completes.
    • config

      @Experimental default NodeConfig config()
      Returns the node's retry policy and execution timeout.
    • inputSchema

      @Experimental default Optional<com.google.genai.types.Schema> inputSchema()
      Returns the schema the node's input must match.
    • outputSchema

      @Experimental default Optional<com.google.genai.types.Schema> outputSchema()
      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.
    • stateSchema

      @Experimental default Optional<com.google.genai.types.Schema> stateSchema()
      Returns the schema declaring the state keys the node uses. Child nodes inherit it unless they declare their own.
    • requiresAllPredecessors

      @Experimental default boolean requiresAllPredecessors()
      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.
    • runNode

      @Experimental io.reactivex.rxjava3.core.Flowable<?> runNode(Context context, @Nullable Object nodeInput)
      Runs the node on nodeInput, the output it receives from its predecessors.

      An emitted Event passes through, and any other emitted value becomes the node's output (at most one per run); emit nothing for no output, since RxJava forbids null. The wildcard lets an implementation return a Flowable of its own type.