Function execute_workflow

Source
pub async fn execute_workflow(
    workflow: &Arc<RwLock<Workflow>>,
) -> Result<(), WorkflowError>
Expand description

Execute the workflow asynchronously This function will be called to start the workflow execution process and does the following:

  1. Iterates over workflow tasks while the shared workflow is not complete.
  2. Resets any failed tasks to allow them to be retried. This needs to happen before getting ready tasks.
  3. Gets all ready tasks
  4. For each ready task: /// - Marks the task as running /// - Checks previous tasks for injected context /// - Gets the agent for the task
    /// - Spawn a new tokio task and execute task with agent /// - Push task to the handles vector
  5. Waits for all spawned tasks to complete