Skip to main content

WorkflowGuardConfig

Struct WorkflowGuardConfig 

Source
pub struct WorkflowGuardConfig {
    pub max_depth: u32,
    pub max_fan_out: u32,
    pub max_workflow_tokens: u64,
    pub workflow_timeout_secs: u64,
}
Expand description

Configurable execution limits for a workflow run.

Each limit has a sensible default. Limits can be set per-handler via WorkflowHandler::guard_config or globally on the Engine.

§Examples

use ironflow_engine::guard::WorkflowGuardConfig;

let config = WorkflowGuardConfig::new()
    .with_max_depth(3)
    .with_max_fan_out(10);

assert_eq!(config.max_depth, 3);
assert_eq!(config.max_fan_out, 10);
assert_eq!(config.max_workflow_tokens, 100_000);

Fields§

§max_depth: u32

Maximum depth of nested sub-workflows (default 5).

§max_fan_out: u32

Maximum total number of workflow invocations (default 20).

§max_workflow_tokens: u64

Cumulative token budget across all agent steps (default 100,000).

§workflow_timeout_secs: u64

Global timeout in seconds (default 120).

Implementations§

Source§

impl WorkflowGuardConfig

Source

pub fn new() -> Self

Create a configuration with default limits.

§Examples
use ironflow_engine::guard::WorkflowGuardConfig;

assert_eq!(WorkflowGuardConfig::new(), WorkflowGuardConfig::default());
Source

pub fn from_env() -> Self

Load configuration from environment variables.

Reads IRONFLOW_GUARD_MAX_DEPTH, IRONFLOW_GUARD_MAX_FAN_OUT, IRONFLOW_GUARD_MAX_WORKFLOW_TOKENS, and IRONFLOW_GUARD_WORKFLOW_TIMEOUT_SECS. Missing or unparseable variables fall back to defaults.

§Examples
use ironflow_engine::guard::WorkflowGuardConfig;

let config = WorkflowGuardConfig::from_env();
// Without env vars set, returns defaults.
assert_eq!(config.max_depth, 5);
Source

pub fn with_max_depth(self, max_depth: u32) -> Self

Set the maximum sub-workflow nesting depth.

§Examples
use ironflow_engine::guard::WorkflowGuardConfig;

let config = WorkflowGuardConfig::new().with_max_depth(3);
assert_eq!(config.max_depth, 3);
Source

pub fn with_max_fan_out(self, max_fan_out: u32) -> Self

Set the maximum total workflow invocations.

§Examples
use ironflow_engine::guard::WorkflowGuardConfig;

let config = WorkflowGuardConfig::new().with_max_fan_out(10);
assert_eq!(config.max_fan_out, 10);
Source

pub fn with_max_workflow_tokens(self, max: u64) -> Self

Set the cumulative token budget.

§Examples
use ironflow_engine::guard::WorkflowGuardConfig;

let config = WorkflowGuardConfig::new().with_max_workflow_tokens(50_000);
assert_eq!(config.max_workflow_tokens, 50_000);
Source

pub fn with_workflow_timeout_secs(self, secs: u64) -> Self

Set the global timeout in seconds.

§Examples
use ironflow_engine::guard::WorkflowGuardConfig;

let config = WorkflowGuardConfig::new().with_workflow_timeout_secs(60);
assert_eq!(config.workflow_timeout_secs, 60);

Trait Implementations§

Source§

impl Clone for WorkflowGuardConfig

Source§

fn clone(&self) -> WorkflowGuardConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WorkflowGuardConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WorkflowGuardConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for WorkflowGuardConfig

Source§

impl PartialEq for WorkflowGuardConfig

Source§

fn eq(&self, other: &WorkflowGuardConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WorkflowGuardConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more