Mendix API Call Timeout

0
Issue: We have built a Mendix app that integrates with another application (Dify) via an API call. Everything works fine when the API call takes less than 60 seconds. However, the blocking call usually takes longer — up to 120 seconds until the response is returned. Mendix cannot wait internally for longer than 60 seconds — at least, there is always a timeout after 60 seconds. Is there any way to solve this problem?
asked
3 answers
0

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:

  • send the request to Dify
  • get back a request/task ID immediately
  • then periodically check the status/result from Mendix until it’s completed


That approach is usually much more reliable for APIs that take 1–2 minutes to respond.


Thanks !


answered
0

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!



answered
0

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



answered