langgenius/dify

Asynchronous Processing in Workflows?

Opened this issue · 2 comments

G81192 commented

Self Checks

  • 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).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • 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.

hi, In the Dify workflow, I would like to know if it's possible to implement an asynchronous mechanism. Specifically, I want tasks to be processed asynchronously after a user receives a response, without requiring the user to wait for the results of those tasks.

For example, I have a requirement where, at the end of a workflow, I need to evaluate the quality of the response using a large language model (LLM). This evaluation process should happen asynchronously, and the user does not need to wait for its completion.

Is there currently a feature or method in Dify that supports this use case? If not, could you suggest an alternative way to achieve this functionality? The goal is to send the question, the response, and the knowledge to the LLM for evaluation based on specified dimensions, all while keeping this process independent of the main workflow response.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
G81192 commented

You can try parallel branch. https://dify.ai/blog/accelerating-workflow-processing-with-parallel-branch

@kiendn1 Thank you for your suggestion. I tried using the parallel branch approach, but it doesn't fully solve the issue. Although the user has already received a response, the workflow hasn't finished yet, and the user has to wait continuously. This creates a very poor experience, which is even intolerable. I would like the asynchronous process to be completely transparent to the user, so they don't feel any delay or impact.