Asynchronous Processing in Workflows? #7269

Closed
opened 2026-02-21 18:19:44 -05:00 by yindo · 8 comments
Owner

Originally created by @G81192 on GitHub (Dec 18, 2024).

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.
Originally created by @G81192 on GitHub (Dec 18, 2024). ### Self Checks - [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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] 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.
yindo added the 🌊 feat:workflow label 2026-02-21 18:19:44 -05:00
yindo closed this issue 2026-02-21 18:19:44 -05:00
Author
Owner

@k1eNdn commented on GitHub (Dec 19, 2024):

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

@k1eNdn commented on GitHub (Dec 19, 2024): You can try parallel branch. https://dify.ai/blog/accelerating-workflow-processing-with-parallel-branch
Author
Owner

@G81192 commented on GitHub (Dec 19, 2024):

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.

@G81192 commented on GitHub (Dec 19, 2024): > 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.
Author
Owner

@G81192 commented on GitHub (Dec 24, 2024):

@GarfieldDai
hi, could you give me some advice on this issue?

@G81192 commented on GitHub (Dec 24, 2024): @GarfieldDai hi, could you give me some advice on this issue?
Author
Owner

@crazywoola commented on GitHub (Dec 25, 2024):

If you can append a HTTP service at the end of the workflow.

The HTTP service should look like this:

def async_task
    queue.add(task)
    return 200 "success"
@crazywoola commented on GitHub (Dec 25, 2024): If you can append a HTTP service at the end of the workflow. The HTTP service should look like this: ``` def async_task queue.add(task) return 200 "success" ```
Author
Owner

@G81192 commented on GitHub (Dec 25, 2024):

If you can append a HTTP service at the end of the workflow.

The HTTP service should look like this:

def async_task
    queue.add(task)
    return 200 "success"

@crazywoola Thank you for your reply. This approach does work, but it seems to deviate from my original intent. I was hoping to achieve this through workflow configurations rather than implementing a completely custom solution. I wonder if it might be possible to add processes that can be executed asynchronously within the workflow? This feature would be quite useful in scenarios where the execution needs to be hidden from the user.

@G81192 commented on GitHub (Dec 25, 2024): > If you can append a HTTP service at the end of the workflow. > > The HTTP service should look like this: > > ``` > def async_task > queue.add(task) > return 200 "success" > ``` @crazywoola Thank you for your reply. This approach does work, but it seems to deviate from my original intent. I was hoping to achieve this through workflow configurations rather than implementing a completely custom solution. I wonder if it might be possible to add processes that can be executed asynchronously within the workflow? This feature would be quite useful in scenarios where the execution needs to be hidden from the user.
Author
Owner

@dosubot[bot] commented on GitHub (Jan 25, 2025):

Hi, @G81192. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You are seeking a way to implement asynchronous processing in Dify workflows.
  • The parallel branch approach was insufficient as it required users to wait for completion.
  • Crazywoola suggested using an HTTP service for asynchronous tasks.
  • You prefer a solution integrated within the workflow configurations.

Next Steps:

  • Is this issue still relevant to the latest version of the Dify repository? If so, please comment to keep the discussion open.
  • Otherwise, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Jan 25, 2025): Hi, @G81192. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You are seeking a way to implement asynchronous processing in Dify workflows. - The parallel branch approach was insufficient as it required users to wait for completion. - Crazywoola suggested using an HTTP service for asynchronous tasks. - You prefer a solution integrated within the workflow configurations. **Next Steps:** - Is this issue still relevant to the latest version of the Dify repository? If so, please comment to keep the discussion open. - Otherwise, this issue will be automatically closed in 15 days. Thank you for your understanding and contribution!
Author
Owner

@huynhbaobk commented on GitHub (Feb 23, 2025):

If you can append a HTTP service at the end of the workflow.
The HTTP service should look like this:

def async_task
    queue.add(task)
    return 200 "success"

@crazywoola Thank you for your reply. This approach does work, but it seems to deviate from my original intent. I was hoping to achieve this through workflow configurations rather than implementing a completely custom solution. I wonder if it might be possible to add processes that can be executed asynchronously within the workflow? This feature would be quite useful in scenarios where the execution needs to be hidden from the user.

Could you explain how to add this to the workflow in dify? I dont understand

@huynhbaobk commented on GitHub (Feb 23, 2025): > > If you can append a HTTP service at the end of the workflow. > > The HTTP service should look like this: > > ``` > > def async_task > > queue.add(task) > > return 200 "success" > > ``` > > [@crazywoola](https://github.com/crazywoola) Thank you for your reply. This approach does work, but it seems to deviate from my original intent. I was hoping to achieve this through workflow configurations rather than implementing a completely custom solution. I wonder if it might be possible to add processes that can be executed asynchronously within the workflow? This feature would be quite useful in scenarios where the execution needs to be hidden from the user. Could you explain how to add this to the workflow in dify? I dont understand
Author
Owner

@Betty90 commented on GitHub (Aug 23, 2025):

I want that too, we are now having a long response waiting the 'DONE' signal but while http executing, even if it should be connection closed, we have to keep the connection and it occurs to other problems

@Betty90 commented on GitHub (Aug 23, 2025): I want that too, we are now having a long response waiting the 'DONE' signal but while http executing, even if it should be connection closed, we have to keep the connection and it occurs to other problems
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7269