Can workflow as tool have structured output? #17790

Closed
opened 2026-02-21 19:39:49 -05:00 by yindo · 0 comments
Owner

Originally created by @CrabSAMA on GitHub (Sep 19, 2025).

Originally assigned to: @CrabSAMA on GitHub.

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

We often publish workflows as tools for use, which can help us improve reusability and enhance efficiency.

But there is a problem here.

Image

We will define the workflow outputs in end node, which explicitly defines the output structure of the node.

What I expect is can direct use the data of tool's output, but now dify make a wrap with outputs, at this code:

https://github.com/langgenius/dify/blob/1550316b8d755b1a32ad64e169129b7d7a809bf5/api/core/tools/workflow_as_tool/tool.py#L106-L107

So that we need to use a code node to convert json and extract the data what we need, for example:

Image

This makes me feel confused, I have already defined the input and output. Why do we need this extra convert? It is intuitive to directly obtain the originally defined output variables.

We can enhance output_schema field, and we have enought info to let dify know input and output which the workflow as tool, so I think this problem can be resolved.

This is indeed a big problem for me, we have many unnecessary code nodes now, let's discuss this feature, I will be very grateful!

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @CrabSAMA on GitHub (Sep 19, 2025). Originally assigned to: @CrabSAMA on GitHub. ### 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] 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] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. We often publish workflows as tools for use, which can help us improve reusability and enhance efficiency. But there is a problem here. <img width="1912" height="653" alt="Image" src="https://github.com/user-attachments/assets/a47787ab-afad-4414-a66a-f89ba73df071" /> We will define the workflow outputs in end node, which explicitly defines the output structure of the node. What I expect is can direct use the data of tool's output, but now dify make a wrap with outputs, at this code: https://github.com/langgenius/dify/blob/1550316b8d755b1a32ad64e169129b7d7a809bf5/api/core/tools/workflow_as_tool/tool.py#L106-L107 So that we need to use a code node to convert json and extract the data what we need, for example: <img width="1033" height="958" alt="Image" src="https://github.com/user-attachments/assets/c6607bc4-108b-43bf-9f24-fd402ae40f15" /> This makes me feel confused, I have already defined the input and output. Why do we need this extra convert? It is intuitive to directly obtain the originally defined output variables. We can enhance `output_schema ` field, and we have enought info to let dify know input and output which the workflow as tool, so I think this problem can be resolved. **This is indeed a big problem for me**, we have many unnecessary code nodes now, let's discuss this feature, I will be very grateful! ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [x] I am interested in contributing to this feature.
yindo added the 💪 enhancement🌊 feat:workflow labels 2026-02-21 19:39:49 -05:00
yindo closed this issue 2026-02-21 19:39:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#17790