-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Unique run_id across manually triggered Dags with schedules #59477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unique run_id across manually triggered Dags with schedules #59477
Conversation
b530a1a to
a2f862b
Compare
bugraoz93
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Steve, changes looks good! Maybe we should make run_after unique rather than fallback to logicaldate. I remember this was an intentional change. I maybe missing something though
cc: @uranusjr
pierrejeambrun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…es (apache#59477) * run id no longer collides in manual runs * ruff format; (cherry picked from commit 13f3e26) Co-authored-by: Steve Ahn <steveahnahn@g.ucla.edu>
…9477) * run id no longer collides in manual runs * ruff format;
Problem
Manual triggers of scheduled Dags could generate the same run_id repeatedly (often aligned to the schedule boundary). Triggering the same Dag twice would then fail with a 409 Conflict due to a duplicate run_id
Solution
When a manual trigger provides a logical_date, Airflow still infers the correct data_interval for the run, but it no longer rewrites run_after to the scheduled data_interval.end. This keeps manual trigger run_ids based on the actual trigger time making them unique across repeated manual triggers.
Manual testing in breeze triggering a daily scheduled dag via manual trigger runids:
scheduled__2025-12-15T00:00:00+00:00
manual__2025-12-15T04:16:39.584387+00:00
manual__2025-12-15T04:16:50.627593+00:00
manual__2025-12-15T04:18:07.769612+00:00
Related
Fixes #59342