Skip to main content

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 .py files 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 .py file 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.

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_enabled only 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:

  1. DAGs created in DagSmith — full visual editing with remembered layout.
  2. Typical hand-written DAGs (with DAG(...), @dag, @task, >>, chain(), nested TaskGroups, edge Labels) — full visual editing without touching your formatting.
  3. 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

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airflow_dagsmith-0.1.0.tar.gz (473.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

airflow_dagsmith-0.1.0-py3-none-any.whl (395.3 kB view details)

Uploaded Python 3

File details

Details for the file airflow_dagsmith-0.1.0.tar.gz.

File metadata

  • Download URL: airflow_dagsmith-0.1.0.tar.gz
  • Upload date:
  • Size: 473.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for airflow_dagsmith-0.1.0.tar.gz
Algorithm Hash digest
SHA256 655f008ac80889a0fb628c9ccfc2880077c6947f33164dd53b5c855c98defb95
MD5 7f7aae096bd6629459b4e6d70c2fdf86
BLAKE2b-256 07131b94d3e175b8dab997854940ac24aa0b82b417d10947c8c5cfa95dcb966d

See more details on using hashes here.

Provenance

The following attestation bundles were made for airflow_dagsmith-0.1.0.tar.gz:

Publisher: release.yml on byteway-pl/DagSmith

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file airflow_dagsmith-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_dagsmith-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a9ad4409de9d62f5cc8931aef703b80d8a5d3d9b636af79c9687c3dedb53db9
MD5 8c226b92e6c516a3f44253e39a01bca0
BLAKE2b-256 a00e78def9daa7720f3867cd85d55493b1d2e12c8855f816d8cd3b5e4b9b4138

See more details on using hashes here.

Provenance

The following attestation bundles were made for airflow_dagsmith-0.1.0-py3-none-any.whl:

Publisher: release.yml on byteway-pl/DagSmith

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page