pub struct ExecContext {
pub data: Value,
pub inputs: HashMap<String, Value>,
pub variables: HashMap<String, Value>,
pub context: Arc<RwLock<HashMap<String, Value>>>,
pub registry: Arc<NodeRegistry>,
pub flow_store: Option<Arc<dyn FlowStore>>,
}Expand description
Runtime context passed to every node during execution.
data— the static configuration declared in the flow definition’sdatafield.inputs— outputs of all upstream nodes, keyed by node ID.variables— global flow-level variables (env, secrets, user inputs).context— shared mutable context for cross-node state (similar to Dify’s global context). Nodes can read and write to this context usingcontext.read()andcontext.write().registry— the active node registry; available to nodes that need to execute sub-flows (e.g."iteration","sub-flow").flow_store— optional named flow definition store; required by the"sub-flow"node to load its target definition by name.
Fields§
§data: ValueNode configuration from the flow definition’s data field.
inputs: HashMap<String, Value>Outputs of upstream nodes, keyed by node ID.
variables: HashMap<String, Value>Global flow variables (env, secrets, user inputs).
context: Arc<RwLock<HashMap<String, Value>>>Shared mutable context for cross-node state (Dify-style global context).
Use context.read() to read and context.write() to modify.
registry: Arc<NodeRegistry>Active node registry — allows nodes to run sub-flows.
flow_store: Option<Arc<dyn FlowStore>>Named flow definition store — available when the engine has one configured.
Trait Implementations§
Source§impl Clone for ExecContext
impl Clone for ExecContext
Source§impl Debug for ExecContext
impl Debug for ExecContext
Auto Trait Implementations§
impl Freeze for ExecContext
impl !RefUnwindSafe for ExecContext
impl Send for ExecContext
impl Sync for ExecContext
impl Unpin for ExecContext
impl UnsafeUnpin for ExecContext
impl !UnwindSafe for ExecContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more