Uh oh!
There was an error while loading. Please reload this page.
Show task state counts for the latest Dag run on the Dags list page - #69619
Show task state counts for the latest Dag run on the Dags list page#69619yuseok89 wants to merge 3 commits into
Conversation
cb0a135 to
48872f8Comparebbovenzi
commented
Jul 14, 2026
Thanks for opening this. Let's make sure dags list performance issues are resolved first. Like in this PR: #69806. Only after that should we add any more complexity to the dags list |
Makes sense, thanks. I'll take a look at the dags list performance work too and see if there's anything I can help with there. |
48872f8 to
2972d54Compare2972d54 to
fc551dbCompareyuseok89
commented
Aug 5, 2026
pierrejeambrun
left a comment
There was a problem hiding this comment.
Can you benchmark this when there are millions of TI and hundred of thousand of runs in the DB?
I would like to double check performance, my feeling is that it will not scale way because of the subqueries
yuseok89
commented
Aug 24, 2026
Good call, you were right. I seeded 600 Dags, 850k runs, 3M task instances (Postgres 14) and measured a 50-Dag page. The bottleneck is the per-Dag The fix drops that lookup. The Dags list already carries each Dag's latest run, so the endpoint now takes Pushed. |
closes: #66947
Each Dag card and table row on the Dag list page now shows the task-instance state breakdown of that Dag's most recent run, as clickable badges. Clicking a badge opens that run's task list filtered by the state, restoring the scan-then-click "Recent Tasks" workflow from Airflow 2.
What changed
GET /api/v2/ui/dags/latest_run_task_instance_state_counts. For the requested Dag IDs it resolves each Dag's latest run and counts its task instances grouped by state.dag_idsis bounded to the API max page limit. A run's task instances are bounded by the Dag's task structure, so the per-state counts are exact.no_status.Unlike the run-state badges from #67242 (which count a Dag's runs by state), these count the task instances of its single latest run.
Demo
Screen.Recording.2026-07-08.at.11.08.18.PM.mov
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.