flowbuilder_core/executor.rs
1use crate::Step;
2use anyhow::Result;
3use flowbuilder_context::SharedContext;
4
5/// Executes flow steps
6pub struct FlowExecutor;
7
8impl FlowExecutor {
9 pub fn new() -> Self {
10 Self
11 }
12
13 /// Execute a list of steps sequentially
14 pub async fn execute_steps(
15 &self,
16 steps: Vec<Step>,
17 context: SharedContext,
18 ) -> Result<()> {
19 for step in steps {
20 step(context.clone()).await?;
21 }
22 Ok(())
23 }
24}
25
26impl Default for FlowExecutor {
27 fn default() -> Self {
28 Self::new()
29 }
30}