Effortlessly build workflow pipelines

The powerful, lightweight and flexible workflow management framework for Python

simple_workflow.py
import asyncio
from zuma import ZumaWorkflow, ZumaActionStep, ZumaRunner


class DataFetchStep(ZumaActionStep):
    async def execute(self, context):
        return {"data": "fetched_data"}


class ProcessingStep(ZumaActionStep):
    async def execute(self, context):
        data = context.get("data")
        return {"processed": f"processed_{data}"}


if __name__ == "__main__":
    asyncio.run(
        ZumaRunner().run_workflow(
            ZumaWorkflow(
                "Simple Workflow",
                steps=[
                    DataFetchStep(),
                    ProcessingStep(),
                ],
            )
        )
    )

Features

Async First

Built with asyncio for maximum performance and concurrency

Type Safe

Full type hints support for better IDE integration

Parallel Execution

Execute multiple steps concurrently with controlled concurrency

Error Handling

Comprehensive error handling with retries and failure strategies

Conditional Flows

Dynamic workflow paths based on runtime conditions

Monitoring

Detailed execution tracking and progress reporting

Workflow Visualization

Generate clear Mermaid diagrams to visualize workflow paths, retries, and error handling.

Examples

simple_example.py
"""Simple Sequential Workflow Example"""
import asyncio
from zuma import ZumaWorkflow, ZumaActionStep, ZumaRunner


class DataFetchStep(ZumaActionStep):
    async def execute(self, context):
        return {"data": "fetched_data"}


class ProcessingStep(ZumaActionStep):
    async def execute(self, context):
        data = context.get("data")
        return {"processed": f"processed_{data}"}


if __name__ == "__main__":
    asyncio.run(
        ZumaRunner().run_workflow(
            ZumaWorkflow(
                "Simple Workflow",
                steps=[
                    DataFetchStep(),
                    ProcessingStep(),
                ],
            )
        )
    )