Skip to content

HITLOperator doesn't always display options #64413

Closed

Description

@farrukh-t

Apache Airflow version

3.1.8

What happened and how to reproduce it?

It appears that HITLOperator doesn't always display the options in the UI. I think it might be caused either by the length of an individual option string or perhaps by the count of options

To reproduce, create a DAG with a HITLOperator:

import pendulum
from airflow.providers.standard.operators.hitl import HITLOperator
from airflow.sdk import DAG

with DAG(
    dag_id="hitl_missing_options",
    start_date=pendulum.datetime(2025, 1, 1, tz="UTC"),
    schedule=None,
    catchup=False,
):
    choose_environment = HITLOperator(
        task_id="choose_environment",
        subject="Select a role to proceed.",
        body="Please select one of the valid roles below to proceed.",
        options=[
            "Creator",
            "Explorer",
            "ExplorerCanPublish",
            "Viewer",
        ],
    )

In the UI, trigger the DAG, then navigate over to Required Action tab - it's supposed to let you select one of the options specified in the HITLOperator operator call, but they are nowhere to be seen:

Image

If I comment out one of the options (ExplorerCanPublish in my example) from the options list, like:

    choose_environment = HITLOperator(
        task_id="choose_environment",
        subject="Select a role to proceed.",
        body="Please select one of the valid roles below to proceed.",
        options=[
            "Creator",
            "Explorer",
            # "ExplorerCanPublish",
            "Viewer",
        ],
    )

I can see the 3 options as buttons in the UI:

Image

If I add another option (ViewerWithPublish in my example), like:

    choose_environment = HITLOperator(
        task_id="choose_environment",
        subject="Select a role to proceed.",
        body="Please select one of the valid roles below to proceed.",
        options=[
            "Creator",
            "Explorer",
            "ExplorerCanPublish",
            "Viewer",
            "ViewerWithPublish",
        ],
    )

I can see all of the options in a dropdown list:

Image

What you think should happen instead?

The options should be shown either in a dropdown or as buttons, and the user should be able to select an option for the DAG to proceed.

Operating System

Debian GNU/Linux 12 (bookworm)

Versions of Apache Airflow Providers

No response

Deployment

Other Docker-based deployment

Deployment details

A VSCode devcontainer environment that runs db migrations and starts scheduler, api-server, dag processor and a triggerer for local development.

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. changed the title [-]HITLOperator doesn't display options when options are[/-] [+]HITLOperator doesn't always display options[/+] on Mar 29, 2026
  2. ShubhamGondane commented on Mar 30, 2026

    @ShubhamGondane
    Contributor

    It looks like the UI has two rendering paths: buttons for fewer options and a dropdown for more. With exactly 4 options, neither path triggers due to an off-by-one gap in the threshold, so nothing renders.

  3. added a commit that references this issue on Mar 30, 2026
    e25470d
  4. added a commit that references this issue on Mar 30, 2026
    3c4f3b9
  5. added a commit that references this issue on Mar 30, 2026
    a48d8a5
  6. added a commit that references this issue on Mar 30, 2026
    9986f8a
  7. added a commit that references this issue on Apr 1, 2026
    b04e0ed
  8. added a commit that references this issue on Apr 3, 2026
    6f28fa2
  9. added a commit that references this issue on Apr 7, 2026
    694ca61
  10. added a commit that references this issue on Apr 8, 2026
    af87cb1
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions