use dsl_flow::*; #[tokio::main] async fn main() -> Result<(), Box> { tracing_subscriber::fmt().with_env_filter("info").init(); let store = InMemoryStateStore::default(); let engine = FlowEngine::new(store, FlowOptions { stateful: false, expr_engine: ExprEngineKind::Rhai }); let flow = Flow::new(sequence! { expr_set(ExprEngineKind::Rhai, "1 + 2", "calc.sum"), fork_join! { expr_set(ExprEngineKind::Rhai, "ctx.calc.sum * 2", "calc.double"), expr_set(ExprEngineKind::Rhai, "ctx.calc.sum * 3", "calc.triple") } }); let ctx = Context::new(); let out = engine.run_stateless(&flow, ctx).await?; println!("{}", serde_json::to_string_pretty(&out.data)?); Ok(()) }