runNode

suspend fun runNode(node: Node, nodeInput: Any? = null, runId: String? = null, useAsOutput: Boolean = false, useSubBranch: Boolean = false, overrideBranch: String? = null, raiseOnWait: Boolean = false): Any?

Executes node as a child of this node activation and returns its output.

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

node

Child node to execute.

nodeInput

Input passed to node, or null if none.

runId

Explicit run ID for node: at least one non-digit, and no '/', '@', or '.'. A child that finished in an earlier turn under the same ID returns its recorded output without running again. When null or empty, the child gets the next number for its name, which follows call order, so concurrent children need explicit IDs.

useAsOutput

When true, delegates this node's output to node: this node must not produce an output of its own afterwards, even if node finishes without one. 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.

useSubBranch

When true, runs node on a sub-branch <branch>.<node.name>@<runId>.

overrideBranch

Branch for node to run on instead of this node's branch.

raiseOnWait

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, or if nodeInput fails node's input schema. A node child's input check throws NodeInputValidationException instead.

if node fails; its error is the child's failure.