use periplon_sdk::{parse_workflow_file, validate_workflow, DSLExecutor};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let workflow_path = "examples/dsl/simple_file_organizer.yaml";
println!("Loading workflow from: {}", workflow_path);
let workflow = parse_workflow_file(workflow_path)?;
println!("Loaded workflow: {} v{}", workflow.name, workflow.version);
println!("Validating workflow...");
validate_workflow(&workflow)?;
println!("Workflow validation passed");
println!("Creating executor...");
let mut executor = DSLExecutor::new(workflow)?;
println!("Initializing executor...");
executor.initialize().await?;
println!(
"Executor initialized with {} tasks",
executor.get_task_count()
);
println!("\n=== Starting workflow execution ===\n");
executor.execute().await?;
println!("\n=== Workflow execution complete ===\n");
executor.shutdown().await?;
Ok(())
}