Why does variable aggregation result in an error when the LLM output is a String type? #12157

Closed
opened 2026-02-21 19:06:04 -05:00 by yindo · 3 comments
Owner

Originally created by @Syngnat on GitHub (Mar 26, 2025).

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.1.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @Syngnat on GitHub (Mar 26, 2025). ### 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.1.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/3a9ccb4d-626b-4282-8be4-8c4b4fe18838) ![Image](https://github.com/user-attachments/assets/69be9a27-8876-4eb3-9556-e181d3415af1) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🙋‍♂️ question label 2026-02-21 19:06:04 -05:00
yindo closed this issue 2026-02-21 19:06:04 -05:00
Author
Owner

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

I found a similar unsolved discussion that might be relevant to your issue: Help:Input error in variable aggregator, which was last updated on January 8, 2025 [1].

Regarding your issue, the error you're encountering seems to be related to a validation failure in the VariableAssignerNodeData for the output_type. The Variable Aggregator in Dify is designed to handle specific data types such as strings, numbers, files, objects, and arrays. It can only aggregate variables of the same data type, and it appears that the error is due to an 'any' type being provided instead of a specific type like 'string', 'number', or 'object' [2].

To resolve this, ensure that the LLM output is explicitly set to a compatible data type before it reaches the Variable Aggregator. This might involve adjusting the configuration or processing steps to ensure the data type is correctly defined and consistent with the expected input types.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 26, 2025): <!-- Answer --> I found a similar unsolved discussion that might be relevant to your issue: [Help:Input error in variable aggregator](https://github.com/langgenius/dify/discussions/12513), which was last updated on January 8, 2025 <sup>[[1]](https://github.com/langgenius/dify/discussions/12513)</sup>. Regarding your issue, the error you're encountering seems to be related to a validation failure in the `VariableAssignerNodeData` for the `output_type`. The Variable Aggregator in Dify is designed to handle specific data types such as strings, numbers, files, objects, and arrays. It can only aggregate variables of the same data type, and it appears that the error is due to an 'any' type being provided instead of a specific type like 'string', 'number', or 'object' <sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/node/variable-aggregator.md)</sup>. To resolve this, ensure that the LLM output is explicitly set to a compatible data type before it reaches the Variable Aggregator. This might involve adjusting the configuration or processing steps to ensure the data type is correctly defined and consistent with the expected input types. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/71b9b887-4fcf-4313-852d-bab0878d1988?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/71b9b887-4fcf-4313-852d-bab0878d1988?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/71b9b887-4fcf-4313-852d-bab0878d1988?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/71b9b887-4fcf-4313-852d-bab0878d1988?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/71b9b887-4fcf-4313-852d-bab0878d1988?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/71b9b887-4fcf-4313-852d-bab0878d1988?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/71b9b887-4fcf-4313-852d-bab0878d1988?feedback_type=other)</sup>
Author
Owner

@Syngnat commented on GitHub (Mar 26, 2025):

Image
为什么输入拼音nihao会报错非法参数 @dosu

@Syngnat commented on GitHub (Mar 26, 2025): ![Image](https://github.com/user-attachments/assets/927eaf85-3265-4e57-a81e-2d8af5175d17) 为什么输入拼音nihao会报错非法参数 @dosu
Author
Owner

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

The "Invalid control character" error in JSON typically occurs when there are unescaped characters that JSON does not recognize, such as certain control characters. In your case, the issue might be related to how the input "nihao" is formatted or encoded in the JSON object.

To resolve this, ensure that all string values in your JSON are properly enclosed in double quotes and that any special characters are correctly escaped. For example, if there are any newline characters or other control characters, they should be escaped using a backslash (e.g., \n for a newline).

Additionally, verify that the JSON input adheres to the expected format and schema requirements, as Dify's nodes may have specific validation rules for JSON input. If the issue persists, check for any hidden or non-printable characters in the input that might be causing the parsing error.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 26, 2025): <!-- Answer --> The "Invalid control character" error in JSON typically occurs when there are unescaped characters that JSON does not recognize, such as certain control characters. In your case, the issue might be related to how the input "nihao" is formatted or encoded in the JSON object. To resolve this, ensure that all string values in your JSON are properly enclosed in double quotes and that any special characters are correctly escaped. For example, if there are any newline characters or other control characters, they should be escaped using a backslash (e.g., `\n` for a newline). Additionally, verify that the JSON input adheres to the expected format and schema requirements, as Dify's nodes may have specific validation rules for JSON input. If the issue persists, check for any hidden or non-printable characters in the input that might be causing the parsing error. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/b6c6fc97-1ea4-48ca-afb9-c42029368e07?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/b6c6fc97-1ea4-48ca-afb9-c42029368e07?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/b6c6fc97-1ea4-48ca-afb9-c42029368e07?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/b6c6fc97-1ea4-48ca-afb9-c42029368e07?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b6c6fc97-1ea4-48ca-afb9-c42029368e07?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/b6c6fc97-1ea4-48ca-afb9-c42029368e07?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b6c6fc97-1ea4-48ca-afb9-c42029368e07?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12157