Hello,
Yes, this is actually a pretty common issue with long-running API calls in Mendix. After around 60 seconds, the request usually times out even though the external service is still processing.
Instead of keeping the call blocked and waiting for the response, it’s better to make it asynchronous.
For example:
That approach is usually much more reliable for APIs that take 1–2 minutes to respond.
Thanks !
Many Thanks for your answer!
I already tried this. But I wasn't able to bring it to a working state.
My condisered Workflow:
1) Send a File to Dify
2) Start Dify Workflow - streaming/blocking mode? in a Task Queue?
3) How can I check the result periodically?
All my tries resulted in an shut down, coming from the Call in 2).
Thanks!
Hi Sebastian Straßl
Mendix has a hard 60-second timeout on blocking (synchronous) calls. Your Dify API takes up to 120 seconds. So the call gets killed halfway.
What Reemali explained is about polling
Mendix Dify
| |
|-- POST /start-job --------> | (returns job_id instantly)
| | (Dify works in background...)
|-- GET /status/{job_id} ---> | (check every 5s)
|-- GET /status/{job_id} ---> |
|<-- "done + result" -------- |
1.Call Dify → get a job_id back immediately
2.Store job_id in your entity
3.Use a scheduled microflow or loop with pause to poll /status/{job_id} every few seconds
4.When status = done → retrieve result
Option 2: You can go for Webhook
1.Call Dify with a callback_url pointing to a Mendix REST endpoint
2.Dify calls that endpoint when finished
3.Mendix receives result and processes it
if noting works then go for polling with ASYNC it will work for sure.
I hope it helps