Dag versioning
Dag versioning is a feature introduced in Airflow 3. Previously, in Airflow 2, Airflow automatically used the most recent dag code. This meant that changing your dag could affect observability into previous task runs or affect the success of in-progress dags. Airflow 3 addresses these issues with Dag bundles and Dag versioning.
Airflow automatically versions your dag runs in the Airflow UI. When you make significant changes to your Dags, like changing task behavior, Airflow creates a new version. Each dag run is also associated with a specific version visible in the Airflow UI. This allows you to quickly identify the outcome of particular code changes.
Dag bundles include the dags files and their supporting files and can also be versioned depending on the bundle type you choose. These versions are separate from dag versions, and reflect the version of the source. The default, LocalDagBundle
is not versioned, but some dag bundles are. The GitDagBundle
is versioned by the underlying backend, Git. Every commit made to the configured Git repository creates a new version, even if a commit does not change your dag code.
Read more about Dag versioning, including details about how to configure a dag bundle for OSS Airflow.
Dag versioning on Astro
On Astro Hosted Execution mode Deployments, dag versioning works immediately without needing to configure a dag bundle backend. As this is a fully managed service, Astro handles this for you and dag versioning is handled seamlessly and integrated with your existing deploy mechanisms.
For Remote Execution mode Deployments, you must configure a dag bundle backend for the Remote Execution Agents in your environment. See Configure dag bundles for Remote Execution for more information on how to configure the dag bundle backend as well as differences between bundle types.