Dify workflow Integrated Search Engine, LLM node Unable to Retrieve the Output Variable“json" from the Search Engine tool. #8336

Closed
opened 2026-02-21 18:25:08 -05:00 by yindo · 2 comments
Owner

Originally created by @lkpAgent on GitHub (Feb 17, 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

0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Question:
I have defined a workflow in Dify where I first add a search engine tool node to search for a query. The search engine provides three output variables: text, json, and files. The actual result is in the json variable. I then pass the search results to the next LLM node, but I am unable to access the json variable in the LLM's system. I can only access the text and files variables from the search engine tool. How can I resolve this?

Image

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @lkpAgent on GitHub (Feb 17, 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 0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Question: I have defined a workflow in Dify where I first add a search engine tool node to search for a query. The search engine provides three output variables: text, json, and files. The actual result is in the json variable. I then pass the search results to the next LLM node, but I am unable to access the json variable in the LLM's system. I can only access the text and files variables from the search engine tool. How can I resolve this? ![Image](https://github.com/user-attachments/assets/d202f6cd-36a9-41ed-b13c-a7d21dfd9097) ![Image](https://github.com/user-attachments/assets/f1b6940f-e7c2-4893-83e9-8ee888db0251) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🌊 feat:workflow label 2026-02-21 18:25:08 -05:00
yindo closed this issue 2026-02-21 18:25:08 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 17, 2025):

Hello @lkp1985! I'm here to assist you with any bugs, questions, or contributions. Let's work together to solve the issue you're facing.

To resolve the issue of not being able to access the json variable from the search engine tool in the LLM node, ensure that the json output variable is correctly defined and set in the search engine tool's implementation. Here are some steps you can follow:

  1. Define the Output Schema: Make sure that the json variable is defined in the output_schema of the search engine tool node. This should be done using the json_schema format. For example:

    output_schema:
      type: object
      properties:
        json:
          type: object
    
  2. Set the Output Variable: In the implementation of the search engine tool, ensure that the json variable is being set correctly. If the variable is not set, it will default to None.

  3. Accessing the Variable in LLM Node: In the LLM node, ensure that you are referencing the json variable correctly. You can use the variable insertion menu by typing / or { in the prompt editor to insert the json variable into the system prompt.

By following these steps, you should be able to access the json variable in the LLM node. If the issue persists, double-check the implementation code to ensure that the json variable is being populated as expected [1][2].

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 (Feb 17, 2025): <!-- Greeting --> Hello @lkp1985! I'm here to assist you with any bugs, questions, or contributions. Let's work together to solve the issue you're facing. <!-- Answer --> To resolve the issue of not being able to access the `json` variable from the search engine tool in the LLM node, ensure that the `json` output variable is correctly defined and set in the search engine tool's implementation. Here are some steps you can follow: 1. **Define the Output Schema**: Make sure that the `json` variable is defined in the `output_schema` of the search engine tool node. This should be done using the `json_schema` format. For example: ```yaml output_schema: type: object properties: json: type: object ``` 2. **Set the Output Variable**: In the implementation of the search engine tool, ensure that the `json` variable is being set correctly. If the variable is not set, it will default to `None`. 3. **Accessing the Variable in LLM Node**: In the LLM node, ensure that you are referencing the `json` variable correctly. You can use the variable insertion menu by typing `/` or `{` in the prompt editor to insert the `json` variable into the system prompt. By following these steps, you should be able to access the `json` variable in the LLM node. If the issue persists, double-check the implementation code to ensure that the `json` variable is being populated as expected <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/jp/plugins/schema-definition/tool.md)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/plugins/schema-definition/tool.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/20324555-a11c-46c0-bc4a-f19ea08e7a9f?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/20324555-a11c-46c0-bc4a-f19ea08e7a9f?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/20324555-a11c-46c0-bc4a-f19ea08e7a9f?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/20324555-a11c-46c0-bc4a-f19ea08e7a9f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/20324555-a11c-46c0-bc4a-f19ea08e7a9f?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/20324555-a11c-46c0-bc4a-f19ea08e7a9f?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/20324555-a11c-46c0-bc4a-f19ea08e7a9f?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Feb 17, 2025):

Please read the self checks section first.

This is only for bug report, if you would like to ask a question, please head to Discussions.

You can use a Template node to convert those json into string, then it can be read in the LLM node.

@crazywoola commented on GitHub (Feb 17, 2025): Please read the self checks section first. 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). You can use a Template node to convert those json into string, then it can be read in the LLM node.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8336