pub struct WorkflowBuilder { /* private fields */ }Expand description
Builder for constructing workflows
Implementations§
Source§impl WorkflowBuilder
impl WorkflowBuilder
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Set the workflow description
Add multiple tags to the workflow
Sourcepub fn code(self, name: impl Into<String>, config: ScriptConfig) -> Self
pub fn code(self, name: impl Into<String>, config: ScriptConfig) -> Self
Add a code execution node
Sourcepub fn retriever(self, name: impl Into<String>, config: VectorConfig) -> Self
pub fn retriever(self, name: impl Into<String>, config: VectorConfig) -> Self
Add a retriever (vector search) node
Sourcepub fn if_else(self, name: impl Into<String>, condition: Condition) -> Self
pub fn if_else(self, name: impl Into<String>, condition: Condition) -> Self
Add an if-else conditional node
Sourcepub fn loop_node(self, name: impl Into<String>, config: LoopConfig) -> Self
pub fn loop_node(self, name: impl Into<String>, config: LoopConfig) -> Self
Add a loop node
Sourcepub fn try_catch(self, name: impl Into<String>, config: TryCatchConfig) -> Self
pub fn try_catch(self, name: impl Into<String>, config: TryCatchConfig) -> Self
Add a try-catch node
Sourcepub fn sub_workflow(
self,
name: impl Into<String>,
config: SubWorkflowConfig,
) -> Self
pub fn sub_workflow( self, name: impl Into<String>, config: SubWorkflowConfig, ) -> Self
Add a sub-workflow node
Sourcepub fn switch(self, name: impl Into<String>, config: SwitchConfig) -> Self
pub fn switch(self, name: impl Into<String>, config: SwitchConfig) -> Self
Add a switch node
Sourcepub fn parallel(self, name: impl Into<String>, config: ParallelConfig) -> Self
pub fn parallel(self, name: impl Into<String>, config: ParallelConfig) -> Self
Add a parallel execution node
Sourcepub fn approval(self, name: impl Into<String>, config: ApprovalConfig) -> Self
pub fn approval(self, name: impl Into<String>, config: ApprovalConfig) -> Self
Add an approval node
Sourcepub fn form(self, name: impl Into<String>, config: FormConfig) -> Self
pub fn form(self, name: impl Into<String>, config: FormConfig) -> Self
Add a form input node
Sourcepub fn connect(self, from_index: usize, to_index: usize) -> Self
pub fn connect(self, from_index: usize, to_index: usize) -> Self
Add an edge between two nodes by their indices (0-based)
Sourcepub fn connect_ids(self, from_id: NodeId, to_id: NodeId) -> Self
pub fn connect_ids(self, from_id: NodeId, to_id: NodeId) -> Self
Add an edge between two nodes by their IDs
Sourcepub fn last_node_id(&self) -> Option<NodeId>
pub fn last_node_id(&self) -> Option<NodeId>
Get the ID of the last added node
Sourcepub fn node_id_at(&self, index: usize) -> Option<NodeId>
pub fn node_id_at(&self, index: usize) -> Option<NodeId>
Get the ID of a node by its index (0-based)
Auto 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