[PR #32117] fix(web): fill workflow tool output descriptions from schema #33560

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

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

State: closed
Merged: Yes


Summary

Fixes #32093.

When configuring a published workflow tool, output field descriptions can appear empty in the Tool Output section even though descriptions exist in tool.output_schema.

Root cause

buildWorkflowOutputParameters returned outputParameters as-is whenever an array was provided, without using output_schema to fill missing description/type fields.

Changes

  • Updated buildWorkflowOutputParameters to:
    • keep existing behavior when there is no schema;
    • fill missing description/type from output_schema when array items are incomplete;
    • derive from schema when explicit output parameter array is empty.
  • Added/updated unit tests for:
    • fallback description/type merge from schema;
    • empty-description fallback when both payload and schema lack description;
    • deriving from schema when explicit array is empty;
    • missing schema type handling.

Testing

Executed locally in web/:

  • corepack pnpm lint app/components/tools/workflow-tool/utils.ts app/components/tools/workflow-tool/utils.test.ts
  • corepack pnpm test app/components/tools/workflow-tool/utils.test.ts
  • corepack pnpm test:coverage app/components/tools/workflow-tool/utils.test.ts
  • corepack pnpm run type-check

Coverage for touched module in this run:

  • app/components/tools/workflow-tool/utils.ts
    • statements: 100%
    • branches: 100%
    • functions: 100%
    • lines: 100%
**Original Pull Request:** https://github.com/langgenius/dify/pull/32117 **State:** closed **Merged:** Yes --- ## Summary Fixes #32093. When configuring a published workflow tool, output field descriptions can appear empty in the Tool Output section even though descriptions exist in `tool.output_schema`. ## Root cause `buildWorkflowOutputParameters` returned `outputParameters` as-is whenever an array was provided, without using `output_schema` to fill missing description/type fields. ## Changes - Updated `buildWorkflowOutputParameters` to: - keep existing behavior when there is no schema; - fill missing `description`/`type` from `output_schema` when array items are incomplete; - derive from schema when explicit output parameter array is empty. - Added/updated unit tests for: - fallback description/type merge from schema; - empty-description fallback when both payload and schema lack description; - deriving from schema when explicit array is empty; - missing schema type handling. ## Testing Executed locally in `web/`: - `corepack pnpm lint app/components/tools/workflow-tool/utils.ts app/components/tools/workflow-tool/utils.test.ts` - `corepack pnpm test app/components/tools/workflow-tool/utils.test.ts` - `corepack pnpm test:coverage app/components/tools/workflow-tool/utils.test.ts` - `corepack pnpm run type-check` Coverage for touched module in this run: - `app/components/tools/workflow-tool/utils.ts` - statements: 100% - branches: 100% - functions: 100% - lines: 100%
yindo added the pull-request label 2026-02-21 20:53:30 -05:00
yindo closed this issue 2026-02-21 20:53:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#33560