Skip to main content

WorkflowsConfig

Struct WorkflowsConfig 

Source
pub struct WorkflowsConfig {
    pub name: Option<String>,
    pub description: Option<String>,
    pub source_file: Option<PathBuf>,
    pub settings: WorkflowSettings,
    pub states: HashMap<String, StateWorkflow>,
    pub phases: HashMap<String, PhaseWorkflow>,
    pub combos: HashMap<String, ComboPrompts>,
    pub gates: HashMap<String, Vec<GateDefinition>>,
    pub named_workflows: HashMap<String, Arc<WorkflowsConfig>>,
    pub default_workflow_key: Option<String>,
}
Expand description

Unified workflow configuration.

Fields§

§name: Option<String>

Short identifier for the workflow (e.g., “swarm”, “relay”, “solo”).

§description: Option<String>

Human-readable description of the workflow’s coordination model. Should explain when to choose this workflow and how agents coordinate.

§source_file: Option<PathBuf>

Path to the source file this workflow was loaded from. Not deserialized from YAML - populated by the loader.

§settings: WorkflowSettings

Global workflow settings.

§states: HashMap<String, StateWorkflow>

State definitions with transitions, timing, and prompts.

§phases: HashMap<String, PhaseWorkflow>

Phase definitions with prompts.

§combos: HashMap<String, ComboPrompts>

State+phase combination prompts (key format: “state+phase”).

§gates: HashMap<String, Vec<GateDefinition>>

Gate definitions for status and phase exits. Keys are “status:” or “phase:”, values are lists of gate definitions.

§named_workflows: HashMap<String, Arc<WorkflowsConfig>>

Cache of named workflow configs (e.g., “swarm” -> workflow-swarm.yaml). Populated at server startup, not serialized.

§default_workflow_key: Option<String>

Key to look up the default workflow in named_workflows cache. If set, workers without a workflow use this instead of the base config.

Implementations§

Source§

impl WorkflowsConfig

Source

pub fn get_named_workflow(&self, name: &str) -> Option<&Arc<WorkflowsConfig>>

Get a named workflow config, or None if not found.

Source

pub fn get_default_workflow(&self) -> Option<&Arc<WorkflowsConfig>>

Get the default workflow config from the cache, if one is configured.

Source§

impl WorkflowsConfig

Source

pub fn get_state_enter_prompt(&self, state: &str) -> Option<&str>

Get the enter prompt for a state.

Source

pub fn get_state_exit_prompt(&self, state: &str) -> Option<&str>

Get the exit prompt for a state.

Source

pub fn get_phase_enter_prompt(&self, phase: &str) -> Option<&str>

Get the enter prompt for a phase.

Source

pub fn get_phase_exit_prompt(&self, phase: &str) -> Option<&str>

Get the exit prompt for a phase.

Source

pub fn get_combo_enter_prompt(&self, state: &str, phase: &str) -> Option<&str>

Get the enter prompt for a state+phase combo.

Source

pub fn get_combo_exit_prompt(&self, state: &str, phase: &str) -> Option<&str>

Get the exit prompt for a state+phase combo.

Source

pub fn get_prompt(&self, trigger: &str) -> Option<&str>

Get a prompt by trigger name.

Trigger format:

  • enter~{state} - entering a state
  • exit~{state} - exiting a state
  • enter%{phase} - entering a phase
  • exit%{phase} - exiting a phase
  • enter~{state}%{phase} - entering a state+phase combo
  • exit~{state}%{phase} - exiting a state+phase combo
Source

pub fn list_prompt_triggers(&self) -> Vec<String>

List all available prompt triggers.

Source

pub fn get_status_exit_gates(&self, status: &str) -> Vec<&GateDefinition>

Get exit gates for a status transition. Returns gates defined under “status:” key.

Source

pub fn get_phase_exit_gates(&self, phase: &str) -> Vec<&GateDefinition>

Get exit gates for a phase transition. Returns gates defined under “phase:” key.

Trait Implementations§

Source§

impl Clone for WorkflowsConfig

Source§

fn clone(&self) -> WorkflowsConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for WorkflowsConfig

Source§

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

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

impl Default for WorkflowsConfig

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for WorkflowsConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<&WorkflowsConfig> for PhasesConfig

Convert WorkflowsConfig to PhasesConfig for backwards compatibility.

Source§

fn from(workflows: &WorkflowsConfig) -> Self

Converts to this type from the input type.
Source§

impl From<&WorkflowsConfig> for StatesConfig

Convert WorkflowsConfig to StatesConfig for backwards compatibility.

Source§

fn from(workflows: &WorkflowsConfig) -> Self

Converts to this type from the input type.
Source§

impl Serialize for WorkflowsConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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 = Infallible

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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,