Forum Academy Marketplace Showcase Pricing Features

Improving API workflow with backend?

Hi there.

I’m testing out an idea with a very simple bubble MVP. I allow users on my website to perform a function that calls a couple of different 3rd party APIs (chains the data from the first API call into the second API call) and returns some useful data to my users. This is all working great. However, there can be a 90-120 second delay between performing the function and getting the data back. I have a progress bar display to give an indication of this wait time. If the user navigates away from the page or refreshes before the results are returned, then they basically lose that query and have to start again.

Is there a way I can leverage the “backend workflows” or any other suggestions so I can improve the user experience by:

  • Letting them run the function as normal but instead of having to wait for the data to return, it could simply be emailed to them when returned
  • Letting them run the function as normal but instead of having to wait for the data to return, they could safely navigate away from the page and then after some time go and check their “my account” page where the data would be stored along with all the history of their previous queries and data (this “my account” page and the history already exists.)

Currently the APIs are setup as “plugins” - one configured with the default bubble API plugin and the other is using an OpenAI plugin.

Yes you would want backend workflows then since the user just needs to initiate it then they can navigate away.

Double check your plugins have SSAs (Serverside actions), so go to backend workflows and make sure all the same actions are available.

Sounds like you want a new datatype “Job” so each job could be tracked with the progress as well as maintain history of previous ones.

When they initiate the workflow, create a Job, send that to the backend workflow as a parameter and after each step you can update the status/progress on the relevant job.

Thanks Tyler.

So sounds like instead of the current setup which is essentially:

→ click a button → run workflow that calls APIs and takes 2 minutes,

I’d instead have something like:

→ click a button → run a workflow that calls backend workflow → backend workflow runs APIs and updates status of “job”.

But I can’t seem to figure out that logic…I can’t call a backend workflow from a front end workflow? Perhaps what I have to do is change some data thing in the front end workflow and use that to trigger a “database trigger event” backend workflow…

It’s the Schedule an API workflow action and you schedule it for the Current date/time

Make sure backend workflows is enabled in your app settings

Then in the backend have it create the Job, set the status (Option set field with some different stages of Status?)

Then the user can view on their end Jobs created by them (Repeating group searching for Jobs)