http节点,报错422. 变量如果是直接写没事,如果引用变量就422 #12313

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

Originally created by @xiaoyaoaiqima on GitHub (Mar 28, 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.0

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

[

Image

Image

](url)

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @xiaoyaoaiqima on GitHub (Mar 28, 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.0 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce [ ![Image](https://github.com/user-attachments/assets/bc4f2bac-2310-4a91-b985-ec4f161a18ae) ![Image](https://github.com/user-attachments/assets/782b7ac5-5ad2-4d35-abe2-94003c362691) ](url) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 19:06:51 -05:00
yindo closed this issue 2026-02-21 19:06:51 -05:00
Author
Owner

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

@xiaoyaoaiqima Hello! I'm here to help you with any bugs, questions, or contributions. Let's tackle this issue together!

I found a similar discussion that might be relevant to your issue. The discussion titled "Error in item: Invalid variable." addresses issues with variable references in HTTP request nodes, which could be related to the 422 error you're encountering when using variables [1].

A common cause of a 422 error in Dify when using HTTP nodes with variable references is a change in the request parameter from 'texts' to 'documents' in Dify v1.1.1. This change can lead to compatibility issues with third-party services expecting the 'texts' parameter. Although you are using version 1.0, it's worth checking if similar parameter mismatches might be causing the issue. You might need to ensure that the variables are correctly formatted and match the expected parameters of the API you are calling [2].

Additionally, ensure that the variable interpolation in your HTTP request is correctly set up. Dify uses a variable_template_parser to extract and map variable selectors, and any mismatch can lead to errors. Make sure that the variables in your request body are correctly defined and mapped [3].

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 28, 2025): <!-- Greeting --> @xiaoyaoaiqima Hello! I'm here to help you with any bugs, questions, or contributions. Let's tackle this issue together! <!-- Answer --> I found a similar discussion that might be relevant to your issue. The discussion titled "[Error in item: Invalid variable.](https://github.com/langgenius/dify/discussions/8611)" addresses issues with variable references in HTTP request nodes, which could be related to the 422 error you're encountering when using variables <sup>[[1]](https://github.com/langgenius/dify/discussions/8611)</sup>. A common cause of a 422 error in Dify when using HTTP nodes with variable references is a change in the request parameter from 'texts' to 'documents' in Dify v1.1.1. This change can lead to compatibility issues with third-party services expecting the 'texts' parameter. Although you are using version 1.0, it's worth checking if similar parameter mismatches might be causing the issue. You might need to ensure that the variables are correctly formatted and match the expected parameters of the API you are calling <sup>[[2]](https://github.com/langgenius/dify/issues/16712)</sup>. Additionally, ensure that the variable interpolation in your HTTP request is correctly set up. Dify uses a `variable_template_parser` to extract and map variable selectors, and any mismatch can lead to errors. Make sure that the variables in your request body are correctly defined and mapped <sup>[[3]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/http_request/node.py)</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/e473d161-ddbc-4e7d-ab21-8fa0cd9d56f1?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/e473d161-ddbc-4e7d-ab21-8fa0cd9d56f1?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/e473d161-ddbc-4e7d-ab21-8fa0cd9d56f1?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/e473d161-ddbc-4e7d-ab21-8fa0cd9d56f1?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e473d161-ddbc-4e7d-ab21-8fa0cd9d56f1?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/e473d161-ddbc-4e7d-ab21-8fa0cd9d56f1?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e473d161-ddbc-4e7d-ab21-8fa0cd9d56f1?feedback_type=other)</sup>
Author
Owner

@SilentRio commented on GitHub (Apr 2, 2025):

变量加双引号就可以了
Image

@SilentRio commented on GitHub (Apr 2, 2025): 变量加双引号就可以了 <img width="407" alt="Image" src="https://github.com/user-attachments/assets/1464f173-ad1f-4921-9f58-6c9e45058fb8" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12313