pub struct WorkflowEngine { /* private fields */ }Expand description
Engine for registering and executing multi-step agent workflows.
Implementations§
Source§impl WorkflowEngine
impl WorkflowEngine
Sourcepub fn register_workflow(&self, workflow: Workflow) -> WorkflowId
pub fn register_workflow(&self, workflow: Workflow) -> WorkflowId
Register a sequential workflow definition and return its ID.
Sourcepub fn register_dag_workflow(
&self,
workflow: DagWorkflow,
) -> Result<WorkflowId, Vec<ValidationError>>
pub fn register_dag_workflow( &self, workflow: DagWorkflow, ) -> Result<WorkflowId, Vec<ValidationError>>
Register a DAG workflow definition and return its ID.
Validates the workflow before registering. Returns an error with validation details if the workflow is invalid.
Sourcepub async fn execute_workflow(
&self,
workflow_id: &WorkflowId,
input: String,
memory: Arc<MemorySubstrate>,
driver: Arc<dyn LlmDriver>,
model_config: &ModelConfig,
) -> PunchResult<WorkflowRunId>
pub async fn execute_workflow( &self, workflow_id: &WorkflowId, input: String, memory: Arc<MemorySubstrate>, driver: Arc<dyn LlmDriver>, model_config: &ModelConfig, ) -> PunchResult<WorkflowRunId>
Execute a sequential workflow with the given input string.
Sourcepub fn get_run(&self, run_id: &WorkflowRunId) -> Option<WorkflowRun>
pub fn get_run(&self, run_id: &WorkflowRunId) -> Option<WorkflowRun>
Get a workflow run by its ID.
Sourcepub fn list_workflows(&self) -> Vec<Workflow>
pub fn list_workflows(&self) -> Vec<Workflow>
List all registered sequential workflows.
Sourcepub fn list_dag_workflows(&self) -> Vec<DagWorkflow>
pub fn list_dag_workflows(&self) -> Vec<DagWorkflow>
List all registered DAG workflows.
Sourcepub fn list_runs(&self) -> Vec<WorkflowRun>
pub fn list_runs(&self) -> Vec<WorkflowRun>
List all workflow runs.
Sourcepub fn list_runs_for_workflow(
&self,
workflow_id: &WorkflowId,
) -> Vec<WorkflowRun>
pub fn list_runs_for_workflow( &self, workflow_id: &WorkflowId, ) -> Vec<WorkflowRun>
List workflow runs filtered by workflow ID.
Sourcepub fn get_workflow(&self, id: &WorkflowId) -> Option<Workflow>
pub fn get_workflow(&self, id: &WorkflowId) -> Option<Workflow>
Get a sequential workflow by its ID.
Sourcepub fn get_dag_workflow(&self, id: &WorkflowId) -> Option<DagWorkflow>
pub fn get_dag_workflow(&self, id: &WorkflowId) -> Option<DagWorkflow>
Get a DAG workflow by its ID.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorkflowEngine
impl !RefUnwindSafe for WorkflowEngine
impl Send for WorkflowEngine
impl Sync for WorkflowEngine
impl Unpin for WorkflowEngine
impl UnsafeUnpin for WorkflowEngine
impl UnwindSafe for WorkflowEngine
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