Skip to main content

Crate szal

Crate szal 

Source
Expand description

§Szál — Workflow Engine

Szál (Hungarian: thread) provides shared workflow execution for the AGNOS ecosystem. Define steps, wire them into flows with branching, retry, and rollback — then execute sequentially, in parallel, or as a DAG.

§Quick start

use szal::step::StepDef;
use szal::flow::{FlowDef, FlowMode};

// Build a DAG pipeline
let build = StepDef::new("build");
let test = StepDef::new("test").depends_on(build.id);
let deploy = StepDef::new("deploy")
    .depends_on(test.id)
    .with_retries(3, 5_000)
    .with_rollback();

let mut flow = FlowDef::new("ci-cd", FlowMode::Dag);
flow.add_step(build);
flow.add_step(test);
flow.add_step(deploy);
flow.validate().unwrap();

§Modules

  • step — Individual workflow steps with timeout, retry, rollback, DAG dependencies
  • flow — Flow definitions: sequential, parallel, DAG, hierarchical
  • engine — Execution configuration and flow result aggregation
  • state — Workflow state machine with validated transitions
  • migration — Flow versioning and schema migration across definition versions
  • stream — Stream step progress to SSE / WebSocket clients via a broadcast hub

Modules§

bus
Workflow event bus — powered by majra pub/sub.
condition
Lightweight condition expression evaluator for workflow step conditions.
engine
Execution engine — runs flows with retry, timeout, and rollback.
flow
Flow definitions — how steps are wired together.
mcp
MCP tool implementations for szal workflows.
migration
Flow versioning and migration.
state
Workflow state machine and persistence.
step
Workflow steps — the atomic unit of work.
storage
Workflow storage trait for dynamic subworkflow resolution.
stream
Streaming step progress over SSE / WebSocket transports.

Enums§

SzalError

Type Aliases§

Result