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
AppendReducerfunctional
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.
DeltaCheckpointerdelta-checkpoint
Wraps any Checkpointer with delta compression.
DeltaConfigdelta-checkpoint
Configuration for delta-based checkpoint compression.
ExecutionConfig
Configuration passed to nodes during execution
ExecutionLogfunctional
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
GraphToolConfirmationPause
A persisted tool-authorization pause emitted by a graph.
InterruptedExecution
Information about an interrupted execution
MapDeltadelta-checkpoint
Delta representation for HashMap<String, Value>.
MemoryCheckpointer
In-memory checkpointer for development and testing
MergeReducerfunctional
Built-in reducer: deep merge for JSON-like structures.
MessagesValuefunctional
Chat message container with ID-based deduplication.
NodeCachenode-cache
Node cache that stores and retrieves execution results.
NodeCachePolicynode-cache
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.
ReducedValuefunctional
Append-only state container. Accumulates values across tasks. Persisted to checkpoints on each task completion.
ReplaceReducerfunctional
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
StateSchemaValidatorfunctional
Validates workflow state against a declared schema.
StepInfotime-travel
Information about a single execution step in the graph history.
StringDeltadelta-checkpoint
Delta representation for String.
TaskContextfunctional
Runtime context passed to #[entrypoint] and #[task] functions.
TimeTravelHandletime-travel
Handle for time-travel operations on a graph thread.
TimeoutPolicy
Timeout configuration for a graph node.
UntrackedValuefunctional
Transient runtime value excluded from checkpoints.
VecDeltadelta-checkpoint
Delta representation for Vec<Value>.

Enums§

CacheBackendnode-cache
Cache backend selection.
CheckpointTypedelta-checkpoint
Discriminates between full state snapshots and incremental delta records.
Edge
Edge type
EdgeTarget
Target of an edge
ExpectedTypefunctional
Expected JSON value type for a state field.
FunctionalErrorfunctional
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
StringOpdelta-checkpoint
An individual edit operation for string diffs.

Constants§

END
START
Special node identifiers

Traits§

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

Functions§

compute_cache_keynode-cache
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