Is there any way to get around the 60 second timeout on frontend api calls?

In the AI app age, 60 seconds is quite laughable as a timeout duration. I’m working on an AI app and my calls sometimes go over 1 min, which ends up retrying the call and creating duplicate content.

Particularly, I am triggering an n8n webhook which kicks off a series of workflows before returning a response to the user in bubble.

Is there any way to get around this?

This is a dealbreaker for me and if there’s not a workaround, I may have to consider building elsewhere.

With reasoning and image generation models getting more and more advanced, this should have been addressed a while ago. Not a good look for Bubble!

Anyway, rant over, if anyone has any suggestions I would really appreciate it.

First try to streamline the n8n flow so it finishes in < 60 s. If that’s impossible, use this workaround:

  1. Create the Job first

    • Run a backend workflow called “Create Job.” It saves a Job record with status = "pending" and returns the job_id.
    • Store that job_id in the URL or a custom state.
  2. Show instant feedback

    • On the page, display a spinner or skeleton UI while status is pending.
  3. Kick off n8n

    • Call the n8n webhook through the API Connector and include the job_id in the payload.
    • n8n replies immediately, so the front-end request stays well under the 60-second limit.
  4. Let n8n do the heavy lifting

    • When the work is done, n8n triggers a Bubble backend workflow, passing job_id and the final data.
    • That workflow updates the Job: status = "done" and fills result_data.
  5. Real-time UI update

    • Bubble’s live data detects the change. Your page conditionals see status = "done" and swap the spinner for the actual result.

I gave the example of “Job,” but you can create any name you want for this table/item.

2 Likes

This is where WebSockets come in, enabling a real-time connection longer than 60 seconds, as it runs client-side. :blush:

Alternative Solution:

Use a server-side action or backend workflow in Bubble to trigger your long-running n8n process. Return immediately, and let n8n notify Bubble when it’s done using a backend API workflow.

This avoids the 60-second frontend timeout.

P.S. There might be some caching issues on the front end not updating in real-time witth the last solution, so avoid doing a search if possible.

1 Like

Tried this and it works well. I used “Message” isntead of job and had the same setup as you described. The last step of my n8n workflow was to create (or rather update) the last message in the chat which was the loading one. All worked great. Thanks!

2 Likes

Perfect man!

This topic was automatically closed after 70 days. New replies are no longer allowed.