You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DAGs with future start_date are automatically marked as success without executing tasks #38513
from datetime import datetime
from airflow import DAG
from airflow.operators.bash import BashOperator
default_args = {
'owner': 'airflow',
}
with DAG('my_future_dag',
default_args=default_args,
start_date=datetime(2050, 1, 1),
schedule="@daily",
catchup=False
):
BashOperator(task_id="task1", bash_command="echo 1")
BashOperator(task_id="task2", bash_command="echo 2")
BashOperator(task_id="task3", bash_command="echo 3")
BashOperator(task_id="task4", bash_command="echo 4")
As expected no runs will be started till 2050 but I might still want to manually invoke runs. Trying to do so will result in DAGRun marked as success and no tasks being executed as can see
However changing the start_date to datetime(2023, 1, 1) then tasks are executed as expected for manual runs:
The bug:
tasks should be executed for manual runs. The current case where dagrun is marked as success but no tasks are running or reporting failure is wrong.
By the way, a very interesting thing to explore is that if you first deploy the dag with datetime(2023, 1, 1) then change it to datetime(2050, 1, 1) Airflow has no problem with running tasks with that start_date:
Committer
I acknowledge that I am a maintainer/committer of the Apache Airflow project.
We usually have users using dynamic start_date which causes the issue. We point them to these links. It will be helpful if these dagruns are blocked from marked as success.
regarding the note about the tasks running if you deploy the dag with a past start_date and change it to a future start_date, it will run the tasks properly for a while but then revert to the old behaviour after manually triggering the dag a few times
side note: same issue behaviour when manual run is triggered after end_date
This is the same for manually-triggered DAG runs with a logical date that is before the start_date. I would expect/hope that manually triggered runs with a logical date prior to the start_date of the DAG would actually run. However, they do not (i.e., none of the tasks run; instead, the DAG run is just marked as an immediate success).
I have a use case for this where I have a DAG that schedules a compute-intensive Spark job on an EMR cluster. Because of the nature of the upstream dataset (there is late-arriving data), the Spark job processes data with a 7-day lookback window from each data_interval_start. The job runs twice daily. As a result, some of the same data is reprocessed. I set the start date to 2024-12-01. But I would like to backfill data from 2024-10-01 to 2024-12-01.
I don't want to set the start_date to 2024-10-01 with catchup=True because the late-arriving data has already arrived for the historical months. In other words, I don't want to have ≈120 DAG runs get scheduled for the preceding two months. Instead, I'd like to just run some manual DAG runs: 2024-10-07, 2024-10-14, 2024-10-21, 2024-10-28, etc.. Since the late-arriving data has already arrived for these historical months, I don't want to have several overlapping runs with a sliding lookback window. Instead, I just want to trigger several manual runs each of which is spaced 7 days apart for the historical months.
I see that @artilexx had done some initial work to address this in #40711 but it was closed due to inactivity.
Is there still interest in merging this? If so, happy to take a shot at it when I can find time and also try to make it work for my use case with manually-triggered DAG runs with a logical date prior to the start_date. (But also don't want to step on @artilexx's toes if they want to pick it back up.)
@adamliter feel free to pick it up. The changes I made definitely fixed the problem with DAGs not running when I tested it out, but it also broke the UI (iirc) and I was never able to figure out why.
This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.
This still happens on main for manual runs whose logical date is before the task's start_date, as noted above. #74387 makes task start_date and end_date only limit scheduled runs, so manual and other non-scheduled runs create and run their task instances.
I’m not entirely convinced it’s a good idea to blanket-ignore those values for manual runs. It is plausible that some users currently use start_date to gate tasks from being run until a future date, which is what the argument is originally intend for. This change would be breaking for those users.
Maybe it would make sense to add a flag on dag run triggering to optionally ignore task-level start/end dates, but that’d be a noticeably larger change.
I’m not entirely convinced it’s a good idea to blanket-ignore those values for manual runs. It is plausible that some users currently use start_date to gate tasks from being run until a future date, which is what the argument is originally intend for. This change would be breaking for those users.
Agreed, at this point, changing this behaviour is a breaking change. this is what i have used it for - adding a new node to a graph that MUST not run before a specific date.
Maybe it would make sense to add a flag on dag run triggering to optionally ignore task-level start/end dates, but that’d be a noticeably larger change.
I'm honestly not sure this needs changing now that it seems backfill already covers this use case?
This is the same for manually-triggered DAG runs with a logical date that is before the start_date. I would expect/hope that manually triggered runs with a logical date prior to the start_date of the DAG would actually run
As a datapoint: And I have relied on the opposite, so any change, or leaving it is going to be against someones expectations
Thanks both for the context. Since this issue was opened, backfill can be run from the UI and the API in Airflow 3, and backfill runs already skip the task date window. Given that, ignoring task start_date and end_date for manual runs might be too broad a change at this point.
That said, I do think the empty run itself can still confuse users, since it shows as success although nothing has run. How about showing a warning in the trigger form when the chosen logical date is outside the Dag's start_date and end_date, saying that no task will run? It would keep the current behaviour for those who rely on it, and only make the empty run visible to those who don't expect it.
Maybe it would make sense to add a flag on dag run triggering to optionally ignore task-level start/end dates, but that’d be a noticeably larger change.
As for an opt-in flag to ignore the dates when triggering, it is a larger change as mentioned above, so how about adding it later if there turns out to be demand for it?
I opened #75223 to show how the warning in the trigger form would look, with screenshots. It only adds the warning and keeps the current behaviour. Please feel free to review it, or to close it if this isn't the direction you'd like to go.
Activity
tirkarthi commentedon Mar 27, 2024
https://forum.astronomer.io/t/dag-run-marked-as-success-but-no-tasks-even-started/1423
https://stackoverflow.com/q/73652663
We usually have users using dynamic start_date which causes the issue. We point them to these links. It will be helpful if these dagruns are blocked from marked as success.
eladkal commentedon Mar 27, 2024
Dynamic start date is wrong usage. The case that I show here is valid.
amoghrajesh commentedon Mar 28, 2024
@eladkal I want to try my hand at this one, seems interesting. Can I take it up?
eladkal commentedon Mar 28, 2024
Sure. Assigned @amoghrajesh
artilexx commentedon Jul 7, 2024
@amoghrajesh have you been able to figure out what is causing this?
artilexx commentedon Jul 7, 2024
regarding the note about the tasks running if you deploy the dag with a past start_date and change it to a future start_date, it will run the tasks properly for a while but then revert to the old behaviour after manually triggering the dag a few times
side note: same issue behaviour when manual run is triggered after end_date
adamliter commentedon Dec 3, 2024
This is the same for manually-triggered DAG runs with a logical date that is before the
start_date. I would expect/hope that manually triggered runs with a logical date prior to thestart_dateof the DAG would actually run. However, they do not (i.e., none of the tasks run; instead, the DAG run is just marked as an immediate success).I have a use case for this where I have a DAG that schedules a compute-intensive Spark job on an EMR cluster. Because of the nature of the upstream dataset (there is late-arriving data), the Spark job processes data with a 7-day lookback window from each
data_interval_start. The job runs twice daily. As a result, some of the same data is reprocessed. I set the start date to2024-12-01. But I would like to backfill data from2024-10-01to2024-12-01.I don't want to set the
start_dateto2024-10-01withcatchup=Truebecause the late-arriving data has already arrived for the historical months. In other words, I don't want to have ≈120 DAG runs get scheduled for the preceding two months. Instead, I'd like to just run some manual DAG runs:2024-10-07,2024-10-14,2024-10-21,2024-10-28, etc.. Since the late-arriving data has already arrived for these historical months, I don't want to have several overlapping runs with a sliding lookback window. Instead, I just want to trigger several manual runs each of which is spaced 7 days apart for the historical months.I see that @artilexx had done some initial work to address this in #40711 but it was closed due to inactivity.
Is there still interest in merging this? If so, happy to take a shot at it when I can find time and also try to make it work for my use case with manually-triggered DAG runs with a logical date prior to the
start_date. (But also don't want to step on @artilexx's toes if they want to pick it back up.)artilexx commentedon Dec 3, 2024
@adamliter feel free to pick it up. The changes I made definitely fixed the problem with DAGs not running when I tested it out, but it also broke the UI (iirc) and I was never able to figure out why.
github-actions commentedon Sep 14, 2026
This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.
yuseok89 commentedon Oct 12, 2026
This still happens on main for manual runs whose logical date is before the task's
start_date, as noted above. #74387 makes taskstart_dateandend_dateonly limit scheduled runs, so manual and other non-scheduled runs create and run their task instances.uranusjr commentedon Oct 19, 2026
I’m not entirely convinced it’s a good idea to blanket-ignore those values for manual runs. It is plausible that some users currently use start_date to gate tasks from being run until a future date, which is what the argument is originally intend for. This change would be breaking for those users.
Maybe it would make sense to add a flag on dag run triggering to optionally ignore task-level start/end dates, but that’d be a noticeably larger change.
ashb commentedon Oct 19, 2026
Agreed, at this point, changing this behaviour is a breaking change. this is what i have used it for - adding a new node to a graph that MUST not run before a specific date.
I'm honestly not sure this needs changing now that it seems backfill already covers this use case?
ashb commentedon Oct 19, 2026
As a datapoint: And I have relied on the opposite, so any change, or leaving it is going to be against someones expectations
yuseok89 commentedon Oct 19, 2026
Thanks both for the context. Since this issue was opened, backfill can be run from the UI and the API in Airflow 3, and backfill runs already skip the task date window. Given that, ignoring task
start_dateandend_datefor manual runs might be too broad a change at this point.That said, I do think the empty run itself can still confuse users, since it shows as success although nothing has run. How about showing a warning in the trigger form when the chosen logical date is outside the Dag's
start_dateandend_date, saying that no task will run? It would keep the current behaviour for those who rely on it, and only make the empty run visible to those who don't expect it.yuseok89 commentedon Oct 19, 2026
As for an opt-in flag to ignore the dates when triggering, it is a larger change as mentioned above, so how about adding it later if there turns out to be demand for it?
yuseok89 commentedon Oct 20, 2026
I opened #75223 to show how the warning in the trigger form would look, with screenshots. It only adds the warning and keeps the current behaviour. Please feel free to review it, or to close it if this isn't the direction you'd like to go.