Repository navigation
HITLOperator doesn't always display options #64413
Description
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:
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:
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:
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
- I agree to follow this project's Code of Conduct
Activity
[-]HITLOperator doesn't display options when options are[/-][+]HITLOperator doesn't always display options[/+]ShubhamGondane commentedon Mar 30, 2026
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.
Fix HITLOperator not displaying options when exactly 4 are provided
Fix per-option button rendering for 4 options
Fix per-option button rendering for 4 options (#64453)
[v3-2-test] Fix per-option button rendering for 4 options (#64453)
[v3-2-test] Fix per-option button rendering for 4 options (#64453) (#…
Fix per-option button rendering for 4 options (apache#64453)
Fix per-option button rendering for 4 options (apache#64453)
[v3-2-test] Fix per-option button rendering for 4 options (#64453) (#…