Skip to main content

🌊 hexaflow

Lightweight, embeddable Python workflow engine with stages, steps, splits, joins, and checkpointed resumption.

PyPI: hexaflow Python 3.13+ License: Apache 2.0


🎯 Vision & Architectural Intent

hexaflow is a zero-daemon, localhost-first workflow engine for Python developers who need resilient, multi-stage, multi-step execution graphs without the operational overhead of running heavy external schedulers (Airflow, Temporal, Prefect).

Key Features

  • Hierarchical Execution: Workflows structured cleanly into Stages and Steps.
  • DAG Splits & Joins: Concurrently fan-out (split) and synchronize at barrier dependencies (join).
  • Fault Partitioning: Transient retries with exponential backoff vs. permanent failure suspension (SUSPENDED).
  • Checkpointed Resumption: Automatically saves step inputs and outputs into an embedded SQLite store. Resume failed workflows from the point of failure without re-running completed steps.
  • Dual DSL: Decorator-based syntax for Pythonic simplicity (@wf.stage, @wf.step) alongside declarative classes for programmatic pipelines.

📦 Installation

pip install hexaflow

Or using uv:

uv add hexaflow

⚡ Quickstart

from hexaflow import RetryPolicy, StageExecutionMode, Workflow

wf = Workflow(name="order_pipeline", version="1.0.0")

# Stage 1: Validation
@wf.stage("validation")
@wf.step("validate_cart", retries=RetryPolicy(max_attempts=3))
def validate_cart(ctx) -> dict:
    return {"order_id": "ord_101", "total_usd": 150.00}

# Stage 2: Parallel Processing (Split / Fan-Out)
@wf.stage("processing", execution_mode=StageExecutionMode.CONCURRENT_ALL)
@wf.step("authorize_payment", depends_on=["validate_cart"])
def authorize_payment(ctx) -> dict:
    cart = ctx.inputs["validate_cart"]
    return {"status": "PAID", "amount": cart["total_usd"]}

@wf.stage("processing")
@wf.step("reserve_inventory", depends_on=["validate_cart"])
def reserve_inventory(ctx) -> dict:
    return {"warehouse": "US-EAST-1", "reserved": True}

# Stage 3: Fulfillment (Join Barrier)
@wf.stage("fulfillment")
@wf.step("create_shipping_label", depends_on=["authorize_payment", "reserve_inventory"])
def create_shipping_label(ctx) -> dict:
    return {"tracking_id": "TRK-9812739"}

if __name__ == "__main__":
    state = wf.run()
    print(f"Workflow {state.run_id} completed with status: {state.status.value}")

🖥️ Command Line Interface (CLI)

hexaflow includes a fast, zero-daemon CLI (hexaflow or hf):

# Run a workflow directly
hf run examples/order_pipeline.py:wf

# Check run status & step timing
hf status <run_id>

# Inspect step inputs, outputs, or error tracebacks
hf inspect <run_id> create_shipping_label

# Resume a suspended workflow from its latest checkpoint
hf resume <run_id>

# Clear checkpoints and restart a workflow from scratch
hf restart <run_id>

# Abort a workflow and execute compensating rollback actions
hf abort <run_id>

🏛️ Ecosystem Alignment

hexaflow is part of the Hexa architectural ecosystem:

  • hexaflow (this repository): Lightweight, zero-daemon, localhost-first DAG workflow engine.
  • hexastack: Monorepo framework providing CQRS, Event Sourcing, FastAPI, and out-of-the-box DevTools.
  • hexaqueue: Flagship distributed batch & HPC cluster scheduler.

📄 License

Apache 2.0. See LICENSE for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hexaflow-0.1.1.tar.gz (96.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hexaflow-0.1.1-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

Details for the file hexaflow-0.1.1.tar.gz.

File metadata

  • Download URL: hexaflow-0.1.1.tar.gz
  • Upload date:
  • Size: 96.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hexaflow-0.1.1.tar.gz
Algorithm Hash digest
SHA256 94d3ba7ce3230d4eafe71126dfe3aa17b80b635bc12413c4cc77c56be068e7ad
MD5 911055b317dac60f513f4bdde41e0c42
BLAKE2b-256 30db51ce728987e3a270a247079edcc95cd306b9b2ffa0d02051f36ac8a70e6b

See more details on using hashes here.

File details

Details for the file hexaflow-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: hexaflow-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hexaflow-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 14e0264ed9fab612bd2a7186b9e0aadf5e37f824f1abfe5e36a93e490e622203
MD5 45ef53efe11ebee4dcc281ce73987320
BLAKE2b-256 e29369b9ab8f4ade042cbd9a196c1bcdb478ac072da510681a22e205cef793a4

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page