Replies: 1 comment
-
|
Dify's Workflow API does not support asynchronous callbacks or webhooks via For long-running workflows, the current best practice is to initiate the workflow and then poll the status using To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
Dear Dify Support Team,
I am integrating the Dify API into my application and have a specific question regarding handling long-running workflow executions.
I am using the Workflow App API (as per the /v1/workflows/run endpoint documentation) to execute tasks such as document processing and summarization.
These workflows often take several minutes to complete.
My current approach of using frontend polling (GET /workflows/run/{workflow_run_id}) is not reliable because the frontend connection may timeout or be interrupted before the workflow finishes, causing users to miss the result.
My Question:
Does Dify natively support a callback (webhook) mechanism for its APIs, specifically for the Workflow App? I need a way for Dify to actively notify my server upon workflow completion (success or failure), rather than my application having to continuously poll for status.
Key Details from My Research:
The official API documentation for /v1/workflows/run mentions only response_mode: "blocking" or "streaming".
However, I have found community discussions and technical articles suggesting that by setting "response_mode": "async" and providing a "callback_url" parameter in the request body, Dify will send a POST request with the task result to that URL upon completion.
There is also mention of a signature header X-Dify-Signature-V1 for security verification.
Could you please officially confirm:
Is the async + callback_url pattern a supported and stable feature for the Workflow App API?
If yes, are there any official documentation pages or guides detailing its usage, required parameters, and the structure of the callback payload?
If this feature is not available for Workflows, what is the recommended best practice for handling long-running tasks where the client cannot maintain a long-lived connection?
Thank you for your time and assistance. A clarification on this point would greatly help my architecture design.
Best regards,
[Your Name]
2. Additional context or comments
No response
Beta Was this translation helpful? Give feedback.
All reactions