Start Here
Until now, one DAG started at a set time. This chapter links DAGs to each other. One DAG can start when another DAG has made new data.
You follow shop_orders_daily again. Its last task, build_daily_revenue, writes the table daily_revenue. The run about 2026-01-20 is dag_run 380.
Other teams want that table. The DAGs of other teams in this chapter are made up: finance_report_daily and marketing_mail. All their times and ids are made up too.
First, see the problem. The finance team starts its report at 00:30 every day, because the table is usually ready by then. Look at two nights:
| Run starts on | Table ready at | Report starts at | Report uses fresh data? |
|---|---|---|---|
| 2026-01-21 (run about 2026-01-20) | 00:00:14 | 00:30 | Yes |
| 2026-01-23 (run about 2026-01-22) | 00:45 | 00:30 | No. The table was not ready. |
On the second night, the report is built from old data. Nothing fails, so nobody is warned.
The report did not wait for the data. It waited for the clock. Airflow can do better: the report DAG can wait for the data itself.
The feature has two names. Airflow 2.4 added Datasets, and Airflow 3 renamed them Assets.
The idea is the same. Look at what changed:
| Part | Airflow 2 (2.4 and later) | Airflow 3 |
|---|---|---|
| Name of the thing | Dataset | Asset |
| Import | from airflow.datasets import Dataset | from airflow.sdk import Asset |
| Producer task argument | outlets=[...] | outlets=[...] |
| Consumer DAG argument | schedule=[...] | schedule=[...] |
This chapter writes Airflow 2 code and says Dataset. In Airflow 3, replace the name and the import.
You answer three questions:
- How does a task say it made new data, and how does another DAG react?
- What if the other DAG needs two datasets, or a clock as well?
- When do you use a dataset, and when a sensor or a trigger?
