Handle API Timeouts...😅

Guys wayy too often API calls with OpenAI get timed out. What’s the best way to handle it?

2 Likes

There is currently no way to increase timeout for OpenAI API. I contacted the support for the same reason and they told me “we are exploring options related to increasing the timeout and other workarounds for APIs that have longer response times.
As many of our users want to integrate their Bubble apps with AI, this is certainly on our teams radar and we’re watching this feature request closely.”

Please upvote this feature request !

2 Likes

Does the API have some other endpoint that you can call upon to check the status of a request you made previously?

I use a completely unrelated API in my app that can officially take up to 2.5 minutes to provide a response which is beyond the 60 second limit from Bubble. Fortunately I’m able to store a unique transaction ID and make inquiries about the status of the request with an “inquire” endpoint as much as I want until the original call has been answered.

Would something like that be a workaround for you or is this a totally different situation?

Yeah not in this case. But I’ve done similar thing with Rev.ai. It’s got both options either use a webhook or check the status every X seconds… OpenAI starts responding right away but it types the answer, It’s sort of like a live communication. API offers ‘streaming’ option but Bubble doesn’t support real-time connections…

Good to know! Sorry to hear that it’s not an option in this case. It sure would make my life easier if the Bubble API timeout limitations could be extended out just a wee bit longer.

1 Like

Yeaah today I’ve swapped my app from GPT4 to 3.5Turbo. It was waaaay faster but the results can’t even come close to what GPT4 returns…

2 Likes

Holler at me boi! I wanna create a solution

1 Like

It’s a wide spread issue with GTP itself unfortunately :disappointed: @jared.gibb

I am having an issue with workflows terminating when an API call times out.

Is there anything we could do in Bubble to be aware of the API call time out so we could still continue to run the rest of the workflow so we could create some kind of workaround like running another workflow that would re-try or at least store some data to know it was a timeout issue.

I have my API calls set to know if there was an error response, and a workflow to save the error responses, but they don’t run with a time out since Bubble seems to just terminate the workflow.

2 Likes

Same here. What you can do is somehow add a time conditional. If API doesn’t return a response within 50 seconds re-schedule it. That’s a response I got from Bubble.

However this solution completely ignores the fact of API response may be needing to take more than 50 seconds… So for now I think our hands are tied.

If you’re familiar with Xano or maybe Zapier you could outsource API handling to them…

Thank you for the ideas. I wish Bubble would have added the workflow error trigger to the backend workflows (seems logical and needed) as that would make it so simple to handle these types of issues since the workflow error is logged, which if a trigger was available in the backend, would work.

I’m thinking that for my particular issue, I might need to redo things and use the API providers webhook, which is what I didn’t want to do, but seems necessary at this stage.

2 things I wish Bubble had done

  1. Make it so a API timeout results in an API response error
  2. Make workflow error triggers available in the backend

Either of those two would make it possible to do something as the developer to resolve for such issues.

5 Likes