Skip to main content

How to See a Task's Rendered Templates in the Apache Airflow® UI

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

Some task parameters in Apache Airflow® can hold {{ }} templates, placeholders that Airflow fills in just before the task runs. The Rendered Templates tab shows each one as Airflow filled it in, so you can check the exact command a task ran. This guide renders a BashOperator command on Airflow 3.4.0.

The Example​

A Dag called show_run_id has one BashOperator task, print_run_id, that runs echo "This is run {{ run_id }} of {{ dag.dag_id }}". {{ run_id }} is replaced by the run's ID and {{ dag.dag_id }} by the Dag's ID.

Airflow's UI documentation describes the tab: it "Displays the rendered version of templated fields in your task. Useful for debugging context variables or verifying dynamic content." Templated fields are the parameters Airflow renders. For BashOperator, those are bash_command, env and cwd.

Prerequisites​

  • Apache Airflow® running, for example with airflow standalone, and its dags folder in your AIRFLOW_HOME.

Step 1: Write a Dag with a Template​

Create dags/show_run_id.py:

dags/show_run_id.py
from airflow.providers.standard.operators.bash import BashOperator
from airflow.sdk import dag


@dag(schedule=None, tags=["demo"])
def show_run_id():
BashOperator(
task_id="print_run_id",
bash_command='echo "This is run {{ run_id }} of {{ dag.dag_id }}"',
)


show_run_id()

The show_run_id.py Dag file in an editor window: one BashOperator, print_run_id, whose bash_command echoes This is run, then the run_id template, of, then the dag.dag_id template, each in double braces.

  • The double braces mark the templates. Airflow uses Jinja to fill them in, before bash sees the command.
  • run_id and dag are variables Airflow makes available to every template. The templates reference lists all of them.

Step 2: Open the Rendered Templates Tab​

Trigger the Dag. Then open it, click the run's square for print_run_id in the grid on the left, and open the Rendered Templates tab:

The print_run_id task instance of the show_run_id Dag, Rendered Templates tab: bash_command with the value echo "This is run manual__2026-12-04T10:29:14.261713+00:00 of show_run_id".

The tab lists each templated field that has a value, here bash_command, with the templates filled in. {{ run_id }} became manual__2026-12-04T10:29:14.261713+00:00, the same run ID the page shows at the top, and {{ dag.dag_id }} became show_run_id.

Step 3: Compare It with the Log​

Open the Logs tab:

The Logs tab of the same task: Running command with echo "This is run manual__2026-12-04T10:29:14.261713+00:00 of show_run_id", Output:, the same sentence, and Command exited with return code 0.

The Running command line shows the same rendered command, and the output is the sentence it printed. The Rendered Templates tab also shows fields that never appear in the log: for a BashOperator with env={"FILE_NAME": ...}, it listed env too, with the value filled in, "FILE_NAME": "report-2026.txt".

Common Mistakes​

MistakeWhat happensDo this instead
Single braces, as in a Python f-string: {run_id}Nothing is filled in: the task printed This is run {run_id}Use double braces: {{ run_id }}
A misspelled variable: {{ runid }}The task fails with jinja2.exceptions.UndefinedError: 'runid' is undefinedCheck the name in the templates reference

Troubleshooting​

SymptomLikely causeFix
UndefinedError: '<name>' is undefinedThe template uses a variable that doesn't existFix the name in the template
Braces in the task's outputThe template has single braces, so Jinja ignored itUse double braces

FAQ​

What's the difference between the Rendered Templates and XCom tabs?​

The Rendered Templates tab shows what went into a task: its parameters after Airflow filled in the templates. The XCom tab shows what came out of it: the values it stored for other tasks. How to See a Task's XComs in the Apache Airflow® UI covers that tab.

Conclusion​

The Rendered Templates tab showed print_run_id's bash_command after Airflow filled in its templates: {{ run_id }} became the run's ID and {{ dag.dag_id }} the Dag's ID. When a templated task does something unexpected, check this tab first: it shows exactly what Airflow handed to the task.

Additional Resources​

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.