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:
- Iterates over workflow tasks while the shared workflow is not complete.
- Resets any failed tasks to allow them to be retried. This needs to happen before getting ready tasks.
- Gets all ready tasks
- 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 - Waits for all spawned tasks to complete