apache / apache/airflow

use_job_schedule affects asset based scheduling

Open
#62,929 2 comments 0 reactions 0 assignees View on GitHub
area:core area:scheduler kind:bug
Dominant language
Python
Stars
46.9k
Forks
17.8k
Avg merge
2d 9h
Merged PRs (30d)
472

Description

### Apache Airflow version

3.1.7

### What happened?

["use_job_schedule"](https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#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

- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

Contributor guide

Open the contributing guide

Research direction

Start by tracing the scheduler behavior for the `use_job_schedule` configuration and its `AIRFLOW__SCHEDULER__USE_JOB_SCHEDULE` environment variable, then compare time-based scheduling with the asset-trigger path described in the reproduction. Done means asset-scheduled DAGs trigger from the Assets menu while time-based scheduling remains disabled, with coverage for the minimal DAG behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, data-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.