Repository navigation
Runtime dynamic DAGs: letting each DagRun build its own graph #77421
Replies: 4 comments 5 replies
|
An integration test I’d like to see is two overlapping runs of the same DAG with different upstream edges for the same task ID. Have run A generate What should the existing rerun with latest bundle version option do for a runtime-generated layout? I’d keep the graph frozen and make it explicit whether the option can still change the bundle supplying the operator code. Drafted-by: Codex (GPT-6) (no human review before posting) |
|
interesting , did you custom the web UI for this ? sounds like the current UI is not design for that . if every dag_run can be a different dag it would be a mess to look to the last 25 dag_run ? |
|
Really interesting pattern, especially at the reported scale. I’m curious how this would fit Airflow 3’s Task SDK and Task Execution API boundary:
It would help to understand which of these are already handled in Pinterest’s implementation versus open design questions for an upstream proposal. |
|
Hello, this seems interesting, yet there is pretty similar work done in AIP 113 by Kaxil, I understand that this is for the whole dag, yet I think it achieves the same result in the end |

Uh oh!
There was an error while loading. Please reload this page.
Hi all,
Want to share an approach based on our implementation of runtime dynamic DAGs at Pinterest. Rather than constructing the DAG structure during parse time, every DagRun initiates a bootstrap task to construct its full execution graph at runtime. We welcome community feedback on whether this pattern addresses similar use cases.
Why this is useful
This is widely used at Pinterest. Over the last six months, about 10k+ runtime dynamic DAGs computed about 2M+ layouts. Most of them are ML training, evaluation, and inference pipelines, where each run decides what to do based on the latest model and newly landed data. The rest are migrated legacy workflows and config-driven DAGs authored from UI templates.
The DAG author writes a
compute_layoutfunction instead of declaring tasks:Here's what happens at run time:
__compute_layout.__compute_layoutruns on a worker. It callscompute_layoutand saves the resulting graph as a versioned layout for that DagRun.Each run keeps its own graph. Later parses and later runs don't change what an earlier run looks like, and clears or retries reuse the stored layout instead of computing a new one.
How this compares to what Airflow has
Airflow currently lacks a first-class mechanism for a running DagRun to generate, publish, and execute its own graph. We would love to hear if the open-source community is interested in a runtime dynamic DAG implementation and are happy to share more details!
All reactions