Issue with OpenAPI Object Parsing and Chaining Agents with Workflows #3701

Closed
opened 2026-02-21 18:00:59 -05:00 by yindo · 0 comments
Owner

Originally created by @agrigeorge on GitHub (May 26, 2024).

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).
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.8

Cloud or Self Hosted

Cloud

Steps to reproduce

Define an OpenAPI specification for the tool with an inputs field designated as an object.
Add this specification as a tool to an agent in dify.ai.
Observe that the input is interpreted as a string rather than an object.

✔️ Expected Behavior

The inputs field defined in the OpenAPI specification should be interpreted as an object, enabling the correct configuration and data exchange between tools in the workflow.

Actual Behavior

The inputs field is incorrectly interpreted as a string, which disrupts the proper integration and functionality of the tool within the workflow.

Additional Context

I am aware that currently, dify.ai does not support chaining multiple agents together or allowing agents direct access to workflows, though it appears this functionality may be planned for future implementation. In light of this limitation, I have opted to use a workaround by integrating individual agents via an OpenAPI specification, treating them as tools within each agent.

To manage the integration, I constructed an OpenAPI specification and incorporated it as a tool for each agent. The workflow configuration requires the inputs field to be structured as an object. However, there is an ongoing issue where dify.ai interprets these object fields as strings. This problem was previously reported in multiple issues and was considered resolved. Despite this, my implementation is still encountering this interpretation error.

Thank you for your time and help with this issue. Please let me know if there's anything I might be missing or any additional steps I should consider to resolve this problem. Your assistance is greatly appreciated!

openapi: "3.1.0"
info:
  title: "Agent Workflow API"
  version: "1.0.0"
  description: ""
servers:
  - url: "https://api.dify.ai/v1"
paths:
  /workflows/run:
    post:
      operationId: "processAgent"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: "object"
              properties:
                inputs:
                  type: "object"
                  properties:
                    query:
                      type: "string"
                response_mode:
                  type: "string"
                  default: "blocking"
                conversation_id:
                  type: "string"
                user:
                  type: "string"
              required:
                - "response_mode"
                - "conversation_id"
                - "user"
                - "inputs"
      responses:
        200:
          description: "Successful operation"
          content:
            application/json:
              schema:
                type: "object"
                properties:
                  status:
                    type: "string"
                  data:
                    type: "object"
                    additionalProperties: true

Screenshot 2024-05-26 at 20 09 35

related issues:
https://github.com/langgenius/dify/issues/3421
https://github.com/langgenius/dify/issues/3796
https://github.com/langgenius/dify/issues/2315

Originally created by @agrigeorge on GitHub (May 26, 2024). ### 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] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.8 ### Cloud or Self Hosted Cloud ### Steps to reproduce Define an OpenAPI specification for the tool with an inputs field designated as an object. Add this specification as a tool to an agent in dify.ai. Observe that the input is interpreted as a string rather than an object. ### ✔️ Expected Behavior The inputs field defined in the OpenAPI specification should be interpreted as an object, enabling the correct configuration and data exchange between tools in the workflow. ### ❌ Actual Behavior The inputs field is incorrectly interpreted as a string, which disrupts the proper integration and functionality of the tool within the workflow. Additional Context I am aware that currently, dify.ai does not support chaining multiple agents together or allowing agents direct access to workflows, though it appears this functionality may be planned for future implementation. In light of this limitation, I have opted to use a workaround by integrating individual agents via an OpenAPI specification, treating them as tools within each agent. To manage the integration, I constructed an OpenAPI specification and incorporated it as a tool for each agent. The workflow configuration requires the inputs field to be structured as an object. However, there is an ongoing issue where dify.ai interprets these object fields as strings. This problem was previously reported in multiple issues and was considered resolved. Despite this, my implementation is still encountering this interpretation error. Thank you for your time and help with this issue. Please let me know if there's anything I might be missing or any additional steps I should consider to resolve this problem. Your assistance is greatly appreciated! ```YAML openapi: "3.1.0" info: title: "Agent Workflow API" version: "1.0.0" description: "" servers: - url: "https://api.dify.ai/v1" paths: /workflows/run: post: operationId: "processAgent" requestBody: required: true content: application/json: schema: type: "object" properties: inputs: type: "object" properties: query: type: "string" response_mode: type: "string" default: "blocking" conversation_id: type: "string" user: type: "string" required: - "response_mode" - "conversation_id" - "user" - "inputs" responses: 200: description: "Successful operation" content: application/json: schema: type: "object" properties: status: type: "string" data: type: "object" additionalProperties: true ``` <img width="255" alt="Screenshot 2024-05-26 at 20 09 35" src="https://github.com/langgenius/dify/assets/131775284/aa36c767-08b0-4437-95a4-e8392c38b191"> related issues: https://github.com/langgenius/dify/issues/3421 https://github.com/langgenius/dify/issues/3796 https://github.com/langgenius/dify/issues/2315
yindo added the 🐞 bug🌊 feat:workflow labels 2026-02-21 18:00:59 -05:00
yindo closed this issue 2026-02-21 18:00:59 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#3701