Package com.google.adk.workflow
Class NodeExecutionState
java.lang.Object
com.google.adk.workflow.NodeExecutionState
The state of one workflow node run, held by the run's
Context. Only the workflow runtime
creates it and updates the bookkeeping that records which results an event has carried. Its
output, interrupt IDs and child run IDs are safe to update from several threads, since children
that a node runs itself may start and finish on other threads.-
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of this attempt at running the node, counting from 1.Returns the author of the events this run emits, or empty to use the node's name.voideventAuthor(String eventAuthor) Sets the author of the events this run emits.com.google.common.collect.ImmutableSet<String>Returns the IDs of the long-running tool calls the node is waiting on.node()Returns the node this run belongs to.nodePath()Returns the path of this run:name@runIdsegments joined by/, starting at the outermost node.output()Returns the node's output, which is the output of itsuseAsOutputchild once that child emits one, or empty if it has none.parent()Returns the context of the node that ran this node, or empty if this is a root node.voidproduceOutput(Object output) Records the node's output, which an event carries when the node finishes unless an earlier event already carried it.Returns the user's answers to the requests for input and long-running calls that this node or its descendants raised in an earlier turn, keyed by interrupt ID.runId()Returns the ID of this run among the node's runs, counting from"1".Returns the routes the node selected, which decide the outgoing edges to follow, or empty if it made no routing decision.voidselectRoutes(List<? extends Route> routes) Selects the node's routes, replacing any earlier selection.
-
Method Details
-
node
Returns the node this run belongs to. -
nodePath
Returns the path of this run:name@runIdsegments joined by/, starting at the outermost node. -
runId
Returns the ID of this run among the node's runs, counting from"1". -
attemptCount
public int attemptCount()Returns the number of this attempt at running the node, counting from 1. -
parent
Returns the context of the node that ran this node, or empty if this is a root node. -
eventAuthor
Returns the author of the events this run emits, or empty to use the node's name. A run under a parent starts with the parent's author. -
eventAuthor
Sets the author of the events this run emits. -
output
Returns the node's output, which is the output of itsuseAsOutputchild once that child emits one, or empty if it has none. -
produceOutput
Records the node's output, which an event carries when the node finishes unless an earlier event already carried it. A node produces at most one output. Once the node delegates its output to auseAsOutputchild, an output it produces itself is dropped, as in Python ADK.- Throws:
IllegalStateException- if the node already produced an output of its own, even one that was dropped
-
selectedRoutes
Returns the routes the node selected, which decide the outgoing edges to follow, or empty if it made no routing decision. An empty list is a decision that selects no route. -
selectRoutes
Selects the node's routes, replacing any earlier selection. An event carries them when the node finishes unless an earlier event already carried them. -
interruptIds
Returns the IDs of the long-running tool calls the node is waiting on. -
resumeInputs
Returns the user's answers to the requests for input and long-running calls that this node or its descendants raised in an earlier turn, keyed by interrupt ID. A null answer has a null value in the map. The map is empty unless the node reruns on resume.
-