Request a demo
Guide

A practical guide to moving hand-written DAGs into the designer

How to choose which Airflow DAGs to redraw first, map their operators onto nodes, run old and new side by side, and retire the hand-written version without a gap.

October 30, 2026 · 6 min read · All articles

Nobody starts with a clean slate. A team adopting InsightDataFlow usually has dozens or hundreds of Airflow DAGs already, written by different people over several years. Redrawing all of them is neither necessary nor wise. This guide is a way to move the ones that benefit, in an order that keeps every pipeline running.

Step 1: triage

List your DAGs and, for each, answer two questions: how many other DAGs look like it, and how closely do its steps match nodes that already exist? The top-right quadrant (many similar DAGs whose steps map onto nodes) is where the designer pays off most, because each move makes the next one quicker to review. Hand-written one-offs full of custom logic can stay hand-written.

Step 2: map operators onto nodes

In a typical hand-written DAGNode in the library
FileSensor / S3KeySensorFILE_WATCHER
PythonOperator: csv → parquetFILE_PREPROCESS
PostgresOperator: COPY …LOAD_DATABASE
SQL INSERT … SELECTLOAD_DATABASE (query source)
count check in PythonRECORD_COUNT_VALIDATION
BashOperator: dbt testDBT_TEST
SimpleHttpOperatorAPI / HTTP_REQUEST
EmailOperatorSEND EMAIL

The mapping is rarely one-to-one. A PythonOperator that downloads, converts and loads in one function becomes three nodes, which is the point: each step now fails, retries and shows up in Airflow under its own name. Where a step genuinely has no node, keep it small with SHELL, API or FUNCTION, and note it as a candidate for a proper node. An INSERT … SELECT maps to a LOAD_DATABASE whose input source is the query. See the node library.

A node dialog for a LOAD_DATABASE step: name, description, input source Parquet, Parquet file path with a date template, location name warehouse and table name shipments.
Parameters replace code: what was a COPY statement in a PythonOperator becomes a LOAD_DATABASE node with a source path, a location and a table.

What changes in behaviour

Mapping operators is the visible part. The quieter part is the DAG-level behaviour, because every generated DAG uses the same settings, and your hand-written DAG may not:

In the old DAGIn the generated DAGWhat to check
Retries set per task or per DAGOne retry, five minutes later, for every taskSteps that relied on many retries, such as a flaky API
A sensor with a poke interval and a timeoutFILE_WATCHER checks when it runs; no wait time of its ownThe schedule has to sit after the files usually arrive
catchup=True and a historic start datecatchup=False, a fixed 2024 start dateBackfills become deliberate, not automatic
Several runs in parallelmax_active_runs=1Pipelines that were sized to overlap
Pools, priority weights, SLAsNot set by the generatorAnything that depended on them for scheduling
Failure emails to a team listFailure email on, to the address in the generator's templateThat the address is one someone reads

Step 3: move connections to data locations

Hand-written DAGs tend to reference Airflow connections by id, environment variables, or worse, inline credentials. In the designer, nodes point at data locations by name. Register a location for each system the DAGs touch before you start, with the same name in development and production, so a design deploys unchanged to both.

Do not copy secrets into parameters. If an old DAG has a password in it, the move is the moment to fix that. Move the credential into a data location instead: a value typed into a free-text parameter is part of the design and lands in the generated files. A location's own connection details are also written into the deployed config.yaml, but in one known place you can restrict, not scattered through the design.

Step 4: run side by side

  1. Give the new workflow a different DAG id from the old one (the workflow name becomes the id).
  2. Point the new pipeline's outputs at a shadow schema or table for the trial.
  3. Deploy to production and let both run on the same schedule for a week or a month-end, whichever matters more.
  4. Compare outputs with a RECORD_COUNT_VALIDATION between the real and shadow tables, plus any deeper comparison you run outside the pipeline.
  5. When they agree, switch the new pipeline's targets to the real tables, pause the old DAG, and delete it after one more cycle.

A worked example

Example, made up: Northbeam Logistics has a hand-written DAG, depot_fuel_report, written two years ago. A PythonOperator downloads a CSV from SFTP, converts it to Parquet and copies it into the warehouse with a hand-built connection string; a second one runs a SQL statement; a third emails a summary. It has five retries on the download because the SFTP server is unreliable.

  1. Split the first function into SFTP (fetch), FILE_PREPROCESS (convert) and LOAD_DATABASE (load), and register the SFTP server and the warehouse as data locations. The connection string disappears from the code.
  2. Keep the SQL statement as it is. It is an INSERT … SELECT, so it becomes the query of a query-sourced LOAD_DATABASE (a statement of another kind runs from a SHELL step with the warehouse's command-line client), and the team puts a RECORD_COUNT_VALIDATION after the load, which the old DAG never had.
  3. Notice the retries. Five retries become one. The team decides to move the schedule thirty minutes later instead, when the SFTP server is usually quiet, and to watch the first month.
  4. Run side by side into a shadow table for one month-end, then switch, pause the old DAG and delete it a cycle later.

Nothing in this example is a benchmark. Its point is the order of decisions: split, relocate credentials, add a check, and make an explicit choice wherever the generated defaults differ from the old DAG.

Before you switch off the old DAG

  1. The outputs agreed over a full cycle that includes your busiest day (a month-end, a Monday).
  2. Every credential the old DAG carried is now in a data location, and nobody pasted one into a parameter.
  3. The generated files are copied into version control, because the product keeps only the latest generation.
  4. Whoever is on call has seen the new DAG fail once in development and knows which task names mean what.
  5. You have a plan for removing DAG files from Airflow: deleting a workflow in InsightDataFlow leaves its deployed files in place.

Step 5: keep it from drifting back

  • Never hand-edit a generated DAG. The next regeneration overwrites it. Change the design and regenerate.
  • Review YAML, not screenshots. Ask for the generated config.yaml and properties.yaml in every change.
  • Fill in the metadata. Source, catalog, category, priority and load type are what let a platform team filter the list later.
  • Turn escape hatches into nodes. When three workflows use the same SHELL step, it deserves a node.
Estimate the effort on your own estate. The time a move takes depends on how alike your DAGs are and how much custom code they hold; the triage above is how to size it.

Back to the start: what InsightDataFlow is.

Draw one of your pipelines with us

Bring a pipeline you run today, hand-written or scheduled somewhere else. We will draw it in the designer, generate the DAG and walk through deploying it to your Airflow.

Request a demo