Nodes
Nodes are the fundamental building blocks of Hypergraph computation graphs. Each node represents a unit of computation with defined inputs and outputs.Node Decorators
@node
The function to wrap (when used without parentheses)
Name(s) for output value(s). If None, creates a side-effect only node with
outputs = ()Mapping to rename inputs
{old: new}Whether to cache results. Requires a cache backend on the runner
Whether to hide from visualization
Ordering-only output name(s). Auto-produced with sentinel value when node runs
Ordering-only input name(s). Node won’t run until these values exist and are fresh
FunctionNode
Returns a FunctionNode instance that wraps the function
If the function has a return type annotation but no
output_name is provided, a warning is emitted to help catch mistakes.@interrupt
Name(s) for output value(s). Required (defines where human responses are written)
Mapping to rename inputs
{old: new}Whether to cache results
Ordering-only output name(s)
Ordering-only input name(s)
Whether to hide from visualization
InterruptNode
Returns an InterruptNode instance
Node Classes
HyperNode
Abstract base class for all node types with shared rename functionality.Public node name
Input parameter names
Output value names
Properties
SHA256 hash of the node’s definition for caching and change detection
Whether this node requires async execution (default: False)
Whether this node yields multiple values (default: False)
Whether this is a pause point for human-in-the-loop (default: False)
Whether results should be cached (default: False)
Whether this node is hidden from visualization (default: False)
Ordering-only inputs this node waits for
Outputs that carry data (excludes emit-only outputs)
Methods
Return new node with different name
Return new node with renamed inputs
Return new node with renamed outputs
Check if node has a fallback value for an input parameter
Get fallback value for an input parameter. Raises KeyError if none exists
Get expected type for an input parameter from annotations
Get type of an output value from annotations
FunctionNode
Wraps a Python function as a graph node. Created via@node decorator or FunctionNode() constructor.
- Sync functions:
def func(...) - Async functions:
async def func(...) - Sync generators:
def func(...): yield ... - Async generators:
async def func(...): yield ...
Function to wrap, or existing FunctionNode (extracts
.func)Public node name (default:
func.__name__)Name(s) for output value(s). If None,
outputs = () (side-effect only node)Mapping to rename inputs
{old: new}Whether to cache results
Whether to hide from visualization
Ordering-only output name(s)
Ordering-only input name(s)
Properties
The wrapped function
True if async def or async generator
True if yields multiple values
Type annotations for output values. For single output: maps
output_name to return type. For multiple outputs with tuple return: maps each output to corresponding tuple element typeGraphNode
Wraps a Graph for use as a node in another graph, enabling hierarchical composition.Graph.as_node() rather than directly.
The graph to wrap
Node name (default: use
graph.name if set)Properties
The wrapped graph
Hash of the nested graph (delegates to
graph.definition_hash)True if the nested graph contains any async nodes
Map configuration if set via
map_over(), else NoneMethods
map_over
(*params: str, mode: Literal['zip', 'product'] = 'zip', error_handling: Literal['raise', 'continue'] = 'raise', clone: bool | list[str] = False) -> GraphNode
Configure this GraphNode for iteration over input parameters. When configured, the runner executes the inner graph multiple times, once for each combination of values. Outputs become lists of results.
- params: Input parameter names to iterate over (should receive list values at runtime)
- mode: “zip” for parallel iteration (default) or “product” for cartesian product
- error_handling: “raise” (default) stops on first failure, “continue” collects partial results
- clone: Control deep-copying of broadcast values per iteration. False (default) shares by reference, True deep-copies all, or list of param names to deep-copy selectively
InterruptNode
Pause point for human-in-the-loop workflows. Identical to FunctionNode except:output_nameis required (must define where responses go)is_interruptproperty returnsTrue- Handler returning
Nonepauses for human input - Handler returning a value auto-resolves
Function to wrap
Public node name (default:
func.__name__)Name(s) for output value(s). Required for interrupts
Mapping to rename inputs
{old: new}Whether to cache results
Whether to hide from visualization
Ordering-only output name(s)
Ordering-only input name(s)