Skip to content

Dynamic Task Mapping – map_index_template value is not rendered in the UI during running state #56722

Description

@Pad71

Apache Airflow version

3.1.0

If "Other Airflow 2/3 version" selected, which one?

No response

What happened?

When using Dynamic Task Mapping, it is possible to define the parameter map_index_template, which replaces the numeric map_index value in the Airflow UI.
This improves readability by allowing users to label dynamically generated task instances with meaningful identifiers.

However, there is an issue with how this template value is rendered in the UI:
The expression from map_index_template is not displayed while the mapped task is in the running state.
During this phase, the UI continues to show the default numeric map_index value.

The template value is correctly displayed once the task completes — both for success and failed states — but not while the task is still running.
This behavior reduces the usability of map_index_template, since users cannot easily identify which mapped task instance is currently executing.

What you think should happen instead?

The value from map_index_template should be rendered and visible in the UI as soon as the mapped task instance is created, including while it is in the running state.

How to reproduce

  • Define a mapped task with map_index_template set to a Jinja expression.
  • Trigger the DAG and monitor the mapped task instances in the Airflow UI.
  • Observe that while tasks are in the running state, the UI shows only numeric indices.
  • After tasks complete (success or failed), the template values are correctly rendered.

Operating System

Windows 11, docker

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions