Workflow Orchestration Made Simple for Python
Build distributed, durable, long-running business processes with straightforward Python code. Event sourcing, automatic recovery, and horizontal scaling — all built in.
$ pip install pyworkflow-engineEverything you need for production workflows
Built on battle-tested Celery and Redis. PyWorkflow handles the hard parts of distributed systems so you can focus on business logic.
Distributed Execution
Workflows execute across Celery workers for horizontal scaling. Start with one worker, scale to hundreds.
Event Sourcing & Durability
Every state change is recorded as an event. Workflows recover from any failure through deterministic replay.
Automatic Recovery
Configurable retry strategies with backoff. Distinguishes between transient and permanent failures automatically.
Sleep for Days
Suspend workflows for minutes, days, or months without holding connections, threads, or memory. Resume automatically.
Built-in Scheduling
Run workflows on cron, intervals, or calendar-based schedules. No external scheduler needed.
Complete Audit Trail
Append-only event log gives you full visibility into every workflow execution. Debug with ease.
Just Python. No YAML. No DSLs.
Define workflows with decorators and async functions you already know. Steps are retryable, workflows are durable, and sleeps release all resources.
- Decorate functions as @workflow and @step
- Await steps like regular async calls
- Sleep for days without consuming resources
- Automatic retry on transient failures
from pyworkflow import workflow, step, start, sleep
@step()
async def send_welcome_email(user_id: str):
print(f"Sending welcome email to {user_id}")
return f"Email sent to {user_id}"
@step()
async def send_tips_email(user_id: str):
print(f"Sending tips email to {user_id}")
return f"Tips sent to {user_id}"
@workflow()
async def onboarding(user_id: str):
await send_welcome_email(user_id)
await sleep("1d") # Sleeps 1 day, no resources held
await send_tips_email(user_id)
return "Onboarding complete"
run_id = start(onboarding, user_id="user_123")Built for real-world use cases
From simple automations to complex multi-step business processes, PyWorkflow handles it all.
User Onboarding
Multi-step onboarding flows with timed emails, verification checks, and progressive engagement sequences.
Welcome email → wait 1 day → tips email → wait 3 days → surveyOrder Processing
End-to-end order pipelines handling payment, inventory, fulfillment, and customer notifications.
Validate → charge → reserve inventory → ship → notifyETL & Data Pipelines
Extract, transform, and load data across systems with automatic retry on transient failures.
Extract API → transform → validate → load DB → reportApproval Workflows
Human-in-the-loop workflows that pause for manual approvals via webhooks or external events.
Submit request → await approval → provision → notifyScheduled Jobs
Recurring workflows on cron, interval, or calendar schedules with built-in scheduling.
Every Monday 9am → generate report → email teamDrip Campaigns
Multi-touch marketing sequences with precise timing, conditions, and personalization.
Sign up → wait 2h → email 1 → wait 3d → email 2Up and running in 5 minutes
From zero to production-ready workflows in three simple steps.
Install & Scaffold
Install PyWorkflow with pip and scaffold your project in seconds with the CLI.
pip install pyworkflow-engine
pyworkflow quickstartDefine Your Workflows
Write workflows and steps using simple Python decorators and async functions.
@workflow()
async def my_flow(data):
result = await my_step(data)
return resultRun & Scale
Start the worker and run your workflows. Scale horizontally by adding more workers.
pyworkflow worker run
pyworkflow workflows run my_flow \
--input '{"key": "value"}'Join the community
PyWorkflow is open source and community-driven. Get involved, ask questions, and help shape the future of workflow orchestration in Python.