DrDroid
Resource Cheatsheet

Apache Airflow

Quick reference guide and commands for Apache Airflow.

Download PDF

Connection

Access Airflow Web UI
Open http://localhost:8080 in browser (default URL)

Login to Airflow
Default credentials - username: admin, password: admin

Connect via CLI
airflow [command]

Docker Access
docker exec -it [airflow_container] bash

DAG Management

List all DAGs
airflow dags list

Trigger a DAG run
airflow dags trigger [dag_id]

Pause a DAG
airflow dags pause [dag_id]

Unpause a DAG
airflow dags unpause [dag_id]

Delete a DAG
airflow dags delete [dag_id]

Task Management

List tasks in a DAG
airflow tasks list [dag_id]

Test a task
airflow tasks test [dag_id] [task_id] [execution_date]

Run a task
airflow tasks run [dag_id] [task_id] [execution_date]

Clear a task's history
airflow tasks clear [dag_id] --task_regex [task_regex]

Monitoring and Debug

Show DAG information
airflow dags show [dag_id]

Get task logs
airflow tasks logs [dag_id] [task_id] [execution_date]

Test a DAG
airflow dags test [dag_id] [execution_date]

Render a task
airflow tasks render [dag_id] [task_id] [execution_date]

Database and Metadata

Initialize Airflow database
airflow db init

Reset Airflow database
airflow db reset

Upgrade Airflow database
airflow db upgrade

Check Airflow database
airflow db check

Configuration

Show Airflow configuration
airflow config list

Get a configuration option
airflow config get-value [section] [key]

Show all configurations
airflow config list

User Management

Create user
airflow users create --username [username] --firstname [firstname] --lastname [lastname] --role [role] --email [email]

List users
airflow users list

Delete user
airflow users delete --username [username]

Scheduler Commands

Start scheduler
airflow scheduler

Start webserver
airflow webserver

Start all components
airflow standalone