Dag Run ID and Triggering User Name are not recorded properly for a Backfill job
- Dominant language
- Python
- Stars
- 46.9k
- Forks
- 17.8k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 472
Description
### Apache Airflow version
3.1.7
### If "Other Airflow 3 version" selected, which one?
_No response_
### What happened?
When running a second or subsequent backfill job for the same DAG, the DAG Run ID and Triggering User Name for Dag Runs generated by backfill are recorded incorrectly.
As shown in the screenshot below:
First backfill works correctly `backfill_...` Run ID and correct Triggering User Name but second time it creates Dag Run with `scheduled_...` Run ID and fails to record Triggering User Name.
### What you think should happen instead?
All backfill jobs should consistently use the `backfill__...` Dag Run ID format and preserve the Triggering User Name, regardless of whether it's the first or subsequent backfill for the same logical date.
### How to reproduce
1. Run a first backfill job - everything works fine
2. Run a second or more backfill job. You will notice a Dag Run ID that does not start with `backfill_...` and Triggering User Name
### Operating System
macOS, Sequoia 15.7.2
### Versions of Apache Airflow Providers
_No response_
### Deployment
Official Apache Airflow Helm Chart
### Deployment details
_No response_
### Anything else?
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
Contributor guide
Research direction
Start by reproducing the issue with two backfill jobs for the same DAG and logical date, then trace the backfill Dag Run creation path in the Airflow Python code. Compare the first and subsequent runs for their run ID format and Triggering User Name; done means both consistently retain the backfill ID format and user name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100