Skip to main content
skill Claude Code Gemini CLI CX Codex official · Google

managed-airflow-migrations — Claude Code skill for Airflow DAGs

Guides Airflow DAG migrations for Managed Service for Apache Airflow to Airflow 2.11.1 or Airflow 3. Use it for code upgrades, not unrelated DAG run failures.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add google/skills --skill managed-airflow-migrations -a claude-code
Open on GitHub

What managed-airflow-migrations does

The skill guides migrations from a Managed Service for Apache Airflow environment, formerly Cloud Composer, or from local DAG files. It helps check dependency changes and find code patterns that need attention, including Dataset, SSHHook with timeout, and pendulum.Period. Suggested grep scans search ./dags and ./tests.

For Airflow 3, the guide covers Task SDK import changes, direct metadata database access, and the rename of Dataset to Asset; SubDAGs and SLAs are also affected. Its migration guidance covers Airflow 2.11.1 on MSAA Gen 2 and Gen 3, and Airflow 3 on MSAA Gen 3. Install it when you are updating DAG code. It is not meant for investigating run failures unrelated to migration.

What it helps with

  • scan DAGs for dependency changes
  • check code before upgrading to Airflow 2.11.1
  • prepare DAGs for an Airflow 3 migration
  • find outdated Pendulum calls in tests

Example prompts for the agent

  • Check `./dags` for changes needed to migrate to Airflow 2.11.1.
  • Find the updates required to move these DAGs to Airflow 3.
  • Scan `./tests` for Pendulum calls affected by the upgrade.

How to install managed-airflow-migrations

1Skills CLI (Vercel)

npx skills add google/skills --skill managed-airflow-migrations -a claude-code

2Manually: put the files in place

~/.claude/skills/managed-airflow-migrations/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/managed-airflow-migrations/

From the same set172

The whole set →
bigquery-basics official google Manages BigQuery resources and runs SQL queries. Use it to create datasets, tables and views, or handle basic data ingestion and analysis. Claude Code Gemini CLI CX Codex 17,678installs cloud-run-basics official google This skill helps an agent manage Cloud Run services, jobs, and worker pools when a project needs HTTP deployment, scheduled work, or pull-based background processing. Claude Code Gemini CLI CX Codex 17,532installs gemini-api official google Connects Gemini API from Google Cloud Agent Platform to the agent. Gives access to Gemini models, multimodal input, function calling, and context caching. Claude Code Gemini CLI CX Codex 17,116installs google-cloud-recipe-auth official Google LLC This skill explains Google Cloud authentication and permissions. Use it when setting up IAM, ADC, or service accounts for local code and production workloads. Claude Code Gemini CLI CX Codex 15,450installs google-cloud-recipe-onboarding official Google LLC Guides a developer through a first Google Cloud project: CLI checks, sign-in, project setup and billing. It fits a personal first project. Claude Code Gemini CLI CX Codex 15,390installs cloud-sql-basics official google This skill helps create and explain Cloud SQL resources for MySQL, PostgreSQL, and SQL Server. Use it when setting up a database in Google Cloud. Claude Code Gemini CLI CX Codex 14,679installs google-cloud-waf-security official google This skill reviews Google Cloud workloads against the security pillar of the Well-Architected Framework and suggests actions for IAM, networks, data, and operations. Claude Code Gemini CLI CX Codex 14,620installs google-cloud-waf-cost-optimization official google Reviews Google Cloud workloads through the Well-Architected Cost Optimization pillar. Use it to inspect spending, resize resources, assess discounts, or find idle capacity. Claude Code Gemini CLI CX Codex 14,266installs

Similar

changelog-automation Seth Hobson This skill helps generate changelogs and release notes from commits, PRs, and releases. Use it when setting up release workflows or shared commit rules. Claude Code CX Codex Cursor 13,733installs debugging-strategies Seth Hobson This skill gives an agent a step-by-step way to investigate bugs, crashes, and performance problems. Use it when a project behaves unexpectedly. Claude Code CX Codex Cursor 13,414installs iii-core-primitives iii-hq Guides agents on iii engine primitives: functions, triggers, workers, and invocation modes across TypeScript, Python, and Rust. Claude Code CX Codex Cursor +1 4,000installs microservices-patterns Seth Hobson A practical guide to service boundaries, event-driven communication, data ownership, and resilience patterns for distributed systems. Claude Code CX Codex Cursor 13,176installs secrets-management Seth Hobson This skill sets up secrets handling for CI/CD with Vault, AWS Secrets Manager, and platform stores. Use it for credentials, rotation, and protected deployments. Claude Code CX Codex Cursor 13,122installs wizard Matt Pocock This skill creates an interactive bash wizard for manual setup steps, CI secrets, third-party dashboards, and one-off migrations. Claude Code 553,369installs hyperframes-cli heygen-com Controls HyperFrames video workflows from the CLI: audits layouts and contrast, edits timeline clips, captures snapshots, and renders locally or in cloud runtimes. Claude Code CX Codex Cursor +1 1,200,000installs setup-pre-commit Matt Pocock This skill configures pre-commit checks for a JavaScript repository, running Prettier, type checking, and tests before each commit. Claude Code 489,289installs

Questions about managed-airflow-migrations

How do I install managed-airflow-migrations in Claude Code?

Run npx skills add google/skills --skill managed-airflow-migrations -a claude-code.

What does managed-airflow-migrations do?

It guides DAG analysis and helps find code changes for migrating Managed Service for Apache Airflow to Airflow 2.11.1 or Airflow 3.

Which Airflow versions does the skill cover?

It covers Airflow 2.11.1 on MSAA Gen 2 and Gen 3, plus Airflow 3 on MSAA Gen 3.

Source text

SKILL.md · Apache-2.0
---
name: managed-airflow-migrations
description: Provides guidance for migrating Apache Airflow DAGs in Managed Service for Apache Airflow (MSAA; formerly Cloud Composer). Covers migration to Airflow 2.11.1 (MSAA Gen 2 and 3) and Airflow 3 (MSAA Gen 3), including environment inspection, GCS download/upload and scanning patterns for breaking changes. Use when migrating the DAG code to newer Airflow version. Don't use when checking DAG run failures unrelated to code migration.
metadata:
  version: "1.0.1"
  category: BigDataAndAnalytics
---

# Managed Service for Apache Airflow (formerly Cloud Composer) Migration Guide

This skill guides you through the process of adjusting Airflow DAGs from an
existing Managed Service for Apache Airflow (formerly Cloud Composer)
environment (or available locally) to make them compatible with **Airflow
2.11.1** (MSAA Gen 2 or 3) or **Airflow 3** (MSAA Gen 3).

--------------------------------------------------------------------------------

## Attribution

**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
MUST read [Usage Attribution](references/attribution.md). For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix `gcloud` with
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:managed-airflow-migrations)"`
and append `agent-skills/1.0 (skill:managed-airflow-migrations)` to `User-Agent` headers.

## Phase 1: Discovery & Download

Before making any changes, download the existing DAG files if explicitly
requested. Inspect the source environment to confirm source version only if
explicitly requested. For detailed instructions about environment inspection and
downloading files check
[references/environment-inspection.md](references/environment-inspection.md).

--------------------------------------------------------------------------------

## Phase 2: Target Version & Dependency Mapping

### 2.1 Airflow 2.11.1+ Dependency Mapping

If migrating to Airflow 2.11.1 (MSAA Gen 2) or Airflow 3, use the list below to
trace the version progression of key dependencies. The list covers changes
needed to get to Airflow 2.11.1. Take them into account when migrating from
Airflow 2 (earlier than 2.11.1) to Airflow 3.

### Composer 2.10.0 (Airflow 2.10.2)

-   **Google Provider**: `10.26.0`
-   **SSH Provider**: `3.14.0`
-   **HTTP Provider**: `4.13.3`
-   **Breaking Changes**: *Baseline for oldest fully documented source.*

### Composer 2.15.3 (Airflow 2.10.5)

-   **Google Provider**: `18.0.0`
-   **SSH Provider**: `4.1.4`
-   **HTTP Provider**: `5.3.4`
-   **Breaking Changes**:
    -   **SSH Provider 4.0.0:** Hook `timeout` removed; `get_conn()` context
        manager.
    -   **HTTP Provider 5.0.0:** `SimpleHttpOperator` -> `HttpOperator`.
    -   **Google Provider 11.0.0:** `BigQueryExecuteQueryOperator` removed.
    -   **Google Provider 12.0.0:** Legacy Data Pipeline operators removed.
    -   **Google Provider 13.0.0:** `AutoMLBatchPredictOperator` removed.
    -   **Google Provider 17.0.0:** `BigQueryCreateEmptyTableOperator` and
        `BigQueryCreateExternalTableOperator` removed; Life Sciences operators
        removed.
    -   **Google Provider 18.0.0:** Legacy DV360 operators removed.

### Composer 2.16.1 (Airflow 2.10.5)

-   **Google Provider**: `19.0.0`
-   **SSH Provider**: `4.1.6`
-   **HTTP Provider**: `5.5.0`
-   **Breaking Changes**: **Google Provider 19.0.0:** AutoML operators removed
    (use Vertex AI).

### Composer 2.17.0 (Target Airflow 2.11.1)

