In the TOOL plugin, the dynamic-select type always loses data on the orchestration page. #15240

Closed
opened 2026-02-21 19:20:49 -05:00 by yindo · 7 comments
Owner

Originally created by @gao-xiangyang on GitHub (Jul 10, 2025).

Originally assigned to: @jubinsoni on GitHub.

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.5.1

Cloud or Self Hosted

Cloud

Steps to reproduce

I've created a tool plugin and am using dynamic-select to select data from an API. I've successfully got it working, but it's really confusing that when I focus on my tool node, select data from the dropdown, then switch to another node and switch back, the previously selected data is lost.

  1. selected:
    Image

  2. after switch node :
    Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @gao-xiangyang on GitHub (Jul 10, 2025). Originally assigned to: @jubinsoni on GitHub. ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.5.1 ### Cloud or Self Hosted Cloud ### Steps to reproduce I've created a tool plugin and am using dynamic-select to select data from an API. I've successfully got it working, but it's really confusing that when I focus on my tool node, select data from the dropdown, then switch to another node and switch back, the previously selected data is lost. 1. selected: <img width="1971" height="1163" alt="Image" src="https://github.com/user-attachments/assets/2c74ef62-92a2-4e79-9a94-367ba69ff56a" /> 2. after switch node : <img width="1629" height="1087" alt="Image" src="https://github.com/user-attachments/assets/860352a4-96e2-4e2c-a02e-d4a0ec3de803" /> ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 buggood first issue labels 2026-02-21 19:20:49 -05:00
yindo closed this issue 2026-02-21 19:20:50 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 10, 2025):

Hi @gao-xiangyang! I'm Dosu and I’m helping the dify team.

This isn't true data loss—the selected value for dynamic-select is still stored in the workflow state, but when you switch nodes, the dropdown options are re-fetched from your API. If the previously selected value isn't included in the new options, the UI can't display it, so it appears empty even though the value is still present in the backend/store. This is a known UI limitation with how dynamic-select is implemented: the visible value is tightly coupled to the current options array, which is refreshed on each node focus or mount.

To avoid this, make sure your API always returns the previously selected value in its options response, even if it wouldn't normally be included. Alternatively, a UI enhancement could display non-present selected values as disabled or informational items, but this isn't currently built-in. The underlying state/data flows are working as designed—it's just a mismatch between UI expectations and async option fetching. For now, the best workaround is to ensure your dynamic options endpoint always includes the selected value in its response, so the UI can display it after switching nodes.
Reference: dynamic-select implementation and state management

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jul 10, 2025): <!-- Greeting --> Hi @gao-xiangyang! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> This isn't true data loss—the selected value for dynamic-select is still stored in the workflow state, but when you switch nodes, the dropdown options are re-fetched from your API. If the previously selected value isn't included in the new options, the UI can't display it, so it appears empty even though the value is still present in the backend/store. This is a known UI limitation with how dynamic-select is implemented: the visible value is tightly coupled to the current options array, which is refreshed on each node focus or mount. To avoid this, make sure your API always returns the previously selected value in its options response, even if it wouldn't normally be included. Alternatively, a UI enhancement could display non-present selected values as disabled or informational items, but this isn't currently built-in. The underlying state/data flows are working as designed—it's just a mismatch between UI expectations and async option fetching. For now, the best workaround is to ensure your dynamic options endpoint always includes the selected value in its response, so the UI can display it after switching nodes. [Reference: dynamic-select implementation and state management](https://github.com/langgenius/dify/blob/94a13d7d62067f427d2419a5b8541c2236d95a40/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/81d58aea-f83c-4c28-aa01-930300459ad9?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/81d58aea-f83c-4c28-aa01-930300459ad9?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/81d58aea-f83c-4c28-aa01-930300459ad9?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/81d58aea-f83c-4c28-aa01-930300459ad9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/81d58aea-f83c-4c28-aa01-930300459ad9?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/81d58aea-f83c-4c28-aa01-930300459ad9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/81d58aea-f83c-4c28-aa01-930300459ad9?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/22147)
Author
Owner

@gao-xiangyang commented on GitHub (Jul 10, 2025):

I'm using fixed dummy data, and it always returns the same list.

@gao-xiangyang commented on GitHub (Jul 10, 2025): I'm using fixed dummy data, and it always returns the same list.
Author
Owner

@gao-xiangyang commented on GitHub (Jul 12, 2025):

After Dify was upgraded to version 1.6.0, the dynamic-select was not triggered.

version: 1.51
Image

version: 1.6.0 , cloud dify

Image
@gao-xiangyang commented on GitHub (Jul 12, 2025): After Dify was upgraded to version 1.6.0, the **dynamic-select** was not triggered. version: 1.51 <img width="1017" height="630" alt="Image" src="https://github.com/user-attachments/assets/2f823255-badd-4d72-b9b5-92d6f8081493" /> version: 1.6.0 , cloud dify <img width="1350" height="759" alt="Image" src="https://github.com/user-attachments/assets/f29cea67-429b-439e-b912-ef90a9a19d7c" />
Author
Owner

@gao-xiangyang commented on GitHub (Jul 12, 2025):

@laipz8200

@gao-xiangyang commented on GitHub (Jul 12, 2025): @laipz8200
Author
Owner

@ailiailiai1111 commented on GitHub (Jul 24, 2025):

Has this problem been solved? I’ve encountered the same issue.

@ailiailiai1111 commented on GitHub (Jul 24, 2025): Has this problem been solved? I’ve encountered the same issue.
Author
Owner

@jubinsoni commented on GitHub (Aug 3, 2025):

to fix
https://github.com/langgenius/dify/pull/23323

pls review @crazywoola

@jubinsoni commented on GitHub (Aug 3, 2025): to fix https://github.com/langgenius/dify/pull/23323 pls review @crazywoola
Author
Owner

@laipz8200 commented on GitHub (Aug 4, 2025):

fixed in #23323

@laipz8200 commented on GitHub (Aug 4, 2025): fixed in #23323
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#15240