Visual block-based and code DAG editor inside the Apache Airflow 3 UI
Project description
DagSmith
A visual, block-based DAG editor for Apache Airflow 3 — right inside the Airflow UI.
DagSmith is an Airflow plugin (Airflow ≥ 3.1) that adds a full DAG editor to the Airflow web UI:
- 🧱 Visual editor — build DAGs from blocks: drag operators from a searchable
palette onto a canvas, connect them with dependency edges (tasks and TaskGroups),
configure parameters in typed forms (key:value editors for dicts, a rich-text editor
for HTML fields, connection pickers for
conn_ids, a cron builder for schedules). - ✍️ Code editor — edit the
.pyfiles in CodeMirror with syntax and import validation before anything is deployed. - 🔁 Two-way sync, code is the source of truth — canvas edits are applied to your
file as minimal, surgical changes (via libcst);
comments and formatting you didn't touch stay byte-for-byte identical. Editing the
code updates the canvas. Dynamic constructs (loops,
.partial().expand()) appear as code-only blocks instead of breaking the parser. - 🧰 Auto-generated operator palette — installed provider packages are introspected
(operators, sensors, their
__init__signatures across the class hierarchy), so hundreds of blocks with typed parameter forms appear without any manual definitions. - 💾 Draft → Deploy — work-in-progress is saved as versioned drafts in the Airflow
metadata database (with autosave, history, diffs and restore). The live
.pyfile changes only when you hit Deploy, after validation, with a backup and conflict detection. The scheduler never sees half-finished work. - 👥 Teams — give each team a directory in a DAG bundle and a git repository: members-only editing, per-DAG reassignment by admins, team-tagged DAGs, and a Commit & push button (GitHub/GitLab) plus optional push-on-deploy.
- 🔒 Safety by default — deploy is disabled until explicitly enabled, all endpoints are authorized through the Airflow Auth Manager, user code is only ever executed in an isolated subprocess, every path is confined to the bundle root, and every deploy is audit-logged.
Demo
Requirements
| Component | Version |
|---|---|
| Apache Airflow | ≥ 3.1 (uses the react_apps + fastapi_apps plugin APIs; no Airflow 2.x support) |
| Python | ≥ 3.10 |
| Metadata DB | PostgreSQL recommended (DagSmith stores drafts in its own dagsmith_* tables) |
| File access | to deploy, the Airflow api-server needs write access to the DAG bundle directory; working on drafts needs no file access at all |
Installation
pip install airflow-dagsmith # in the environment running the Airflow api-server
The plugin registers itself via the airflow.plugins entry point — don't copy anything
into $AIRFLOW_HOME/plugins. After restarting the api-server, DagSmith appears in
the Airflow navigation. Its dagsmith_* tables are created automatically on startup
(or run python -m dagsmith db upgrade manually).
Enabling deploy
For safety, writing .py files is off by default — without it DagSmith works in
read-and-draft mode. Enable it consciously:
[dagsmith]
deploy_enabled = True
# optional hardening / team split:
# editors = data-platform-team # who can create and edit drafts
# deployers = admin # who can write .py files
# admins = admin # who manages teams
# git_commit = True # commit to the bundle checkout on deploy
(or AIRFLOW__DAGSMITH__DEPLOY_ENABLED=True etc.)
⚠️ Security note: deploying DAGs from the UI is equivalent to executing arbitrary code in your Airflow environment — exactly like shipping a DAG file any other way. Enable
deploy_enabledonly with proper access control on the Airflow UI. Import validation executes the file's top level in an isolated, time-limited subprocess.
How it works
Airflow UI ─▶ react_app "DagSmith" (React Flow canvas + CodeMirror)
│ REST /dagsmith/api/v1 (Airflow JWT)
▼
FastAPI app inside the api-server
│ parse (libcst) / codegen / validation (subprocess)
┌────────────┴────────────┐
Save / autosave Deploy (validated)
▼ ▼
Airflow metadata DB .py files in the DAG bundle
(draft versions, (atomic write, backup,
canvas layout) conflict detection, git)
Three tiers of support for existing code:
- DAGs created in DagSmith — full visual editing with remembered layout.
- Typical hand-written DAGs (
with DAG(...),@dag,@task,>>,chain(), nested TaskGroups, edgeLabels) — full visual editing without touching your formatting. - Dynamic constructs (task-generating loops,
.expand()) — shown on the canvas as read-only blocks, editable in the code view.
Development
pip install -e ".[dev]"
pytest # backend (incl. byte-exact round-trip corpus)
cd frontend && npm install
npm run build # UMD bundle -> src/dagsmith/static/
npm test && npm run lint
The frontend follows Airflow's AIP-68 react-plugin contract (single UMD bundle, host provides React); everything ships inside the bundle — no CDNs.
Support the project
If DagSmith saves you time, you can buy me a coffee ☕
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file airflow_dagsmith-0.2.0.tar.gz.
File metadata
- Download URL: airflow_dagsmith-0.2.0.tar.gz
- Upload date:
- Size: 477.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b47c236e5b8a8384d4fb36621f860acb59b8d94c35b5202de2d4552ca5b269b
|
|
| MD5 |
f3289d2241b61aed4d9d2caae4fa26f1
|
|
| BLAKE2b-256 |
b8b6055e0374488ece4e74ce6831a6940e7d27322421341960daed5171702582
|
Provenance
The following attestation bundles were made for airflow_dagsmith-0.2.0.tar.gz:
Publisher:
release.yml on byteway-pl/DagSmith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
airflow_dagsmith-0.2.0.tar.gz -
Subject digest:
4b47c236e5b8a8384d4fb36621f860acb59b8d94c35b5202de2d4552ca5b269b - Sigstore transparency entry: 2204126560
- Sigstore integration time:
-
Permalink:
byteway-pl/DagSmith@23874d63cc5e9057ddeac8236eb6454c9d30c4b8 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/byteway-pl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@23874d63cc5e9057ddeac8236eb6454c9d30c4b8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file airflow_dagsmith-0.2.0-py3-none-any.whl.
File metadata
- Download URL: airflow_dagsmith-0.2.0-py3-none-any.whl
- Upload date:
- Size: 398.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aacf79c655d0b6e6447e42e1ee7fed69bc2deeb624a5870c6a3c3f64187c4c1c
|
|
| MD5 |
241bf5705a11224c3d5cfcb7572db34a
|
|
| BLAKE2b-256 |
f4ccfaf2b601ee6c3ed0e541b007d5599e84a7cca1e46b93376b1ae6b4c2dbf7
|
Provenance
The following attestation bundles were made for airflow_dagsmith-0.2.0-py3-none-any.whl:
Publisher:
release.yml on byteway-pl/DagSmith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
airflow_dagsmith-0.2.0-py3-none-any.whl -
Subject digest:
aacf79c655d0b6e6447e42e1ee7fed69bc2deeb624a5870c6a3c3f64187c4c1c - Sigstore transparency entry: 2204126617
- Sigstore integration time:
-
Permalink:
byteway-pl/DagSmith@23874d63cc5e9057ddeac8236eb6454c9d30c4b8 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/byteway-pl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@23874d63cc5e9057ddeac8236eb6454c9d30c4b8 -
Trigger Event:
push
-
Statement type: