Feat: workflow/chatflow api support async#18838
Conversation
laipz8200
left a comment
There was a problem hiding this comment.
I believe that this feature will make the Dify API highly susceptible to DDoS attacks, leading to resource exhaustion.
Then I think we should find ways to do a good job in DDos protection instead of DDos attacks caused by this interface. Is that right? |
Running workflows can be quite time-consuming. To enable asynchronous execution, it’s best to handle them using executors like Celery instead of running them directly within the web service. Additionally, the current service API doesn’t prevent users from making asynchronous requests with simple |
The main problem with asynchronous solution is that if the interface execution is too long, it is very easy for us to time out when we call it, and thus no result can be obtained. However, it is impossible for us to set the timeout time too long, as this would carry a higher risk. Therefore, asynchronous requests are still necessary. |
|
That sounds reasonable. However, we still can't accept the current implementation. Our team is already working on designing the asynchronous execution feature for Workflow. Before it releases, you can use this feature on your own branch. |
Ok. Thank you. Looking forward to this feature. |
@laipz8200 When can this feature be released ? |

Summary
It does not affect the current usage method.
Just by adding one parameter: is_async, the api interface can support asynchronous requests.
You just need to poll the new interface to obtain the result.
If possible, we may also send the result to kafka after it is available.
Tip
Resolve #13474
Screenshots
Checklist
Important
Please review the checklist below before submitting your pull request.
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods