Can anyone quickly diagnose why this schedule API workflow ran through 350k workload units?

My app crashed and I woke up with my entire allotment of Workload Units Expired (brand new app). I tried to start a 2ND “Schedule API workflow on a list” after step 3 which caused the crash. I contacted Bubble support, but I was hoping to understand why this crashed to prevent in the future.




I’m not surprised!!!

You’ve recursively scheduled an API workflow on a list (which is a big no-no in itself) … and you’ve done it without any exit condition (so it will just continue forever… or until it crashes, which it will… pretty quickly).

Here’s what happens if you do what you’re doing…

You schedule the workflow to run initially from the page (there’s no problem here).

The workflow runs, and the only thing it does is schedules itself to run on a list (aside from being completely pointless… here’s where the problem begins)…

I have no idea how many things are in your list, but lets say conservatively it’s just 10.

So the first time the workflow runs, it schedules itself to run 10 more times (once for each of the things in the list).

Now, each of those 10 runs, will in turn schedule the same workflow to run again on each of those 10 things, so now you’re running 100 workflows.

When those 100 workflows run, they’ll be scheduling another 1,000 workflow runs… then next run will be 10,000 then 100,000, then 1,000,000 and so on.

after just 10 runs you’ll be asking Bubble to schedule 10 billion workflows (then a hundred billion, a trillion, and so on)…

And as you’ve told it to continue with this forever (you’ve got no exit condition) you can be thankful it crashed when it did (otherwise you could have consumed millions of WUs).

In any case… I can’t work out at all what you’re trying to do…

The workflow in question doesn’t actually do anything (aside from loop itself exponentially, forever).

What are you trying to do here?

4 Likes

Take down the main Bubble cluster :rofl::rofl:

7 Likes

OK this makes sense. Yeah I messed up with this part :confused:… I’m trying to pull a list of ID codes of homes (step 3, successful) and then search for and save the home details using those same IDs as params(step 4, unsuccessful).

Keep in mind, with this specific provider, the ID codes are searched by location and the home details need to be searched by individual ID code.

So user searches for a location, and then the workflows start and update the database.

What should I do differently?