Unable to use object type variable in HTTP node #12463

Closed
opened 2026-02-21 19:07:32 -05:00 by yindo · 1 comment
Owner

Originally created by @zm1990s on GitHub (Apr 2, 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

v1.1.3 and v0.15.5

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

If the output variable is object, then we can't use it in HTTP node. I think older versions don't have this problem because the workflow I use worked perfectly before.

Image Image

✔️ Expected Behavior

Able to use object type variable in HTTP node.

Actual Behavior

Unable to use object type variable in HTTP node.

Originally created by @zm1990s on GitHub (Apr 2, 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 v1.1.3 and v0.15.5 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce If the output variable is object, then we can't use it in HTTP node. I think older versions don't have this problem because the workflow I use worked perfectly before. <img width="490" alt="Image" src="https://github.com/user-attachments/assets/e0d2c5d2-a174-4319-ac2d-fc69e89e7865" /> <img width="901" alt="Image" src="https://github.com/user-attachments/assets/c84a5b34-c232-4590-b970-f1fba6f1dfb3" /> ### ✔️ Expected Behavior Able to use object type variable in HTTP node. ### ❌ Actual Behavior Unable to use object type variable in HTTP node.
yindo added the 🐞 bugstale labels 2026-02-21 19:07:32 -05:00
yindo closed this issue 2026-02-21 19:07:32 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 2, 2025):

I found some similar discussions that might be relevant to your issue:

  1. Why cant use code node output result to next api node? - This discussion is unsolved and might provide insights into similar issues with node outputs [1].

  2. Regarding the issue that the JSON in the HTTP tool cannot accept objects. In the current version, JSON can only accept strings. However, there will be escape characters in the JSON string processed by the code, and the HTTP request cannot be made normally. - This unsolved discussion highlights issues with JSON handling in HTTP nodes [2].

  3. How to use variable in Http-request node body - Another unsolved discussion that might provide context on using variables in HTTP nodes [3].

The current implementation of the HTTP node in Dify handles different data types, including "json" and "raw-text", by extracting and mapping variable selectors. However, there might be limitations with object type variables, as indicated by the discussions [4].

For handling complex data structures, you can use the Code Execution node to transform object type variables into a compatible format for the HTTP node. This involves running custom scripts to parse and transform JSON strings, which can then be used in the HTTP node [5][6].

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 (Apr 2, 2025): <!-- Answer --> I found some similar discussions that might be relevant to your issue: 1. [Why cant use code node output result to next api node?](https://github.com/langgenius/dify/discussions/13971) - This discussion is unsolved and might provide insights into similar issues with node outputs <sup>[[1]](https://github.com/langgenius/dify/discussions/13971)</sup>. 2. [Regarding the issue that the JSON in the HTTP tool cannot accept objects. In the current version, JSON can only accept strings. However, there will be escape characters in the JSON string processed by the code, and the HTTP request cannot be made normally.](https://github.com/langgenius/dify/discussions/13768) - This unsolved discussion highlights issues with JSON handling in HTTP nodes <sup>[[2]](https://github.com/langgenius/dify/discussions/13768)</sup>. 3. [How to use variable in Http-request node body](https://github.com/langgenius/dify/discussions/9879) - Another unsolved discussion that might provide context on using variables in HTTP nodes <sup>[[3]](https://github.com/langgenius/dify/discussions/9879)</sup>. The current implementation of the HTTP node in Dify handles different data types, including "json" and "raw-text", by extracting and mapping variable selectors. However, there might be limitations with object type variables, as indicated by the discussions <sup>[[4]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/http_request/node.py)</sup>. For handling complex data structures, you can use the **Code Execution** node to transform object type variables into a compatible format for the HTTP node. This involves running custom scripts to parse and transform JSON strings, which can then be used in the HTTP node <sup>[[5]](https://github.com/langgenius/dify-docs/blob/main/jp/llms.txt)</sup><sup>[[6]](https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/node/README.md)</sup>. <!-- 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/2df48ea1-f0f4-4938-9238-933ef572a3c9?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/2df48ea1-f0f4-4938-9238-933ef572a3c9?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/2df48ea1-f0f4-4938-9238-933ef572a3c9?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/2df48ea1-f0f4-4938-9238-933ef572a3c9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/2df48ea1-f0f4-4938-9238-933ef572a3c9?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/2df48ea1-f0f4-4938-9238-933ef572a3c9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/2df48ea1-f0f4-4938-9238-933ef572a3c9?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#12463