pydantic_graph.beta.node
Core node types for graph construction and execution.
This module defines the fundamental node types used to build execution graphs, including start/end nodes and fork nodes for parallel execution.
Bases: Generic[OutputT]
Entry point node for graph execution.
The StartNode represents the beginning of a graph execution flow.
Fixed identifier for the start node.
Default: NodeID('__start__')
Bases: Generic[InputT]
Terminal node representing the completion of graph execution.
The EndNode marks the successful completion of a graph execution flow and can collect the final output data.
Fixed identifier for the end node.
Default: NodeID('__end__')
Bases: Generic[InputT, OutputT]
Fork node that creates parallel execution branches.
A Fork node splits the execution flow into multiple parallel branches, enabling concurrent execution of downstream nodes. It can either map a sequence across multiple branches or duplicate data to each branch.
Unique identifier for this fork node.
Type: ForkID
Determines fork behavior.
If True, InputT must be Sequence[OutputT] and each element is sent to a separate branch. If False, InputT must be OutputT and the same data is sent to all branches.
Type: bool
Optional identifier of a downstream join node that should be jumped to if mapping an empty iterable.
Type: JoinID | None
Type variable for graph state.
Default: TypeVar('StateT', infer_variance=True)
Type variable for node output data.
Default: TypeVar('OutputT', infer_variance=True)
Type variable for node input data.
Default: TypeVar('InputT', infer_variance=True)