Runners
Runners are responsible for executing graphs. Different runners provide different execution strategies.SyncRunner
Synchronous runner for graph execution. Executes graphs without async support.Constructor
Optional cache backend for node result caching. Nodes opt in with
cache=TrueProperties
Capabilities object describing:
supports_cycles=Truesupports_async_nodes=Falsesupports_streaming=Falsereturns_coroutine=False
Default iteration cap for cyclic graphs (1000)
Node types this runner can execute:
{FunctionNode, GraphNode, IfElseNode, RouteNode}Methods
run
The graph to execute
Optional input values dict
Which outputs to return.
"**" (default) = all outputsHow to handle missing selected outputs
How to handle non-conflicting internal input overrides
Optional explicit cycle entry point node name
Max iterations for cyclic graphs (None = use default 1000)
How to handle node execution errors. “raise” (default) re-raises the original exception. “continue” returns RunResult with status=FAILED and partial values
Optional list of event processors to receive execution events
Input values shorthand (merged with values)
RunResult
Dict-like object with output values and execution metadata:
- Access outputs:
result["key"]orresult.get("key") - Status:
result.status(“completed” or “failed”) - Error:
result.error(exception if failed)
map
The graph to execute
Optional input values dict (some should be lists for
map_over)Parameter name(s) to iterate over
“zip” for parallel iteration, “product” for cartesian product
Deep-copy broadcast values per iteration. False (default) = share by reference, True = deep-copy all broadcast values, list[str] = deep-copy only named params
Which outputs to return
How to handle missing selected outputs
How to handle non-conflicting internal input overrides
Optional list of event processors to receive execution events
Input values shorthand (merged with values)
list[RunResult]
List of RunResult, one per iteration
AsyncRunner
Asynchronous runner for graph execution. Supports both sync and async nodes with concurrent execution.Constructor
Optional cache backend for node result caching. Nodes opt in with
cache=TrueProperties
Capabilities object describing:
supports_cycles=Truesupports_async_nodes=Truesupports_streaming=Falsereturns_coroutine=Truesupports_interrupts=True
Default iteration cap for cyclic graphs (1000)
Node types this runner can execute:
{FunctionNode, GraphNode, IfElseNode, RouteNode, InterruptNode}Methods
run
The graph to execute
Optional input values dict
Which outputs to return
How to handle missing selected outputs
How to handle non-conflicting internal input overrides
Optional explicit cycle entry point node name
Max iterations for cyclic graphs (None = use default 1000)
Maximum number of nodes to execute concurrently within each superstep. None = unlimited
How to handle node execution errors
Optional list of event processors to receive execution events
Input values shorthand (merged with values)
RunResult
Coroutine that returns RunResult with output values and execution metadata
arun
run() - executes a graph asynchronously. Identical signature to run().
map
The graph to execute
Optional input values dict
Parameter name(s) to iterate over
“zip” for parallel iteration, “product” for cartesian product
Deep-copy broadcast values per iteration
Which outputs to return
How to handle missing selected outputs
How to handle non-conflicting internal input overrides
Maximum concurrent executions within each superstep
Optional list of event processors
Input values shorthand
list[RunResult]
Coroutine that returns list of RunResult, one per iteration
amap
map() - executes a graph multiple times asynchronously. Identical signature to map().
RunResult
Dict-like object returned by runner execution methods.Properties
Execution status
Exception if execution failed, None otherwise
Methods
Supports standard dict operations:result[key]- Get output value, raises KeyError if missingresult.get(key, default=None)- Get output value with defaultkey in result- Check if output existsresult.keys()- Get output namesresult.values()- Get output valuesresult.items()- Get (name, value) pairs
PauseInfo
Information about a paused execution from an@interrupt node. Returned in RunResult.pause when execution pauses for human input.
Properties
Name of the InterruptNode that paused (uses ”/” for nested graphs)
The first output parameter name (for single-output nodes)
The first input value surfaced to the caller (for single-input interrupts)
All output parameter names if multi-output node, else None
All input values as
{name: value} if multi-input interrupt, else NoneKey to use in values dict when resuming execution.
- Top-level interrupt: returns
output_paramdirectly (e.g.,"decision") - Nested interrupt: dot-separated path (e.g.,
"review.decision")
Mapping of all output names to their resume keys (for multi-output interrupts)
Multi-Output Example
ErrorHandling
Type for controlling error behavior during batch processing withrunner.map().
Values
Stop immediately on first error and raise the exception (default)
Continue processing remaining items even if some fail
Usage
RunStatus
Enum indicating the outcome of graph execution.Values
Graph executed successfully to completion
Graph execution failed with an error
Graph execution paused at an
@interrupt node waiting for inputUsage
BaseRunner
Abstract base class for all runners. Use SyncRunner or AsyncRunner instead of subclassing directly.Abstract Methods
Must return RunnerCapabilities describing runner features
Must implement graph execution
Must implement batched graph execution