pub struct GraphConfig {
pub thread_id: Option<String>,
pub trace_id: Option<String>,
pub trace_ctx: Option<TraceCtx>,
pub recursion_limit: usize,
pub max_parallelism: usize,
pub tags: Vec<String>,
pub metadata: HashMap<String, Value>,
pub configurable: HashMap<String, Value>,
}Expand description
Runtime configuration for graph execution.
Fields§
§thread_id: Option<String>Thread ID for checkpointing and state management
trace_id: Option<String>Trace ID for cross-crate correlation. If None, one is generated automatically at execution start.
§Phase status: compatibility / migration-only
This field uses String for backward compatibility. The canonical
replacement is trace_ctx. Use
trace_ctx() to obtain the canonical form.
Removal condition: removed when all callers migrate to trace_ctx.
trace_ctx: Option<TraceCtx>Canonical trace context for cross-crate correlation.
When set, takes precedence over the legacy trace_id field.
If both are None, a new TraceCtx is generated at execution start.
recursion_limit: usizeMaximum recursion depth (default: 100)
max_parallelism: usizeMaximum number of parallel nodes in a single superstep. Hard-capped at 32. Default: 8.
Tags for filtering and organization
metadata: HashMap<String, Value>Metadata attached to the execution
configurable: HashMap<String, Value>User-provided configurable values accessible by nodes
Implementations§
Source§impl GraphConfig
impl GraphConfig
pub fn new() -> Self
pub fn with_thread_id(self, id: impl Into<String>) -> Self
pub fn with_recursion_limit(self, limit: usize) -> Self
pub fn with_tag(self, tag: impl Into<String>) -> Self
pub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
pub fn with_configurable(self, key: impl Into<String>, value: Value) -> Self
pub fn with_trace_id(self, id: impl Into<String>) -> Self
pub fn with_max_parallelism(self, n: usize) -> Self
Sourcepub fn resolve_trace_ctx(&self) -> TraceCtx
pub fn resolve_trace_ctx(&self) -> TraceCtx
Resolve the canonical stack_ids::TraceCtx for this config.
Resolution order:
self.trace_ctxif set (canonical path).self.trace_idconverted viaTraceCtx::from_legacy_trace_id(compat path).- Generates a new
TraceCtxif neither is set.
Sourcepub fn with_trace_ctx(self, ctx: TraceCtx) -> Self
pub fn with_trace_ctx(self, ctx: TraceCtx) -> Self
Set the canonical trace context.
Also back-fills the legacy trace_id field for compat consumers.
Trait Implementations§
Source§impl Clone for GraphConfig
impl Clone for GraphConfig
Source§fn clone(&self) -> GraphConfig
fn clone(&self) -> GraphConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more