runNode
Executes node as a child of this node activation and returns its output. When node is an agent that hands off with transfer_to_agent, the handoffs are followed and the last agent's output is returned.
Child events are recorded under <thisNodePath>/<node.name>@<runId>. If node fails, this call throws DynamicNodeFailedException, which fails this node unless the caller catches it. If node pauses for input, this call throws an internal Throwable that is not an Exception, so the runtime can mark this node as waiting; do not catch it with runCatching or catch (t: Throwable).
Parameters
Child node to execute.
Input passed to node, or null if none.
Explicit run ID for node: at least one non-digit, and no '/', '@', or '.'. A child that already recorded an output under the same ID, in this activation, an earlier attempt, or an earlier turn, returns it without running again; one that finished without an output may run again. When null or empty, the child gets the next number for its name, which follows call order, so concurrent children need explicit IDs.
When true, delegates this node's output to node. The first output this node produces afterwards (such as returning node's result) is dropped, even if node produces none. A second output fails this node. The claim is released only if node fails before emitting an output, so a caller that catches the failure may fall back to its own output. Once node has emitted, its output is this node's output and successors receive it. A node {} outputs it encoded under its output type, as if it had returned it, and fails if it does not decode.
When true, runs node on a sub-branch <branch>.<node.name>@<runId>.
Branch for node to run on instead of this node's branch.
Isolation scope for node to run in instead of this node's scope. When null, an AgentMode.TASK child of a node activation runs in a scope named by its own node path.
When true and node is a Workflow or sets Node.waitForOutput but finishes without an output, aborts this node's run like an interrupt, without recording one: this node completes with any output it already produced, or else waits only if it sets Node.waitForOutput.
Throws
if called outside a node activation, if this node does not set rerunOnResume = true, or if this node already produced or delegated its output and useAsOutput is true.
if node's name or runId is invalid, if nodeInput fails node's input schema, or if a handoff can't be followed: a node that is not an agent requests one, or an agent requests one to itself, to an agent its transfer flags forbid, to a task or single-turn agent, or to an agent that is not its child, parent or peer. A node child's input check throws NodeInputValidationException instead. A parallelNode checks each item instead, and a rejected item fails it.
if node fails; its error is the child's failure.