How to Use the Graph View in Apache Airflow®
The Graph view draws an Apache Airflow® Dag as boxes and lines: one box per task, one line per dependency, each box coloured by how the task did in the selected run. It's the quickest way to see where a run went wrong and which tasks that held back. This guide reads a run with a failed task on Airflow 3.4.0.
The Example
A Dag called graph_tour has four tasks: start runs first, then read_orders and read_returns side by side, and build_summary last, after both. read_returns fails on purpose, so the run has a success, a failure, and a task that never ran because of it.
Airflow's UI documentation describes the view: "Each node represents a task. Edges show the dependencies between them. You can click any task to view its metadata and recent run history."
Prerequisites
- Apache Airflow® running, for example with
airflow standalone, and itsdagsfolder in yourAIRFLOW_HOME.
Step 1: Write the Dag
Create dags/graph_tour.py:
from airflow.sdk import dag, task
@dag(schedule=None, tags=["demo"])
def graph_tour():
@task
def start():
print("Starting")
@task
def read_orders():
print("Reading orders")
@task
def read_returns():
raise ValueError("The returns file is missing")
@task
def build_summary():
print("Building the summary")
start() >> [read_orders(), read_returns()] >> build_summary()
graph_tour()
![The graph_tour.py Dag file in an editor window: four @task functions, read_returns raising ValueError("The returns file is missing"), and start() >> [read_orders(), read_returns()] >> build_summary().](https://strdewiridedevblogsprod.blob.core.windows.net/images/blog/data-engineering/apache-airflow/2026/airflow-graph-view-01-code.webp)
The last line sets the order: start before both tasks in the list, and both before build_summary. How to Set Task Dependencies with Bitshift Operators in Apache Airflow® explains >>.
Step 2: Open the Graph View
Trigger the Dag (How to Trigger a Dag from the Apache Airflow® UI walks through it) and open it. At the top left, click Show Graph, the icon with three joined boxes, or press g, which switches between the grid and the graph:

The graph reads from left to right:
- Each box is a task, with its name, its kind (
@task) and its state in this run. - The lines are the dependencies from the code:
startleads toread_returnsandread_orders, and both lead tobuild_summary. - The colours follow the state: green for
success, red forfailedand orange forupstream_failed.
build_summary never ran. Airflow's task documentation defines the state: "upstream_failed: An upstream task failed and the Trigger Rule says we needed it". By default, a task needs all the tasks before it to succeed, and read_returns failed.
Step 3: Open a Task from the Graph
Click read_returns. Its box gets a blue border, and the task opens in a panel next to the graph, on its Logs tab:

The panel shows the task's state, Failed, and its log. The last lines of the traceback point to the cause: raise ValueError("The returns file is missing") in read_returns. The other tabs, such as XCom and Rendered Templates, are there too, so you can check a task without leaving the graph.
The long lines continue on the next rows because line wrapping was turned on in my browser. How to Wrap Long Lines in a Task Log in the Apache Airflow® UI shows that setting.
Step 4: Change the Graph's Direction
Click Options, the gear icon above the graph:

Graph Direction offers Left to Right, Right to Left, Bottom to Top and Top to Bottom. With Top to Bottom, the same graph reads downwards:

The tasks and lines are the same; only the layout changed. Top to bottom suits Dags with many steps in a row, which get wide from left to right.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
| Opening the failed task's log only | You see the error, but not which tasks it held back | Look at the graph first: the orange upstream_failed boxes are the tasks that didn't run because of it |
| Assuming the upper of two side-by-side tasks runs first | There's no line between read_returns and read_orders, so neither waits for the other, and Airflow can run them at the same time | Add >> between them if one must wait for the other |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| The boxes show no state | The Dag hasn't run yet: a Dag without runs showed its task with only its name and @task | Trigger the Dag |
| A task you expected isn't in the graph | The Dag function defines the task but never calls it. A @task function only becomes a task when it's called | Call the task function in the Dag function |
FAQ
What's the difference between the Graph and the Grid?
The Graph shows one run as boxes and lines, so it's best for seeing how tasks connect. The Grid shows the tasks as rows and recent runs as columns, so it's best for comparing runs. g switches between them.
Conclusion
The Graph view showed graph_tour as four boxes: read_returns failed in red, and build_summary, in orange, never ran because of it. Clicking read_returns opened its log with the error, and Options changed the layout to top to bottom.
Additional Resources
- UI overview: Graph View — what the view shows.
- Task instances — every task state and what it means.
Apache®, Apache Airflow and Airflow® are either registered trademarks or trademarks of The Apache Software Foundation in the United States and/or other countries. No endorsement by The Apache Software Foundation is implied by the use of these marks.
