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
Conditional Dataset(Asset) Updates Are Grouped Together Instead of Creating Distinct DAG Runs #53896
Suppose a Dag depends on multiple datasets aladdin_adx_coupon, aladdin_adx_factor ,aladdin_adx_issuer, aladdin_adx_security, aladdin_adx_shares_outstanding
Then the schedule property of that DAG will be as below -
Suppose multiple datasets gets updated at the same time then this OR condition of schedule property will be evaluated as True and the DAG will be triggered only once, not multiple times ( Individual DAG run per each update)
Solution
1] Should use TriggerDagRunOperator in each of the DAG’s which are updating the datasets.
Eg code snippet -
trigger_consumer = TriggerDagRunOperator(
task_id="trigger_consumer_from_producer_a",
trigger_dag_id="consumer_triggered_dag", # ID of the consumer DAG
conf={
"source_producer": "producer_dag_trigger_a",
"producer_run_id": "{{ run_id }}",
"logical_date": "{{ logical_date.isoformat() }}",
"data_source_info": "Sales data batch A"
},
wait_for_completion=False,
)
2] In the sequential dependency chain make trigger_consumer as the final downstream task
trigger_consumer
3] And in the DAG which depends on datasets, below prop values should be implemented -
with DAG(
dag_id="consumer_triggered_dag", # IMPORTANT: This ID must match trigger_dag_id in producers
start_date=pendulum.datetime(2025, 1, 1, 0, 0, 0, tz="Asia/Kolkata"),
schedule=None, # Crucial: This DAG will ONLY run when explicitly triggered by TriggerDagRunOperator
catchup=False,
tags=["consumer", "direct_trigger"],
) as consumer_dag:
Could you also please share your specific use case where it's necessary for the dependent DAG to trigger individually for each dataset update, instead of a single run based on any dataset change? Understanding this will help validate the proposed solution or explore alternatives.
1] Reason why the dataset updates appear to be grouped is as follows -
Suppose a Dag depends on multiple datasets aladdin_adx_coupon, aladdin_adx_factor ,aladdin_adx_issuer, aladdin_adx_security, aladdin_adx_shares_outstanding
Then the schedule property of that DAG will be as below -
Even if many datasets are updated at the same time, DAG will be triggered just once, because the rule is:
"At any given time, if one or more of them update, go once!!"
It doesn’t matter how many changed at the same time— one or five — it only causes a single run .
Optional analogy:
Think of it like a doorbell connected to 5 buttons — pressing any one or more buttons at the same time will ring the bell just once.
That's why it appears to be grouped.
2]One DAG will process different files depending on which dataset uri is updated
You can pass the dataset info to the consumer dag (dag which consumes dataset) , from the producer dag (dag which updates dataset) using the conf property of TriggerDagRunOperator in the producer dag -
trigger_consumer = TriggerDagRunOperator(
task_id="trigger_consumer_from_producer_a",
trigger_dag_id="consumer_triggered_dag", # ID of the consumer DAG conf={
"source_producer": "producer_dag_trigger_a",
"producer_run_id": "{{ run_id }}",
"logical_date": "{{ logical_date.isoformat() }}",
"data_source_info": "dataset_name"
},
wait_for_completion=False,
)
the same conf value can be consumed by the consumer dag and perform required operations based on dataset.
def _log_trigger_info(**context: Any):
"""
details about how this DAG run was triggered,
especially via the 'conf' passed by TriggerDagRunOperator.
"""
dag_run = context["dag_run"]
# Access the conf dictionary passed by the TriggerDagRunOperator
triggered_by_conf = dag_run.conf
if triggered_by_conf:
print("\n--- Triggering Info from Producer DAG ---")
print(f" Source Producer: {triggered_by_conf.get('source_producer', 'N/A')}")
print(f" Producer Run ID: {triggered_by_conf.get('producer_run_id', 'N/A')}")
print(f" Producer Logical Date: {triggered_by_conf.get('logical_date', 'N/A')}")
print(f" Data Source Info: {triggered_by_conf.get('data_source_info', 'N/A')}") # dataset_name
#perform required operation based on dataset
else:
print("\n--- No 'conf' data passed to this triggered run ---")
print("(This likely means it was manually triggered without conf, or a time-based run)")
print("Consumer: Starting data processing based on received trigger info...")
Closing as the original issue has been reported for v2.10, and #68517 seems to handle it in v3.
If more fine-tuning is needed for this feature, please create a new GitHub issue / dev list discussion / PR, or any combination of those.
Activity
shreyaskj-0710 commentedon Aug 4, 2025
I’ll work on this issue—let me know if it’s already been picked up by someone else.
shreyaskj-0710 commentedon Aug 5, 2025
Hi @jfallt ,
I was able to replicate the issue and come up with solution.
Please refer the below content -
Issue Analysis
{
"any": [
"aladdin_adx_coupon",
"aladdin_adx_factor",
"aladdin_adx_issuer",
"aladdin_adx_security",
"aladdin_adx_shares_outstanding"
]
}
Suppose a Dag depends on multiple datasets aladdin_adx_coupon, aladdin_adx_factor ,aladdin_adx_issuer, aladdin_adx_security, aladdin_adx_shares_outstanding
Then the schedule property of that DAG will be as below -
schedule = aladdin_adx_coupon | aladdin_adx_factor | aladdin_adx_issuer | aladdin_adx_security | aladdin_adx_shares_outstanding
Suppose multiple datasets gets updated at the same time then this OR condition of schedule property will be evaluated as True and the DAG will be triggered only once, not multiple times ( Individual DAG run per each update)
Solution
1] Should use TriggerDagRunOperator in each of the DAG’s which are updating the datasets.
Eg code snippet -
trigger_consumer = TriggerDagRunOperator(
task_id="trigger_consumer_from_producer_a",
trigger_dag_id="consumer_triggered_dag", # ID of the consumer DAG
conf={
"source_producer": "producer_dag_trigger_a",
"producer_run_id": "{{ run_id }}",
"logical_date": "{{ logical_date.isoformat() }}",
"data_source_info": "Sales data batch A"
},
wait_for_completion=False,
)
2] In the sequential dependency chain make trigger_consumer as the final downstream task
3] And in the DAG which depends on datasets, below prop values should be implemented -
with DAG(
dag_id="consumer_triggered_dag", # IMPORTANT: This ID must match trigger_dag_id in producers
start_date=pendulum.datetime(2025, 1, 1, 0, 0, 0, tz="Asia/Kolkata"),
schedule=None, # Crucial: This DAG will ONLY run when explicitly triggered by TriggerDagRunOperator
catchup=False,
tags=["consumer", "direct_trigger"],
) as consumer_dag:
Could you also please share your specific use case where it's necessary for the dependent DAG to trigger individually for each dataset update, instead of a single run based on any dataset change? Understanding this will help validate the proposed solution or explore alternatives.
jfallt commentedon Aug 6, 2025
I guess that technically fixes the issue but that doesn't explain why the dataset updates are grouped together in the first place.
In this example this one DAG will process different files depending on which dataset uri is updated
shreyaskj-0710 commentedon Aug 7, 2025
Hi @jfallt ,
1] Reason why the dataset updates appear to be grouped is as follows -
Suppose a Dag depends on multiple datasets aladdin_adx_coupon, aladdin_adx_factor ,aladdin_adx_issuer, aladdin_adx_security, aladdin_adx_shares_outstanding
Then the schedule property of that DAG will be as below -
schedule = aladdin_adx_coupon | aladdin_adx_factor | aladdin_adx_issuer | aladdin_adx_security | aladdin_adx_shares_outstanding
Even if many datasets are updated at the same time, DAG will be triggered just once, because the rule is:
"At any given time, if one or more of them update, go once!!"
It doesn’t matter how many changed at the same time— one or five — it only causes a single run .
Optional analogy:
Think of it like a doorbell connected to 5 buttons — pressing any one or more buttons at the same time will ring the bell just once.
That's why it appears to be grouped.
2]One DAG will process different files depending on which dataset uri is updated
You can pass the dataset info to the consumer dag (dag which consumes dataset) ,
from the producer dag (dag which updates dataset) using the conf property of TriggerDagRunOperator in the producer dag -
trigger_consumer = TriggerDagRunOperator(
task_id="trigger_consumer_from_producer_a",
trigger_dag_id="consumer_triggered_dag", # ID of the consumer DAG
conf={
"source_producer": "producer_dag_trigger_a",
"producer_run_id": "{{ run_id }}",
"logical_date": "{{ logical_date.isoformat() }}",
"data_source_info": "dataset_name"
},
wait_for_completion=False,
)
the same conf value can be consumed by the consumer dag and perform required operations based on dataset.
def _log_trigger_info(**context: Any):
"""
details about how this DAG run was triggered,
especially via the 'conf' passed by TriggerDagRunOperator.
"""
dag_run = context["dag_run"]
jfallt commentedon Aug 11, 2025
I'm pretty sure the issue stems from how the scheduler is handling asset/dataset changes
https://github.com/apache/airflow/blob/8ef0ac3e473efb0c36fdecae5fe5b73fbdc186d4/airflow-core/src/airflow/assets/manager.py#L109C9-L109C30
I'll have to set up some tests to validate my theory
jroachgolf84 commentedon Sep 16, 2026
There is some pretty active conversation going on in the Dev List about this (and it extends outside of conditional Asset scheduling).
shahar1 commentedon Nov 6, 2026
Closing as the original issue has been reported for v2.10, and #68517 seems to handle it in v3.
If more fine-tuning is needed for this feature, please create a new GitHub issue / dev list discussion / PR, or any combination of those.