You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "rolfschleiss (via GitHub)" <gi...@apache.org> on 2025/10/14 16:56:28 UTC

[I] Dynamic DAG parameter options based on external configuration (dropdown / radio support) [airflow]

rolfschleiss opened a new issue, #56632:
URL: https://github.com/apache/airflow/issues/56632

   ### Description
   
   When triggering a DAG in the Airflow web UI, all parameters defined in the params section are currently rendered as plain text input fields.
   It would be highly useful if Airflow supported dynamic UI field types (e.g. dropdowns or radio buttons) that can populate their options from external configuration files, such as INI, YAML or JSON.
   
   ### Use case/motivation
   
   In many environments, DAGs depend on configuration files that define available interfaces, systems, or targets.
   For example, an INI file might describe multiple interfaces with different types:
   
   ```
   [InterfaceA]
   TYPE = Script
   
   [InterfaceB]
   TYPE = EBICS
   
   [InterfaceC]
   TYPE = Script
   ```
   
   When triggering the DAG, users should be able to select from all sections that match a given condition (e.g. TYPE = Script), using a dropdown or radio button instead of free-text entry.
   
   Example goal:
   
   Show a dropdown listing InterfaceA and InterfaceC, because both are defined as TYPE = Script in the INI file.
   
   This would make DAG triggering:
   
   - safer (no typos in interface names),
   - more dynamic (values adapt automatically to config changes),
   - and much more user-friendly for non-technical operators.
   
   Alternatively, Airflow could provide a plugin interface to populate parameter choices dynamically,
   so that DAG authors can implement their own logic for which options should appear.
   
   Benefits
   
   - Greatly improves safety and UX for parameterized DAGs.
   - Keeps Airflow configuration-driven (no need to hardcode options).
   - Enables dynamic parameter lists that reflect live configuration.
   - Avoids invalid values and reduces operational mistakes.
   
   Possible Implementation Notes
   
   - Extend the Web UI (React) to render dropdowns/radio fields when ui metadata is provided.
   - Allow a DAG to expose a small API or callable hook to fetch dynamic choices.
   - Could reuse existing Airflow variable/config reading mechanisms.
   
   Proposed Change
   
   Allow params definitions to reference an external source for valid options.
   
   Example:
   
   ```
   with DAG(
       "interface_trigger_dag",
       params={
           "interface_name": {
               "source": "config/interfaces.ini",
               "filter": {"TYPE": "Script"},
               "key": "section_name",
               "ui": "dropdown"  # or "radio"
           }
       },
   ) as dag:
       ...
   ```
   
   Labels:
   enhancement, UI, params, feature-request, dynamic-config
   
   ### Related issues
   
   #56427 – [DAG Params Enum not works as expected](https://github.com/apache/airflow/issues/56427?utm_source=chatgpt.com)
   : Dropdown rendering for enum params not functioning correctly.
   
   #42524 – [DAG Param incorrectly convert enum objects to strings](https://github.com/apache/airflow/issues/42524?utm_source=chatgpt.com)
   : Enum parameters are displayed as plain strings instead of UI choices.
   
   #31399 – [Trigger UI Form Dropdowns with enums do not set default correctly](https://github.com/apache/airflow/issues/31399?utm_source=chatgpt.com)
   : Dropdown default value not applied properly in DAG trigger form.
   
   #48481 – [Multiple-choice Params (discussion)](https://github.com/apache/airflow/discussions/48481?utm_source=chatgpt.com)
   : Community discussion about extending enum params to support richer UI controls.
   
   #39904 – [Dynamic DAG Params behave differently in manually triggered runs](https://github.com/apache/airflow/issues/39904?utm_source=chatgpt.com)
   : Dynamic parameter behavior inconsistency between manual and scheduled runs.
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Dynamic DAG parameter options based on external configuration (dropdown / radio support) [airflow]

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi closed issue #56632: Dynamic DAG parameter options based on external configuration (dropdown / radio support)
URL: https://github.com/apache/airflow/issues/56632


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Dynamic DAG parameter options based on external configuration (dropdown / radio support) [airflow]

Posted by "venkatamandavilli-code (via GitHub)" <gi...@apache.org>.
venkatamandavilli-code commented on issue #56632:
URL: https://github.com/apache/airflow/issues/56632#issuecomment-4723825135

   Thanks for raising this enhancement.
   
   I can see strong practical value in this, especially for production environments where DAGs are triggered by business or operations users who may not know the exact parameter values to enter manually.
   
   In enterprise workflows, parameter values often come from controlled configuration sources such as interface lists, system identifiers, target environments, or business process codes. Allowing users to select valid values from a dropdown or radio option would reduce typo-related failures and make manually triggered DAGs safer for non-technical users.
   
   From an implementation perspective, I think it may be useful to separate two concerns:
   
   1. Static UI choices that are already known at DAG parse time, such as enum-style params.
   2. Dynamic choices that are resolved from an approved source or plugin mechanism.
   
   The dynamic option is very useful, but it may need careful design around security, performance, and where the values are resolved from, especially if the UI needs to fetch choices at trigger time.
   
   This feature would be especially helpful for shared Airflow platforms where multiple teams trigger parameterized DAGs and need guardrails to avoid invalid inputs.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Dynamic DAG parameter options based on external configuration (dropdown / radio support) [airflow]

Posted by "dylanschw (via GitHub)" <gi...@apache.org>.
dylanschw commented on issue #56632:
URL: https://github.com/apache/airflow/issues/56632#issuecomment-3905051757

   Is this free to work on?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Dynamic DAG parameter options based on external configuration (dropdown / radio support) [airflow]

Posted by "digvijay-y (via GitHub)" <gi...@apache.org>.
digvijay-y commented on issue #56632:
URL: https://github.com/apache/airflow/issues/56632#issuecomment-3406303053

   I'm up for it!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Dynamic DAG parameter options based on external configuration (dropdown / radio support) [airflow]

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on issue #56632:
URL: https://github.com/apache/airflow/issues/56632#issuecomment-5194456443

   Closing as done. We support Select menus now and optional from external config works.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org