pub struct RunnableConfig {Show 24 fields
pub thread_id: Option<String>,
pub checkpoint_id: Option<String>,
pub recursion_limit: usize,
pub max_parallel_tasks: usize,
pub run_name: Option<String>,
pub graph_name: Option<String>,
pub run_id: Option<String>,
pub checkpoint_ns: Option<CheckpointNamespace>,
pub cache: Option<CacheConfig>,
pub tags: Vec<String>,
pub metadata: HashMap<String, Value>,
pub cancellation_token: Option<CancellationToken>,
pub budget: Option<BudgetConfig>,
pub durability: Option<Durability>,
pub node_finished_callback: Option<Arc<dyn Fn(&str) + Send + Sync>>,
pub resume_value: Option<ResumeValue>,
pub interrupt_before: Option<Vec<String>>,
pub interrupt_after: Option<Vec<String>>,
pub metrics_collector: Option<Arc<dyn MetricsCollector>>,
pub callback_handler: Option<Arc<dyn GraphLifecycleCallback>>,
pub llm_cache_policy: Option<CachePolicy>,
pub heartbeat: Option<Heartbeat>,
pub budget_tracker: Option<Arc<BudgetTracker>>,
pub resource_limits: Option<ResourceLimits>,
}Expand description
Configuration for graph execution
Fields§
§thread_id: Option<String>Thread ID for checkpoint isolation
checkpoint_id: Option<String>Checkpoint ID to resume from (time-travel)
recursion_limit: usizeMaximum superstep count (default 25)
max_parallel_tasks: usizeMaximum parallel tasks (for bounded concurrency)
run_name: Option<String>Run name for observability
graph_name: Option<String>Graph name for observability (specified at graph construction time)
run_id: Option<String>Unique run identifier for logging, stream resumption, and cancellation.
When None, the execution layer (CompiledGraph::stream, invoke, etc.)
generates a new UUIDv4 automatically before creating the Pregel loop.
Callers may set this explicitly to correlate multiple operations with
the same run ID (e.g., for stream resumption or distributed tracing).
checkpoint_ns: Option<CheckpointNamespace>Checkpoint namespace (for subgraph isolation)
cache: Option<CacheConfig>Cache configuration
Tags for filtering
metadata: HashMap<String, Value>User metadata
cancellation_token: Option<CancellationToken>Cancellation token for aborting execution
budget: Option<BudgetConfig>Budget configuration for execution limits
durability: Option<Durability>Checkpoint durability mode
node_finished_callback: Option<Arc<dyn Fn(&str) + Send + Sync>>Callback invoked when a node finishes execution
resume_value: Option<ResumeValue>Resume value for HITL interrupt continuation
Supports single value, ID-based resume, and namespace-based resume for multi-interrupt workflows.
interrupt_before: Option<Vec<String>>Nodes that should interrupt before execution (HITL)
interrupt_after: Option<Vec<String>>Nodes that should interrupt after execution (HITL)
metrics_collector: Option<Arc<dyn MetricsCollector>>Optional metrics collector for OpenTelemetry or in-memory metrics
callback_handler: Option<Arc<dyn GraphLifecycleCallback>>Optional callback handler for graph lifecycle events
Receives notifications at key points during graph execution: node start/end/error, graph completion, and checkpoint saves. All methods have default no-op implementations.
llm_cache_policy: Option<CachePolicy>LLM response cache policy for controlling key generation and TTL
heartbeat: Option<Heartbeat>Optional heartbeat sender for long-running node liveness signals
When set by the execution engine, nodes can call
config.heartbeat.as_ref().map(Heartbeat::ping) periodically
to prevent idle timeout detection.
budget_tracker: Option<Arc<BudgetTracker>>Runtime budget tracker shared across nodes for token/cost tracking
Set by the execution engine when a BudgetConfig is configured.
Nodes can access this via Self::budget_tracker to report LLM
token usage for automatic budget enforcement.
resource_limits: Option<ResourceLimits>Resource limits for concurrent LLM/tool calls and state size
Implementations§
Source§impl RunnableConfig
impl RunnableConfig
Sourcepub fn with_thread_id(self, id: impl Into<String>) -> Self
pub fn with_thread_id(self, id: impl Into<String>) -> Self
Set the thread ID for checkpoint isolation
Sourcepub fn with_checkpoint_id(self, id: impl Into<String>) -> Self
pub fn with_checkpoint_id(self, id: impl Into<String>) -> Self
Set the checkpoint ID for time-travel resume
Sourcepub fn with_run_id(self, id: impl Into<String>) -> Self
pub fn with_run_id(self, id: impl Into<String>) -> Self
Set the run ID for stream resumption and observability correlation
Sourcepub const fn with_recursion_limit(self, limit: usize) -> Self
pub const fn with_recursion_limit(self, limit: usize) -> Self
Set the recursion limit (maximum superstep count)
Sourcepub const fn with_max_parallel_tasks(self, max: usize) -> Self
pub const fn with_max_parallel_tasks(self, max: usize) -> Self
Set the maximum number of parallel tasks
Sourcepub fn with_run_name(self, name: impl Into<String>) -> Self
pub fn with_run_name(self, name: impl Into<String>) -> Self
Set the run name for observability
Sourcepub fn with_graph_name(self, name: impl Into<String>) -> Self
pub fn with_graph_name(self, name: impl Into<String>) -> Self
Set the graph name for observability
Sourcepub fn with_checkpoint_ns(self, ns: CheckpointNamespace) -> Self
pub fn with_checkpoint_ns(self, ns: CheckpointNamespace) -> Self
Set the checkpoint namespace for subgraph isolation
Sourcepub fn with_cache(self, cache: CacheConfig) -> Self
pub fn with_cache(self, cache: CacheConfig) -> Self
Set cache configuration
Sourcepub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
pub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
Add metadata key-value pair
Sourcepub fn with_cancellation_token(self, token: CancellationToken) -> Self
pub fn with_cancellation_token(self, token: CancellationToken) -> Self
Set the cancellation token for aborting execution
Sourcepub fn with_budget(self, budget: BudgetConfig) -> Self
pub fn with_budget(self, budget: BudgetConfig) -> Self
Set the budget configuration for execution limits
Sourcepub fn with_interrupt_before(self, nodes: Vec<String>) -> Self
pub fn with_interrupt_before(self, nodes: Vec<String>) -> Self
Sourcepub fn with_interrupt_after(self, nodes: Vec<String>) -> Self
pub fn with_interrupt_after(self, nodes: Vec<String>) -> Self
Sourcepub fn with_metrics_collector(
self,
collector: Arc<dyn MetricsCollector>,
) -> Self
pub fn with_metrics_collector( self, collector: Arc<dyn MetricsCollector>, ) -> Self
Sourcepub fn with_callback_handler(
self,
handler: Arc<dyn GraphLifecycleCallback>,
) -> Self
pub fn with_callback_handler( self, handler: Arc<dyn GraphLifecycleCallback>, ) -> Self
Set the callback handler for graph lifecycle events
§Examples
use std::sync::Arc;
use juncture_core::config::RunnableConfig;
use juncture_core::observability::GraphLifecycleCallback;
let handler: Arc<dyn GraphLifecycleCallback> = /* ... */;
let config = RunnableConfig::new()
.with_callback_handler(handler);Sourcepub fn with_llm_cache_policy(self, policy: LlmCachePolicy) -> Self
pub fn with_llm_cache_policy(self, policy: LlmCachePolicy) -> Self
Set the LLM response cache policy
Sourcepub const fn budget_tracker(&self) -> Option<&Arc<BudgetTracker>>
pub const fn budget_tracker(&self) -> Option<&Arc<BudgetTracker>>
Get a reference to the budget tracker, if configured
Nodes can call this to report LLM token usage for automatic budget enforcement during graph execution.
Sourcepub const fn with_resource_limits(self, limits: ResourceLimits) -> Self
pub const fn with_resource_limits(self, limits: ResourceLimits) -> Self
Trait Implementations§
Source§impl Clone for RunnableConfig
impl Clone for RunnableConfig
Source§fn clone(&self) -> RunnableConfig
fn clone(&self) -> RunnableConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more