[PR #26241] feat(workflow): workflow as tool output schema #31365

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

Original Pull Request: https://github.com/langgenius/dify/pull/26241

State: closed
Merged: Yes


Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Fixes https://github.com/langgenius/dify/issues/25980

Workflow as tool add specific output, follow-up nodes can use output variable directly

Detail

  1. db upgrade: table tool_workflow_providers add output_schema field
  2. workflow as tool provider model add output_schema field
  3. frontend support output_schema display and flow connection
  4. workflow as tool add reserved parameter warning and validate

Screenshots

Before

image image

We need to use a code node to convert json and extract the data what we need

After

image image imageimage

We can use output variable directly!

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/26241 **State:** closed **Merged:** Yes --- > [!IMPORTANT] > > 1. Make sure you have read our [contribution guidelines](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) > 1. Ensure there is an associated issue and you have been assigned to it > 1. Use the correct syntax to link this PR: `Fixes #<issue number>`. ## Summary Fixes https://github.com/langgenius/dify/issues/25980 **Workflow as tool add specific output, follow-up nodes can use output variable directly** ### Detail 1. ~~db upgrade: table `tool_workflow_providers` add `output_schema` field~~ 2. workflow as tool provider model add `output_schema` field 3. frontend support `output_schema` display and flow connection 4. workflow as tool add reserved parameter warning and validate ## Screenshots ### Before <img width="1912" height="653" alt="image" src="https://github.com/user-attachments/assets/d819a59f-bf2e-4902-8cec-0cdc4b25c171" /> <img width="1033" height="958" alt="image" src="https://github.com/user-attachments/assets/8c464acc-9f8e-438e-b42d-eeaed09eabb5" /> We need to use a code node to convert json and extract the data what we need ### After <img width="1434" height="790" alt="image" src="https://github.com/user-attachments/assets/a892dde9-826e-4d2f-99e6-96fd5f405415" /> <img width="1434" height="788" alt="image" src="https://github.com/user-attachments/assets/9acf5625-c33e-4efe-99a8-5038beedbf2f" /> <img width="1431" height="787" alt="image" src="https://github.com/user-attachments/assets/144b7ed1-b3e6-41b4-9233-e9682b263b2c" /><img width="404" height="671" alt="image" src="https://github.com/user-attachments/assets/a41687e2-84e4-4067-ad75-502b5d1c6aa1" /> We can use output variable directly! ## Checklist - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [x] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:49:19 -05:00
yindo closed this issue 2026-02-21 20:49:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#31365