Airflow Scheduling: Assets vs. Cron | Which One Should You Use?
Sometimes, a change that looks simple on the surface is not actually that simple. Imagine that you need to replace the source table feeding a refined or trusted table in a data pipeline. At first, it might look like a one-line change: update the table name, deploy the code, and move on. But in a real data platform, there is usually much more behind that change. There are dependencies, scheduling rules, upstream and downstream processes, resource consumption, concurrency, data lineage, and, sometimes, assumptions that were not immediately obvious when the pipeline was first created. I recently had to look into exactly this kind of situation in an Apache Airflow project, and one of the questions that came up was: Should this DAG be scheduled using a cron expression, or should it be triggered based on an Asset? The answer, as usual in software engineering, is: it depends. And understanding why it depends is much more important than simply knowing how to configure either option. Cron: the familiar way of scheduling a DAG Let's start with the simplest and most familiar option: a time-based schedule. With Airflow, we can define a DAG to run according to a cron expression: with DAG ( dag_id = " my_pipeline " , schedule = " 0 13 * * 0 " , catchup = False , ): ... In this example, the DAG is scheduled to run every Sunday at 1 PM. In a real environment, we might have different schedules for different environments. For example: Environment Schedule Development Saturday at 1 PM Homologation Sunday at 1 PM Production Monday–Friday at 1 PM The important characteristic here is that the schedule is based on time . If the DAG is configured to run at 1 PM every Sunday, Airflow will try to run it at that time, regardless of whether the data it depends on has actually changed. This is not necessarily a bad thing. In fact, sometimes this is exactly what we want. But there is another approach. When data becomes part of the schedule Modern data pipelines often have dependencies that are b