data-airflow-dbt-orchestration
Use when the user asks to run dbt from Airflow, Astronomer Cosmos, DbtCloudRunJobOperator, dbt in an Airflow 3 DAG, Asset-based scheduling or orchestrate a…
от j4flmao★ 47 звёзд на GitHub
Установить data-airflow-dbt-orchestration в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Airflow + dbt Orchestration
Purpose
Run dbt transformations on a schedule or when upstream data lands, with retries, alerting and lineage, without turning Airflow into a compute engine. Airflow decides when and in what order; the warehouse does the work; dbt defines the SQL models and tests. The main design decision is how much of the dbt graph Airflow should see.
Agent Protocol
Trigger
"airflow dbt", "run dbt from airflow", "cosmos", "DbtCloudRunJobOperator", "dbt task group", "dbt in dag", "airflow 3 migration dbt", "orchestrate dbt".
Input Context
- Airflow version/distribution (OSS, Astronomer, MWAA, Cloud Composer), dbt Core vs dbt Cloud (platform), warehouse.
- Project size (number of models), runtime, SLAs, upstream ingestion triggers.
Output Artifact
Integration choice + DAG code + dbt selectors/tests + CI steps. No file unless requested.
Response Format
Pattern: {Cosmos per-model|dbt Cloud job|single dbt build task|KubernetesPodOperator}
Schedule: {cron|Asset-triggered}
Selectors: {dbt --select ...}
Failure handling: {retries, alerts, partial reruns}
Completion Criteria
- DAG uses Airflow 3 APIs (
schedule=,airflow.sdkimports),catchupset explicitly. - dbt tests run in the same flow (
dbt build) and failures stop downstream publishing. - Credentials come from Airflow connections/secret backend, never from code.
- Reruns possible for a failed model subset.
Integration Patterns
| Pattern | Pros | Cons | Use when |
|---|---|---|---|
Astronomer Cosmos (DbtDag / DbtTaskGroup) |
One Airflow task per model/test: retries, lineage, timing per model | Large projects create big DAGs; parse time | dbt Core, < ~1000 models, want model-level visibility |
dbt Cloud job (DbtCloudRunJobOperator) |
dbt platform handles environments, docs, state | Opaque inside Airflow; extra cost | Team already on dbt Cloud |
Single dbt build task (Bash/Kubernetes pod) |
Simplest, one container image | All-or-nothing retry; less visibility | Small projects, early stage |
KubernetesPodOperator with dbt image |
Isolated deps, scalable | Pod startup overhead | dbt deps conflict with Airflow deps |
Keep dbt and Airflow Python dependencies isolated (separate virtualenv or container); they conflict frequently.
Airflow 3 Essentials
schedule_intervalandtimetablearguments were removed; useschedule=.- DAG authoring imports come from
airflow.sdk(dag,task,DAG,Asset); oldairflow.models/airflow.decoratorspaths are deprecated. execution_datewas removed; uselogical_date.catchupnow defaults to False.- Datasets were renamed Assets; Asset-triggered DAGs replace sensors for "run when upstream lands".
- Core operators moved to providers, e.g.
airflow.providers.standard.operators.bash.BashOperator. - Ruff rules
AIR30xflag removed/moved APIs during upgrades.
Example: Cosmos (dbt Core, model-level tasks)
from datetime import datetime
from pathlib import Path
from cosmos import DbtDag, ExecutionConfig, ProfileConfig, ProjectConfig
from cosmos.profiles import PostgresUserPasswordProfileMapping
DBT_PROJECT = Path("/usr/local/airflow/dbt/analytics")
profile_config = ProfileConfig(
profile_name="analytics",
target_name="prod",
profile_mapping=PostgresUserPasswordProfileMapping(
conn_id="warehouse_postgres", # Airflow connection holds credentials
profile_args={"schema": "analytics"},
),
)
analytics_dbt = DbtDag(
dag_id="analytics_dbt",
project_config=ProjectConfig(DBT_PROJECT),
profile_config=profile_config,
execution_config=ExecutionConfig(dbt_executable_path="/usr/local/airflow/dbt_venv/bin/dbt"),
schedule="0 5 * * *",
start_date=datetime(2026, 1, 1),
catchup=False,
default_args={"retries": 2},
)
Check the Cosmos release notes for the minimum version that supports your Airflow version.
Example: dbt Cloud Job Triggered by an Upstream Asset
from datetime import datetime
from airflow.sdk import Asset, dag
from airflow.providers.dbt.cloud.operators.dbt import DbtCloudRunJobOperator
raw_orders = Asset("s3://lake/raw/orders/") # produced by the ingestion DAG
@dag(schedule=[raw_orders], start_date=datetime(2026, 1, 1), catchup=False)
def dbt_cloud_orders():
DbtCloudRunJobOperator(
task_id="run_orders_job",
dbt_cloud_conn_id="dbt_cloud",
job_id=12345, # dbt Cloud job id
wait_for_termination=True,
check_interval=30,
timeout=3600,
)
dbt_cloud_orders()
The ingestion task declares outlets=[raw_orders]; when it succeeds, this DAG runs.
Example: Single dbt build Task
from datetime import datetime
from airflow.sdk import dag
from airflow.providers.standard.operators.bash import BashOperator
@dag(schedule="@daily", start_date=datetime(2026, 1, 1), catchup=False)
def dbt_build_daily():
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл data-airflow-dbt-orchestration?
Use when the user asks to run dbt from Airflow, Astronomer Cosmos, DbtCloudRunJobOperator, dbt in an Airflow 3 DAG, Asset-based scheduling or orchestrate a daily ETL with Airflow and dbt. Produces the integration pattern, DAG code, model-level retries and CI. Not for general ETL architecture (use data-etl-pipeline).
Как установить скилл data-airflow-dbt-orchestration?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл data-airflow-dbt-orchestration запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…