Workflows optimization

Hi Bubblers!

In the wake of the recent changes announced concerning Bubble’s pricing changes, I’m trying to change the way I’m doing some things on my apps.

I had some questions and would like to get your experiences on different subjects:

  1. Page load conditions: as many of you, I have multiple conditions on page load. Like : if the user is… go to, or even going in database to check things and redirect the user when conditions are met (almost 10-15 conditions per page load, which is a lot yes). I tried to do it backend workflow, but there is no way to redirect with this kind of worklow no?
  2. Do x every seconds: what a costly event ahah! I try to figure out if the user is still connected to make a change in database and display status as ‘disconnected’ if so… Is there any workaround you know for this kind of event?
  3. Database trigger goto: as long as I know, there is no ways to trigger go to event backend in case of a change in DB? I have a game where if the ‘team’ change to next step, all players should move forward…

Have you any piece of advice to give to me or discuss?

Thanks a lot & good day all!

Hi @jehan.ore,

  1. You can try doing it with the “Do when condition is true” General Events - Bubble Docs, and you do a “Search For”. So if you update in the backend, the condition will be true so it will trigger on your page.
    Don’t know if it would help in your case.

Otherwise, you could try putting parameters in the URLs as I’ve explained here Repeating Groups with minimal WUs with vanilla Bubble - My best practices - #13 by

  1. Maybe with this but not sure : [New plugin] Mouse & Keyboard Interactions (Highly experimental!)

  2. Try using “Do when condition is true” as cited above.

1 Like

Surely whatever conditions you’re using here will only relate to either the Current User or the Current Page Things? (in which case, how is that an issue)…

Or are you doing multiple searches for lots of different things as part of your pageload redirect workflows?

Thanks for your reply!

  1. Url parameters are more than welcome, but also have some ‘flaws’, as it makes the page re-load no?

  2. I’ve already seen this plugin yes, thanks! The only flaw I saw is that I would like not to set ‘disconnected’ to a player that is just not moving their mouse… Would have been awesome to catch when user quit a page for instance.

  3. Thanks! It then remains frontend workflow I assume no? Which is a bit more consumming WU from what I understood yesterday in the webinar

Thanks a lot for your contribution!

Hello Adam,

Thanks for your time!

I am effectively checking many different things when page’s load, as a user could have the right to access the page (like for admin contents), but there is also pages depending on many other things.
For instance, I have some ‘events’ pages, where user registers (which creates a specific entry in DB : attendees). Then when loading each event page, I should check conditions on the user, the event (which is a parameter of the page) and the ‘attendee’…

I assume I just have to get my workflows on every pages the same and not referring to a backend workflow (because we can’t use the ‘go to’ there)

Thanks a lot

Yes, but you have to load those things anyway for your app to work… so there’s no optimization you can do regarding that.

1 Like
  1. No the page doesn’t reload, and I’ve seen in the (long) thread that it doesn’t count as a WU, so URL parameters are very useful in the new calculation.

  2. Yes still workflows so it will consume WU.

1 Like

I put something together for a student in the past and I used URL parameters to store information such as ‘current game’ and had conditions for when the ‘current game’ current question changes to run a workflow to move to the next question. Worked great and was super smooth for all users. Even used a timer with it, whose same setup was expressed in the webinar yesterday.

There are some plugins that will allow actions to run if the user pointer moves off page, and I’ve tested with desktop in past to show an alert and they work. You can check the plugin store for something that does that…OR, scrape the feature.

You can redirect with backend workflows, not in the backend directly though. Have on the data you are modifying in backend a status field that will change when the backend workflow is completed (in past I used a separate data type I called ‘processor’ and I think that will be too costly now)…and on the page, when you schedule the backend workflow, you also trigger a custom workflow when data changes. You’ll watch for the change to the status field and the custom trigger on the page will have the navigation actions.

1 Like