-   **Google Provider**: **`20.0.0`**
-   **SSH Provider**: **`5.0.0`**
-   **HTTP Provider**: **`6.0.2`**
-   **Breaking Changes**:
    -   **SSH Provider 5.0.0:** `sshtunnel` removed (native tunneling).
    -   **HTTP Provider 6.0.0:** JSON serialization.
    -   **Google Provider 20.0.0:** ADLS Gen2 migration.

### 2.2 Airflow 3 Migration

If migrating to Airflow 3 (MSAA Gen 3), note that this is a major version
upgrade with significant changes, including:

*   Decoupled Task SDK (imports change from `airflow` to `airflow.sdk`).
*   Removal of direct metadata DB access.
*   Renaming of `Dataset` to `Asset`.
*   Removal of SubDAGs and SLAs.
*   Changes to context variables availability.

Take into account all applicable changes within Airflow 2 (e.g. when migrating
from Airflow 2.10.2, apply changes needed to move to Airflow 2.11.1 and Airflow
3 migration changes on top of that).

--------------------------------------------------------------------------------

## Phase 3: Analysis & Remediation (Scanning Downloaded Files)

Run the scan commands from the root of your local workspace
(`./migration_workspace` unless indicated otherwise).

--------------------------------------------------------------------------------

### 3.1 Airflow 2.11.1 Core & Dependency checks

Use these scans if migrating to Airflow 2.11.1+ (intermediate step when
migrating to Airflow 3).

#### 3.1.1 Dataset Scheduling (Airflow 2.11.0)

*   **Change:** DAGs scheduled on datasets only trigger if events occur while
    the DAG is unpaused.
*   **Scan Command:** `grep -rn "Dataset(" ./dags`
*   **Remediation:** You MUST document that these DAGs must remain unpaused to
    catch events, or plan manual triggers for catch-up.

#### 3.1.2 HTML in Descriptions (Airflow 2.11.0)

*   **Change:** Raw HTML in DAG docs / params is escaped by default.
*   **Scan Command:**

    ```bash
    grep -rn -E "doc_md.*<|doc_md.*>|description.*<|description.*>" ./dags
    ```

*   **Remediation:** Convert HTML to Markdown, or set
    `AIRFLOW__WEBSERVER__ALLOW_RAW_HTML_DESCRIPTIONS=True` in target.

#### 3.1.3 Teardown Tasks (Airflow 2.10.5)

*   **Change:** Teardowns always run when a DAG is marked failed.
*   **Scan Command:** `grep -rn "as_teardown" ./dags`
*   **Remediation:** Ensure teardown tasks are idempotent.

#### 3.1.4 Pendulum 3 Upgrade (Airflow 2.11.0)

*   **Change:** `Period` renamed to `Interval`, testing helpers removed.
*   **Scan Command (Code):**

    ```bash
    grep -rn -E "pendulum\.Period|pendulum\.period" ./dags
    ```

*   **Scan Command (Tests):**

    ```bash
    grep -rn -E "\.test\(|set_test_now\(" ./tests 2>/dev/null || true
    ```

*   **Remediation:** Replace `Period` with `Interval`, and `period(...)` with
    `interval(...)`.

--------------------------------------------------------------------------------

### 3.2 Path A: Airflow 2.11.1 Provider Package Scan

#### 3.2.1 SSH Provider (SSH 4.0.0 & 5.0.0)

*   **Scan Command (Timeout):** `grep -rn "SSHHook" ./dags | grep "timeout"`
*   **Scan Command (Context Manager):** `grep -rn "with SSHHook" ./dags`
*   **Scan Command (Tunnel Attributes):** `grep -rn "\.get_tunnel" ./dags`
*   **Remediation:**
    *   Replace `timeout` with `conn_timeout` in `SSHHook`.
    *   Replace `with hook as conn:` with `with hook.get_conn() as conn:`.
    *   Use `get_tunnel()` as context manager: `with hook.get_tunnel(...) as
        tunnel:`.

#### 3.2.2 HTTP Provider (HTTP 5.0.0 & 6.0.0)

*   **Scan Command:** `grep -rn "SimpleHttpOperator" ./dags`
*   **Remediation:** Replace `SimpleHttpOperator` with `HttpOperator`.

#### 3.2.3 Google Provider (v11 to v20)

*   **Scan Command (BigQuery query):**

    ```bash
    grep -rn "BigQueryExecuteQueryOperator" ./dags
    ```

    *   *Remediation:* Replace with `BigQueryInsertJobOperator` (use
        `configuration` dict).
*   **Scan Command (BigQuery table):**

    ```bash
    grep -rn -E "BigQueryCreateEmptyTableOperator|BigQueryCreateExternalTableOperator" ./dags
    ```

    *   *Remediation:* Replace with `BigQueryCreateTableOperator` (use
        `table_resource` dict).
