Skip to main content

Module graph

Module graph 

Source
Available on crate feature graph only.
Expand description

Graph-based workflow engine (LangGraph-inspired).

Build complex agent workflows with:

  • StateGraph - Graph builder with nodes and edges
  • GraphAgent - ADK Agent integration
  • Checkpointer - Persistent state for human-in-the-loop
  • Router - Conditional edge routing helpers
  • Cycle support with recursion limits
  • Streaming execution modes

Available with feature: graph

Modules§

agent
GraphAgent - ADK Agent integration for graph workflows
cachenode-cache
Node-level caching for graph execution.
checkpoint
Checkpointing for persistent graph state
child
Invoking a node from inside another node’s body.
deferred
Deferred node (fan-in barrier) support for graph workflows.
deltadelta-checkpoint
Delta checkpoint compression for graph state.
edge
Edge types for graph control flow
error
Error types for adk-graph
executor
Pregel-based execution engine for graphs
functionalfunctional
Functional API for Graph Workflows
graph
StateGraph builder for constructing graphs
interrupt
Human-in-the-loop interrupt types
node
Node types for graph execution
prelude
Prelude module for convenient imports
retry
Per-node retry with exponential backoff.
state
State management for graph execution
stream
Streaming types for graph execution
subgraph
Running one graph as a node of another.
time_traveltime-travel
Time-travel debugging for graph execution history.
timeout
Timeout enforcement for graph node execution.
tool
Exposing a node or a whole graph as a tool an LLM can call.

Structs§

AgentNode
Wrapper to use an existing ADK Agent as a graph node
AppendReducer
Built-in reducer: append to a Vec (list concatenation).
Channel
Channel definition for a state field
Checkpoint
Checkpoint data structure for persistence
CompiledGraph
A compiled graph ready for execution
DeferredNodeConfig
Configuration for a deferred (fan-in) node.
DeltaCheckpointer
Wraps any Checkpointer with delta compression.
DeltaConfig
Configuration for delta-based checkpoint compression.
ExecutionConfig
Configuration passed to nodes during execution
ExecutionLog
Tracks task completion status within a workflow run. Stored as part of the checkpoint metadata.
FanInTracker
Tracks which upstream paths have completed for a deferred node.
FunctionNode
Function node - wraps an async function as a node
GraphAgent
GraphAgent wraps a CompiledGraph as an ADK Agent
GraphAgentBuilder
Builder for GraphAgent
InterruptedExecution
Information about an interrupted execution
MapDelta
Delta representation for HashMap<String, Value>.
MemoryCheckpointer
In-memory checkpointer for development and testing
MergeReducer
Built-in reducer: deep merge for JSON-like structures.
MessagesValue
Chat message container with ID-based deduplication.
NodeCache
Node cache that stores and retrieves execution results.
NodeCachePolicy
Cache policy for a graph node.
NodeContext
Context passed to nodes during execution
NodeOutput
Output from a node execution
PregelExecutor
Pregel-based executor for graphs
ProgressHandle
A shared progress handle that nodes can use to report progress, resetting the idle timeout counter.
ReducedValue
Append-only state container. Accumulates values across tasks. Persisted to checkpoints on each task completion.
ReplaceReducer
Built-in reducer: replace with incoming value (last-write-wins).
Router
Router helper functions for common patterns
StateGraph
Builder for constructing graphs
StateSchema
State schema defines channels and their reducers
StateSchemaBuilder
Builder for StateSchema
StateSchemaValidator
Validates workflow state against a declared schema.
StepInfo
Information about a single execution step in the graph history.
StringDelta
Delta representation for String.
TaskContext
Runtime context passed to #[entrypoint] and #[task] functions.
TimeTravelHandle
Handle for time-travel operations on a graph thread.
TimeoutPolicy
Timeout configuration for a graph node.
UntrackedValue
Transient runtime value excluded from checkpoints.
VecDelta
Delta representation for Vec<Value>.

Enums§

CacheBackend
Cache backend selection.
CheckpointType
Discriminates between full state snapshots and incremental delta records.
Edge
Edge type
EdgeTarget
Target of an edge
ExpectedType
Expected JSON value type for a state field.
FunctionalError
Errors specific to the functional API.
GraphError
Errors that can occur during graph operations
Interrupt
Interrupt request from a node or configuration
MergeStrategy
How to combine outputs from multiple upstream parallel paths.
OnTimeout
Recovery action when a node times out.
Reducer
Reducer determines how state updates are merged
StreamEvent
Events emitted during streaming
StreamMode
Stream mode options
StringOp
An individual edit operation for string diffs.

Constants§

END
START
Special node identifiers

Traits§

Checkpointer
Checkpointer trait for persistence
Diff
Trait for types that can compute and apply incremental diffs.
Node
A node in the graph
TypedReducer
Trait for defining custom merge strategies for state values.

Functions§

compute_cache_key
Computes a deterministic cache key from a node name and its input state.
execute_with_timeout
Execute a node with timeout enforcement.
interrupt
Helper to create a dynamic interrupt from within a node
interrupt_with_data
Helper to create a dynamic interrupt with data

Type Aliases§

Result
Result type for graph operations
State
Graph state - a map of channel names to values