Prefect is an orchestration framework focused on simplicity. Add a decorator to a function and you get a workflow with retry, logging, and monitoring.
Prefect — Orchestration for Python Developers¶
Just @flow and @task decorators — no special infrastructure needed.
from prefect import flow, task
@task(retries=3)
def extract(url: str) -> dict:
import httpx
return httpx.get(url).json()
@task
def transform(raw: dict) -> list:
return [{**r, 'czk': r['eur'] * 25.2} for r in raw['data']]
@task
def load(records: list) -> int:
save_to_db(records)
return len(records)
@flow(name="Sales Pipeline", log_prints=True)
def pipeline():
raw = extract("https://api.example.com/sales")
data = transform(raw)
print(f"Loaded {load(data)} records")
Orchestrator Comparison¶
- Prefect — easiest to start with, small teams
- Airflow — largest ecosystem, enterprise standard
- Dagster — asset-oriented, data platforms
Summary¶
Prefect is ideal for quickly orchestrating Python workflows without unnecessary complexity.
prefectorchestraceworkflowpython