pub struct WorkflowBuilder { /* private fields */ }Expand description
Fluent, validation-preserving workflow assembly.
Implementations§
Source§impl WorkflowBuilder
impl WorkflowBuilder
Sourcepub fn step<S>(
self,
id: impl Into<String>,
step: S,
capabilities: CapabilitySet,
) -> Selfwhere
S: WorkflowStep + 'static,
pub fn step<S>(
self,
id: impl Into<String>,
step: S,
capabilities: CapabilitySet,
) -> Selfwhere
S: WorkflowStep + 'static,
Appends one custom executable step.
Sourcepub fn agent(
self,
id: impl Into<String>,
agent: Arc<Agent>,
capabilities: CapabilitySet,
) -> Self
pub fn agent( self, id: impl Into<String>, agent: Arc<Agent>, capabilities: CapabilitySet, ) -> Self
Appends one Agent-backed step.
Sourcepub fn branch<C, T, F>(
self,
id: impl Into<String>,
condition: C,
when_true: T,
when_false: F,
capabilities: CapabilitySet,
) -> Self
pub fn branch<C, T, F>( self, id: impl Into<String>, condition: C, when_true: T, when_false: F, capabilities: CapabilitySet, ) -> Self
Appends a condition that executes exactly one of two steps.
Sourcepub fn parallel(
self,
id: impl Into<String>,
branches: impl IntoIterator<Item = ParallelBranch>,
) -> Self
pub fn parallel( self, id: impl Into<String>, branches: impl IntoIterator<Item = ParallelBranch>, ) -> Self
Appends a deterministic fan-out/fan-in parallel node.
Every branch receives the same canonical input. Outputs are joined into an object keyed by branch identifier, independent of completion order.
Sourcepub fn race(
self,
id: impl Into<String>,
branches: impl IntoIterator<Item = ParallelBranch>,
) -> Self
pub fn race( self, id: impl Into<String>, branches: impl IntoIterator<Item = ParallelBranch>, ) -> Self
Appends a budget-bounded, first-success race.
Race branches may request only Pure or ReadOnly capabilities.
Losing reservations are conservatively forfeited because remote work
may outlive local cancellation.
Sourcepub fn build(self) -> Result<Workflow, WorkflowBuildError>
pub fn build(self) -> Result<Workflow, WorkflowBuildError>
Validates and freezes this workflow definition.
§Errors
Returns WorkflowBuildError for invalid identity, version, duplicate
steps, or an empty definition.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WorkflowBuilder
impl !UnwindSafe for WorkflowBuilder
impl Freeze for WorkflowBuilder
impl Send for WorkflowBuilder
impl Sync for WorkflowBuilder
impl Unpin for WorkflowBuilder
impl UnsafeUnpin for WorkflowBuilder
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