Upgrade to Airflow 3
Zuletzt aktualisiert am
Prerequisites
Section titled “Prerequisites”- You have a running STACKIT Workflows instance on version
workflows-2.3-airflow-2.11. - Your DAGs are stored in a Git repository accessible from STACKIT Workflows.
- You have reviewed the Apache Airflow 2 to 3 migration guide and updated your DAGs accordingly.
Key changes in Airflow 3
Section titled “Key changes in Airflow 3”Before migrating, make sure your DAGs are compatible with Airflow 3:
- New import paths — Core decorators and classes have moved to
airflow.sdk:# Airflow 2from airflow.decorators import dag, task# Airflow 3from airflow.sdk import dag, task - Datasets renamed to Assets —
Datasetis nowAsset. Update your imports and usages:# Airflow 2from airflow.datasets import Dataset# Airflow 3from airflow.sdk import Asset - Removed and deprecated APIs — Review the full list of breaking changes in the official Apache Airflow migration guide.
Migrate to Airflow 3
Section titled “Migrate to Airflow 3”-
Note the configuration of your existing instance.
Before creating the new instance, collect all configuration values from your existing Workflows instance:
- On the sidebar click on Workflows. You can find it in the
Data & AIcategory. - Click on your existing instance to open the detail view.
- Note the following values:
- Identity Provider: Client ID, Client secret, Scope, Discovery Endpoint
- DAG repository: Repository URL, branch name, credentials
- Monitoring: linked STACKIT Observability instance (if any)
- On the sidebar click on Workflows. You can find it in the
-
Update your DAGs for Airflow 3 compatibility.
In your DAG repository, apply the necessary code changes described in Key changes in Airflow 3 and push them to your repository branch.
-
Create a new Workflows instance with version
workflows-3.0-airflow-3.1.- On the sidebar click on Workflows.
- Click on Create Workflows.
- Fill in all required information using the values you noted in step 1.
Set the version to
workflows-3.0-airflow-3.1. - Click on Order fee-based to create the instance.
- Wait for the new instance to reach the Active state.
-
Validate the new instance.
- Open the Airflow UI of the new instance.
- Confirm that all DAGs from your repository are loaded correctly and show no import errors.
- Trigger a test run for your critical DAGs and verify they complete successfully.
-
Delete the old instance.
Once you have confirmed that the new instance is working correctly, delete the old one:
- On the sidebar click on Workflows.
- On the right side click on the three dots menu next to your old
workflows-2.3-airflow-2.11instance and then on Delete. - Enter the instance name as confirmation and click on Delete.