Crate deltaflow

Crate deltaflow 

Source
Expand description

§Deltaflow

The embeddable workflow engine.

Pipeline visualization

Type-safe, Elixir-inspired pipelines that run in your process. No infrastructure required.

§Why Deltaflow?

  • Type-safe composition - Compiler enforces step output matches next step’s input
  • Elixir-inspired - Declarative pipelines via method chaining, not scattered callbacks
  • Observable by default - Every run and step recorded for debugging
  • Embeddable - A library, not a service. Runs in your process.

§Quick Start

use deltaflow::{Pipeline, Step, StepError, RetryPolicy, NoopRecorder};

let pipeline = Pipeline::new("my_workflow")
    .start_with(ParseInput)
    .then(ProcessData)
    .then(FormatOutput)
    .with_retry(RetryPolicy::exponential(3))
    .with_recorder(NoopRecorder)
    .build();

let result = pipeline.run(input).await?;

§Forking and Fan-out

Route output to multiple downstream pipelines:

let pipeline = Pipeline::new("router")
    .start_with(ValidateStep)
    .fork_when(|data| data.priority == "high", "fast_track")
    .fork_when(|data| data.needs_review, "review").desc("needs_review")
    .fan_out(&["analytics", "archival"])
    .emit("notifications", |data| vec![Notification::from(data)])
    .build();

§Web Visualizer

Use deltaflow-harness for interactive pipeline visualization:

use deltaflow_harness::RunnerHarnessExt;

let runner = RunnerBuilder::new(store)
    .pipeline(my_pipeline)
    .with_visualizer(3000)
    .build();

§Feature Flags

  • sqlite - Enable SQLite-backed recording and task storage

Re-exports§

pub use pipeline::BuiltPipeline;
pub use pipeline::EmitNode;
pub use pipeline::FanOutNode;
pub use pipeline::ForkNode;
pub use pipeline::HasEntityId;
pub use pipeline::Metadata;
pub use pipeline::Pipeline;
pub use pipeline::PipelineError;
pub use pipeline::PipelineGraph;
pub use pipeline::SpawnRule;
pub use pipeline::StepNode;
pub use recorder::NoopRecorder;
pub use recorder::Recorder;
pub use recorder::RunId;
pub use recorder::RunStatus;
pub use recorder::StepId;
pub use recorder::StepStatus;
pub use retry::RetryPolicy;
pub use step::Step;
pub use step::StepError;

Modules§

pipeline
Pipeline builder and executor.
recorder
Recording interface for pipeline execution history.
retry
Retry policy configuration.
step
Step trait and error types.