*   **Scan Command (AutoML):**

    ```bash
    grep -rn -E "AutoMLTrainModelOperator|AutoMLPredictOperator|AutoMLCreateDatasetOperator|AutoMLBatchPredictOperator" ./dags
    ```

    *   *Remediation:* Migrate to Vertex AI operators.
*   **Scan Command (Dataflow):**

    ```bash
    grep -rn -E "CreateDataPipelineOperator|RunDataPipelineOperator" ./dags
    ```

    *   *Remediation:* Replace with
        `DataflowCreatePipelineOperator`/`DataflowRunPipelineOperator`.
*   **Scan Command (Life Sciences):**

    ```bash
    grep -rn "LifeSciencesRunPipelineOperator" ./dags`
    ```

    *   *Remediation:* Migrate to Google Cloud Batch operators
        (`BatchCreateJobOperator`).
*   **Scan Command (ADLS to GCS):** `grep -rn "ADLSToGCSOperator" ./dags`
    *   *Remediation:* Ensure `file_system_name` is provided.

--------------------------------------------------------------------------------

### 3.3 Airflow 3 Migration checks

Use instructions from [references/airflow-3.md](references/airflow-3.md) when
migrating to Airflow 3.

--------------------------------------------------------------------------------

## Phase 4: Deployment & Verification

*Perform deployment and verification steps only if explicitly requested to do
so.*

### 4.1 Static Verification (when migrating to Airflow 3)

After applying code changes for Airflow 3, verify syntax correctness. If
available in the development environment, run static lint checks:

```bash
ruff check {target_dag_file} --select AIR30
```

Resolve any reported deprecation warnings before finalization. If ruff is not
available, recommend installing one.

### 4.2 Deployment to MSAA

#### 4.2.1 Get Target GCS Bucket Path (only when requested)

```bash
gcloud composer environments describe <TARGET_ENV> \
    --location <TARGET_REGION> \
    --format="value(config.dagGcsPrefix)"
```

*Expected Output:* `gs://<target-bucket-name>/dags`

### 4.2 Upload Modified DAGs and Bucket Dependencies (Only when requested)

*Perform this step only if explicitly requested to do so.* Copy the modified
DAGs and any backed-up bucket dependencies from your local workspace to the
target GCS bucket. *If you skipped the inspection step, ensure you have the
correct `<target-bucket-name>`.*

1.  **Upload DAGs:**

    ```bash
    gcloud storage cp -r ./dags/* gs://<target-bucket-name>/dags/
    ```

2.  **Upload Other Bucket Dependencies (If applicable):**

    ```bash
    gcloud storage cp -r ./migration_workspace/<dependency-folder> gs://<target-bucket-name>/<dependency-folder>
    ```

### 4.3 Verify DAGs via Airflow CLI

*Perform this step only if explicitly requested to upload modified DAGS to a
target environment (and after uploading).*

You can verify that your DAGs have been successfully uploaded, parsed, and
registered by the Airflow scheduler in the target environment using the Airflow
CLI.

1.  **List Registered DAGs:** Run the following command to list all DAGs
    registered in the target environment. Verify that your migrated DAGs appear
    in this list.

    ```bash
    gcloud composer environments run <TARGET_ENV> \
        --location <TARGET_REGION> \
        dags list
    ```

2.  **Check for Import Errors:** If some DAGs are missing from the list, or to
    ensure there are no parsing issues, check for import errors:

    ```bash
    gcloud composer environments run <TARGET_ENV> \
        --location <TARGET_REGION> \
        dags list-import-errors
    ```

    *Expected Output:*

    *   If there are no errors, the command will output `No data found`.
    *   If there are errors, it will list the file path and the traceback of the
        error.

*Note: It may take a couple of minutes for the Airflow scheduler to parse the
new files and for changes to reflect in these commands.*

### 4.4 Verify in Cloud Logging

*Perform this step only if explicitly requested to upload modified DAGS to a
target environment (and after uploading).* Monitor Cloud Logging for the target
environment to detect any runtime errors or import errors.

Run the following query in the **GCP Cloud Logging Console** (or via `gcloud
logging read`):

```query
resource.type="cloud_composer_environment"
resource.labels.environment_name="<TARGET_ENV>"
log_id("airflow-scheduler")
severity>=ERROR
```

--------------------------------------------------------------------------------

## Appendix: Local Environment Verification

If you want to verify your changes locally before deploying to the target
environment, you can use the Composer Local Development CLI tool
(`composer-dev`). Use
[references/local-development-environment.md](references/local-development-environment.md)
as a reference for interactions with local development environments.

© google · Apache-2.0 · google/skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor