Expand description
Node abstractions: the unit of computation in the graph.
A node is an async computation that:
- Receives a
NodeContext— an immutable snapshot of the shared state as of the start of the current super-step, plus run configuration and interrupt/resume helpers. - Returns a
NodeOutput— a partial state update (never the whole state) plus an optionalCommandfor dynamic routing.
Because nodes only ever see the snapshot from the super-step start, nodes running in the same super-step can never observe each other’s writes — the barrier is what makes shared-state parallelism safe.
Any async closure Fn(NodeContext) -> impl Future<Output = Result<NodeOutput>>
automatically implements Node via a blanket impl.
Structs§
- Command
- Dynamic routing + resume directive, unifying state transition and control
flow (the LangGraph
Command). - Node
Config - Per-run, per-node configuration handed to every node invocation.
- Node
Context - The input to every node invocation.
- Node
Output - The output of a node: partial state updates plus optional dynamic routing.
Traits§
- Node
- The node trait: an async unit of computation over shared state.