-
Notifications
You must be signed in to change notification settings - Fork 16.6k
Description
Apache Airflow version
3.1.7
What happened?
"use_job_schedule" - should "Turn off scheduler use of cron intervals by setting this to False. DAGs submitted manually in the web UI or with trigger_dag will still run.".
However, setting this to "False" not only disables time based scheduling but also Assets based scheduling.
What you think should happen instead?
This configuration should only affect time based scheduling as mentioned in the documentation. Asset based scheduling should not be affected.
Use Case: a Development environment with disabled time based scheduling, so that developers can develop their dags with the most freedom in this environment and when their dags are ready they can move them to higher (test and prod) environments with time based scheduling enabled. Because of "use_job_schedule" affecting both time and asset based scheduling, Asset based scheduling cannot be used in this environment.
So this is a bug report on the intended behaviour of "use_job_schedule" based on the documentation OR request of a new configuration that decouples time and asset based scheduling from "use_job_schedule".
How to reproduce
Start a new airflow instance with "use_job_schedule" set to False. You can also use the "AIRFLOW__SCHEDULER__USE_JOB_SCHEDULE" environment variable to set this. Then use the following minimal Asset based scheduling dag, manually create asset trigger from the Assets menu and you will observe that the dag does not get triggered. Now retry with "use_job_schedule" set to True and the dag will get triggered.
from airflow.sdk import dag, task, Asset
import pendulum
my_asset = Asset("asset")
@task
def trigger_on_asset_event():
print("hello after asset event")
@dag(
start_date=pendulum.datetime(2025, 6, 29, tz="Europe/Berlin"),
schedule=[my_asset],
)
def asset_scheduled_dag():
trigger_on_asset_event()
asset_scheduled_dag()
Operating System
Debian GNU/Linux 12 (bookworm)
Deployment
Official Apache Airflow Helm Chart
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct