The variable of the structured output is of type Numer, but is considered a string by the subsequent conditional branch, and numeric operators cannot be selected #16456

Closed
opened 2026-02-21 19:26:10 -05:00 by yindo · 2 comments
Owner

Originally created by @wck-wei on GitHub (Aug 26, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

Version 1.6.0

Cloud or Self Hosted

Self Hosted (Docker), Cloud

Steps to reproduce

Image

✔️ Expected Behavior

Correctly identify variable types for structured output

Actual Behavior

Incorrectly identify variable types for structured out

Image

put

Originally created by @wck-wei on GitHub (Aug 26, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version Version 1.6.0 ### Cloud or Self Hosted Self Hosted (Docker), Cloud ### Steps to reproduce <img width="1235" height="230" alt="Image" src="https://github.com/user-attachments/assets/8dd7f90f-492b-46d5-90e4-62cf444cf132" /> ### ✔️ Expected Behavior Correctly identify variable types for structured output ### ❌ Actual Behavior Incorrectly identify variable types for structured out <img width="1235" height="230" alt="Image" src="https://github.com/user-attachments/assets/a68434d2-042f-4ca5-93b0-68ab68c23847" /> put
yindo added the 🐞 bug label 2026-02-21 19:26:10 -05:00
yindo closed this issue 2026-02-21 19:26:10 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 26, 2025):

Hi @wck-wei! I'm Dosu and I’m helping the dify team.

This is a known issue in Dify v1.6.0: variables of type Number in structured outputs can be incorrectly treated as strings in conditional branches, which prevents numeric operators from being selected in the UI. The root cause is a UI dataflow problem—type information for structured output variables isn't properly propagated or interpreted, so the frontend doesn't offer numeric operators for variables that are actually numbers in the schema. The backend logic does handle variable types, but the UI may mishandle them, leading to this limitation reference.

Recent updates (after v1.6.0) have improved structured output handling, especially for nested variables and type awareness in the UI. For example, PR #23002 fixed the ability to select sub-items of the same type in structured output schemas, which likely resolves this type mismatch for newer versions.

Workaround: If you are on v1.6.0, you can try switching to a more capable language model, as this sometimes helps with structured output stability and type handling reference. For a permanent fix, consider upgrading to the latest version of Dify, where these issues have been addressed.

Let me know if you need details on upgrading or want to discuss temporary workarounds for your current setup.

To reply, just mention @dosu.


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

@dosubot[bot] commented on GitHub (Aug 26, 2025): <!-- Greeting --> Hi @wck-wei! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> This is a known issue in Dify v1.6.0: variables of type Number in structured outputs can be incorrectly treated as strings in conditional branches, which prevents numeric operators from being selected in the UI. The root cause is a UI dataflow problem—type information for structured output variables isn't properly propagated or interpreted, so the frontend doesn't offer numeric operators for variables that are actually numbers in the schema. The backend logic does handle variable types, but the UI may mishandle them, leading to this limitation [reference](https://github.com/langgenius/dify-docs/issues/437). Recent updates (after v1.6.0) have improved structured output handling, especially for nested variables and type awareness in the UI. For example, [PR #23002](https://github.com/langgenius/dify/pull/23002) fixed the ability to select sub-items of the same type in structured output schemas, which likely resolves this type mismatch for newer versions. **Workaround:** If you are on v1.6.0, you can try switching to a more capable language model, as this sometimes helps with structured output stability and type handling [reference](https://github.com/langgenius/dify/issues/23249). For a permanent fix, consider upgrading to the latest version of Dify, where these issues have been addressed. Let me know if you need details on upgrading or want to discuss temporary workarounds for your current setup. <!-- 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/378a49a9-81f4-48c7-a42d-27aa4c53dab9?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/378a49a9-81f4-48c7-a42d-27aa4c53dab9?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/378a49a9-81f4-48c7-a42d-27aa4c53dab9?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/378a49a9-81f4-48c7-a42d-27aa4c53dab9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/378a49a9-81f4-48c7-a42d-27aa4c53dab9?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/378a49a9-81f4-48c7-a42d-27aa4c53dab9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/378a49a9-81f4-48c7-a42d-27aa4c53dab9?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&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/24568)
Author
Owner

@crazywoola commented on GitHub (Aug 26, 2025):

Please upgrade to the latest version.

@crazywoola commented on GitHub (Aug 26, 2025): Please upgrade to the latest version.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#16456