Workflow
A graph of nodes, and a Node itself, so graphs nest: a workflow drops into another workflow wherever an ordinary node goes.
Running it schedules nodes as their predecessors complete, so independent branches run concurrently and a chain runs in order. The graph is assembled and validated when the workflow is constructed, so a malformed graph throws GraphValidationException here rather than at run time.
Properties
The node's retry policy and execution timeout.
What the node does, for humans and for a model that may call it.
Validates the node's input before it runs.
The most nodes to run at once. Null does not limit.
Validates the output value the node emits. A value assigned to Context.output and a message-as-output event's content are not checked.
Whether the node runs only once every predecessor has completed, receiving all their outputs keyed by node name. A fan-in node overrides this to true.
On resume, whether to run the node again from scratch rather than completing it with the resuming answer as its output.
Declares the state keys the node uses. Child nodes inherit it unless they declare their own.
Whether the node stays re-triggerable until it produces an output or a route, instead of completing when runNode returns. A node that never produces either then waits forever, which is a graph-authoring error.
Functions
Runs the node and emits its events. It drives runNode and normalizes each raw emission into an Event, so every node behaves the same way at its edges: null and Unit are skipped, an Event passes through with its output validated (a message-as-output event's content is not), and any other value becomes the output.
Runs this workflow as the root of an invocation, through the node runner, so its own timeout and retry policy apply. Each non-partial event pauses the node that emitted it until the flow's collector returns, and a node failure is rethrown only after the event stream drains. Nested inside another graph it runs through runNode instead.