Skip to content

Add team name to dag attributes and task context variables #65465

Closed

Description

@stephen-bracken

Description

When running in multi team mode we should pass the team name that the task belongs to into the TaskInstance context variables, and possibly add a DAG.team_name attribute. This would be useful for setting team level policies in the airflow_local_settings.py hooks.

Use case/motivation

Setting team level policies for tasks, dags in airflow_local_settings.py and providing team template variables using jinja2, e.g. {{ ti.team_name }}, {{ dag.team_name }} or just {{ team_name }}. This would allow us to create team separated log file paths in the log_file_nametemplate config setting with their own team specific access policies.

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:feature
    needs-triage
    on Apr 18, 2026
  2. kunaldevsahu commented on Apr 18, 2026

    @kunaldevsahu

    @stephen-bracken
    I’d like to work on this issue and contribute a fix. Please let me know if I can proceed.

  3. jroachgolf84 commented on Apr 20, 2026

    @jroachgolf84
    Collaborator

    @kunaldevsahu, please feel free to open a PR for this issue.

  4. removed
    needs-triage
    on Apr 20, 2026
  5. ElangoSubramani commented on Apr 21, 2026

    @ElangoSubramani

    Hi, Anyone still working on this?
    If not, Can I work on this?

  6. stephen-bracken commented on May 21, 2026

    @stephen-bracken
    ContributorAuthor

    provided as dag_run.team_name in #65617

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corekind:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions