Fix TriggerDagRunOperator extra link visibility during task execution #61045
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
In Airflow 3.1.6, the UI displays the “Triggered DAG” button for TriggerDagRunOperator only after the task reaches a terminal state. However, the triggered DAG run is created earlier, while the task is still running.
This PR updates the UI to surface the “Triggered DAG” link as soon as the child DAG run exists, without waiting for task completion or requiring a page refresh.
Problem:
TriggerDagRunOperator creates a child DAG run while the task is still in the RUNNING state
The Airflow UI delays rendering the “Triggered DAG” button until the task finishes
This creates a mismatch between backend state and UI visibility and makes navigation to the triggered DAG unnecessarily delayed
Solution:
The UI logic is adjusted to determine the availability of the “Triggered DAG” button based on the existence of the child DAG run rather than the parent task’s terminal state.
This change:
Does not modify TriggerDagRunOperator execution behavior
Does not affect scheduling or DAG run creation
Improves UI consistency and user experience
Backward Compatibility
No breaking changes
Existing DAGs continue to work as before, with improved UI feedback
Tests
Updated / added coverage to ensure the triggered DAG link is visible while the operator task is still running
Related issue
Closes #60867