pub struct WorkflowBuilder { /* private fields */ }Expand description
Builder for constructing agent workflows
Implementations§
Source§impl WorkflowBuilder
impl WorkflowBuilder
Sourcepub fn step(self, name: &str, agent: AgentType) -> Self
pub fn step(self, name: &str, agent: AgentType) -> Self
Add a step to the workflow (no dependencies)
Sourcepub fn then(self, name: &str, agent: AgentType) -> Self
pub fn then(self, name: &str, agent: AgentType) -> Self
Add a sequential step that depends on the previous step
Sourcepub fn branch_on(
self,
name: &str,
branches: Vec<(&str, Condition, &str)>,
) -> Self
pub fn branch_on( self, name: &str, branches: Vec<(&str, Condition, &str)>, ) -> Self
Add a conditional branch with custom conditions
§Arguments
name- Name of the decision pointbranches- Vec of (branch_name, condition, next_step_id) tuples
§Example
ⓘ
workflow.branch_on("quality-gate", vec![
("high", Condition::FieldGreaterThan { field: "score".into(), value: 0.9 }, "deploy"),
("low", Condition::Always, "reject"),
]);Sourcepub fn branch(self, name: &str, pass_step: &str, fail_step: &str) -> Self
pub fn branch(self, name: &str, pass_step: &str, fail_step: &str) -> Self
Add a simple pass/fail conditional branch
This is a convenience method for the common case of branching on success/failure.
§Arguments
name- Name of the decision pointpass_step- Step ID to execute if condition passesfail_step- Step ID to execute if condition fails
§Example
ⓘ
workflow
.step("test", AgentType::ReviewAgent)
.branch("deploy-decision", "deploy", "rollback");Sourcepub fn parallel(self, steps: Vec<(&str, AgentType)>) -> Self
pub fn parallel(self, steps: Vec<(&str, AgentType)>) -> Self
Add parallel steps that execute concurrently
pub fn name(&self) -> &str
pub fn steps(&self) -> &[Step]
Trait Implementations§
Source§impl Clone for WorkflowBuilder
impl Clone for WorkflowBuilder
Source§fn clone(&self) -> WorkflowBuilder
fn clone(&self) -> WorkflowBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WorkflowBuilder
impl RefUnwindSafe for WorkflowBuilder
impl Send for WorkflowBuilder
impl Sync for WorkflowBuilder
impl Unpin for WorkflowBuilder
impl UnwindSafe 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