Skip to content

When using the tool released by the workflow, the output will be generated twice #27566

Closed as not planned

Description

@xiaotang-12-ops

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When using the tool released by the workflow, the output will be generated twice. For large token outputs, double the tokens will increase the burden on the model. I raised this issue a long time ago, but it hasn't been fixed yet.

✔️ Expected Behavior

no error

❌ Actual Behavior

When using the tool released by the workflow, the output will be generated twice. For large token outputs, double the tokens will increase the burden on the model. I raised this issue a long time ago, but it hasn't been fixed yet.

Activity

  1. xiaotang-12-ops commented on Oct 28, 2025

    @xiaotang-12-ops
    Author

    The workflow generates output once, but when the tool is called, the output is generated twice. I really hope this can be fixed as soon as possible; otherwise, the token consumption will be extremely high, and the large model will fail to remember the content or even easily get confused.

  2. added
    🐞 bug
    on Oct 28, 2025
  3. dosubot commented on Oct 28, 2025

    @dosubot

    This is a known bug in Dify that affects multiple versions, including 2.0. When a workflow tool is called from the Agent module or as a tool, both a text and a JSON message are returned and concatenated, which doubles the output and token usage. There isn't a built-in way to filter out the duplicate in current releases, and recent fixes have not fully resolved the issue—users continue to report it in the latest versions. The recommended workaround is to post-process the agent output and select only the desired result (either the text or the JSON) to avoid duplicates. There is no official confirmation or timeline for a permanent fix yet. For more details and ongoing discussion, see issue #23695 and related threads.

    To reply, just mention @dosu.


    How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions