Loading...
Loading...
Manages Apache Airflow operations including listing, testing, running, and debugging DAGs, viewing task logs, checking connections and variables, and monitoring system health. Use when working with Airflow DAGs, pipelines, workflows, or tasks, or when the user mentions testing dags, running pipelines, debugging workflows, dag failures, task errors, dag status, pipeline status, list dags, show connections, check variables, or airflow health.
npx skill4agent add astronomer/agents airflowafafuvx --from astro-airflow-mcp@latest af <command>afuvx --from astro-airflow-mcp@latest af# Add a new instance
af instance add prod --url https://airflow.example.com --token "$API_TOKEN"
af instance add staging --url https://staging.example.com --username admin --password admin
# List and switch instances
af instance list # Shows all instances in a table
af instance use prod # Switch to prod instance
af instance current # Show current instance
af instance delete old-instance
# Auto-discover instances (use --dry-run to preview first)
af instance discover --dry-run # Preview all discoverable instances
af instance discover # Discover from all backends (astro, local)
af instance discover astro # Discover Astro deployments only
af instance discover astro --all-workspaces # Include all accessible workspaces
af instance discover local # Scan common local Airflow ports
af instance discover local --scan # Deep scan all ports 1024-65535
# IMPORTANT: Always run with --dry-run first and ask for user consent before
# running discover without it. The non-dry-run mode creates API tokens in
# Astro Cloud, which is a sensitive action that requires explicit approval.
# Override instance for a single command
af --instance staging dags list~/.af/config.yaml--configAF_CONFIG${VAR}instances:
- name: prod
url: https://airflow.example.com
auth:
token: ${AIRFLOW_API_TOKEN}export AIRFLOW_API_URL=http://localhost:8080
export AIRFLOW_AUTH_TOKEN=your-token-here
# Or username/password:
export AIRFLOW_USERNAME=admin
export AIRFLOW_PASSWORD=adminaf --airflow-url http://localhost:8080 --token "$TOKEN" <command>| Command | Description |
|---|---|
| System health check |
| List all DAGs |
| Get DAG details |
| Full DAG investigation |
| Get DAG source code |
| Pause DAG scheduling |
| Resume DAG scheduling |
| List import errors |
| List DAG warnings |
| DAG run statistics |
| List DAG runs |
| Get run details |
| Trigger a DAG run |
| Trigger and wait for completion |
| Diagnose failed run |
| List tasks in DAG |
| Get task definition |
| Get task instance |
| Get task logs |
| Airflow version |
| Full configuration |
| List connections |
| List variables |
| Get specific variable |
| List pools |
| Get pool details |
| List plugins |
| List providers |
| List assets/datasets |
| Direct REST API access |
| List available API endpoints |
| List endpoints matching pattern |
af dags listaf dags explore <dag_id>af dags get <dag_id>af dags source <dag_id>af dags pause <dag_id>af dags unpause <dag_id>af dags errorsaf runs listaf runs trigger <dag_id>af runs trigger-wait <dag_id>af runs diagnose <dag_id> <run_id>af tasks list <dag_id>af tasks logs <dag_id> <run_id> <task_id>af config versionaf config connectionsaf config poolsaf healthaf api lsaf api ls --filter variableaf api xcom-entries -F dag_id=X -F task_id=Yaf api event-logs -F dag_id=Xaf api connections -X POST --body '{...}'af api variables -X POST -F key=name -f value=val# 1. List recent runs to find failure
af runs list --dag-id my_dag
# 2. Diagnose the specific run
af runs diagnose my_dag manual__2024-01-15T10:00:00+00:00
# 3. Get logs for failed task (from diagnose output)
af tasks logs my_dag manual__2024-01-15T10:00:00+00:00 extract_data# 1. Overall system health
af health
# 2. Check for broken DAGs
af dags errors
# 3. Check pool utilization
af config pools# Get comprehensive overview (metadata + tasks + source)
af dags explore my_dag# Check if paused
af dags get my_dag
# Check for import errors
af dags errors
# Check recent runs
af runs list --dag-id my_dag# Option 1: Trigger and wait (blocking)
af runs trigger-wait my_dag --timeout 1800
# Option 2: Trigger and check later
af runs trigger my_dag
af runs get my_dag <run_id>instanceaf dags list
# {
# "total_dags": 5,
# "returned_count": 5,
# "dags": [...]
# }jq# Find failed runs
af runs list | jq '.dag_runs[] | select(.state == "failed")'
# Get DAG IDs only
af dags list | jq '.dags[].dag_id'
# Find paused DAGs
af dags list | jq '[.dags[] | select(.is_paused == true)]'# Get logs for specific retry attempt
af tasks logs my_dag run_id task_id --try 2
# Get logs for mapped task index
af tasks logs my_dag run_id task_id --map-index 5af apiaf api# Discover available endpoints
af api ls
af api ls --filter variable
# Basic usage
af api dags
af api dags -F limit=10 -F only_active=true
af api variables -X POST -F key=my_var -f value="my value"
af api variables/old_var -X DELETE-F key=value-f key=valuetesting-dagsdebugging-dagsauthoring-dagsmanaging-astro-local-env