Examples

Runnable example DAGs covering the common authoring patterns.

A gallery of ready-to-run DAGs under examples/, covering every Leoflow task type and the common patterns. Each is compile-valid (leoflow compile) and authored parser-safe (heavy imports live inside the tasks). Run any of them with:

leoflow lite examples/<name>      # hot-reload at http://localhost:8088, then Trigger
ExampleShowsTask typeDeps
taskflow_salesTaskFlow ETL, data via XCompython
xcom_typedtyped XCom payloads + validationpython
ml_hparam_searchmap-reduce ML pattern: parallel trials → pick bestpython
fan_out_aggregatefan-out to N shards → fan-in aggregate (map-reduce)python
montecarlo_piparallel π estimate (Monte Carlo map-reduce)python
http_jsonplaceholdercall a public JSON APIpythonrequests
weather_open_meteopublic weather API (no key)pythonrequests
api_chainchain two API callspythonrequests
duckdb_http_csvDuckDB reads a remote CSV, aggregatespythonduckdb
postgres_loadload to external Postgres via a Connectionpythonpsycopg2
csv_reportscheduled (cron 0 6 * * *) reportpython
bash_pipelineshell tasksbash (BashOperator)
http_operatorHTTP request run in a podairflow_operator (HttpOperator, ADR 0047)

The core Leoflow task types are represented — python (TaskFlow @task / PythonOperator) and bash (BashOperator), both run in a pod. An HttpOperator compiles to an airflow_operator and runs in a pod too (ADR 0040); the old native inline http_api type was removed (ADR 0047/0048, #512). For a measured ~1 GB pipeline see the ETL case study.

Removing a DAG (clear vs. deregister)

Leoflow is GitOps: the source is the source of truth, so deleting is two distinct actions (ADR 0020).

ActionEffect
Clear history (UI trash · leoflow dags delete <id>)deletes runs/tasks; the DAG stays registered
Deregister (leoflow dags delete <id> --deregister)removes the DAG artifact (DAG + versions)

But deregister alone is not permanent while the source exists — it gets re-registered:

  • Lite (leoflow lite): the watcher re-registers the DAG on the next reload. To remove it for good, delete the DAG’s file (or stop/point leoflow lite elsewhere).
  • Pro (CI deploy): the next deploy that still includes the DAG re-registers it as a new version. To remove it for good, drop it from the repo/CI, then optionally deregister to clear what is registered now.
  • Demo: seeded once at boot with no watcher/CI re-registering, so a clear or deregister sticks until you re-seed.

In short: to truly remove a DAG, remove its source (file in Lite, repo in prod); --deregister just clears the current registration. (The embedded Airflow UI’s trash maps to clear history; an explicit “Clear vs Deregister” dialog is planned for the custom UI — ADR 0018/0020.)