0
0
Apache Airflowdevops~5 mins

Airflow UI overview - Commands & Configuration

Choose your learning style9 modes available
Introduction
Airflow UI helps you see and control your workflows easily. It shows what tasks are running, finished, or failed, so you can fix problems fast.
When you want to check if your scheduled tasks ran successfully today.
When you need to restart a failed task without running the whole workflow again.
When you want to see the order and timing of tasks in your workflow.
When you want to pause or resume a workflow temporarily.
When you want to view logs to understand why a task failed.
Commands
Starts the Airflow webserver on port 8080 so you can open the UI in your browser.
Terminal
airflow webserver --port 8080
Expected OutputExpected
[2024-06-01 12:00:00,000] {webserver.py:123} INFO - Starting Airflow webserver on port 8080 [2024-06-01 12:00:00,500] {webserver.py:130} INFO - Airflow webserver running
--port 8080 - Sets the port number where the UI will be accessible
Opens the Airflow UI in your default web browser to interact with your workflows visually.
Terminal
open http://localhost:8080
Expected OutputExpected
No output (command runs silently)
Lists all the workflows (DAGs) Airflow knows about, so you can see what is available to run or monitor.
Terminal
airflow dags list
Expected OutputExpected
example_dag my_data_pipeline send_reports
Shows all tasks inside the example_dag workflow, helping you understand its steps.
Terminal
airflow tasks list example_dag
Expected OutputExpected
task_1 task_2 task_3
Key Concept

If you remember nothing else from this pattern, remember: The Airflow UI is your control center to watch, manage, and troubleshoot your workflows easily.

Common Mistakes
Trying to open the UI before starting the webserver
The UI won't load because the webserver that serves it is not running.
Always start the Airflow webserver first with 'airflow webserver --port 8080' before opening the UI.
Not checking task logs when a task fails
Without logs, you won't know why the task failed and can't fix the issue.
Use the UI to open task logs and read error messages to troubleshoot.
Summary
Start the Airflow webserver to access the UI on a web browser.
Use the UI to view workflows (DAGs) and their tasks visually.
Check task status and logs in the UI to monitor and troubleshoot workflows.