Schedule API workflow on a list - does the list have a limit?

I stubbornly wasted quite some time trying to get around this instead of asking for help. When I finally asked for help the solution was clear within minutes.

I’m writing this as a:

  1. note-to-self (I tend to forget),
  2. way of helping someone else in the future; and,
  3. getting some feedback from the Bubble hive-mind.

Here is the solution I came up.
tl;dr learn how to use recursive workflows.

Some context: I need to:

  1. create a list of Apartments within Buildings (100-300 apartments per building, up to 30 buildings), and
  2. add those created Apartments to the Building’s List of Apartments.

It’s a poor-man’s graph database, I guess. The problem was that I would schedule an API workflow on a list and, because of well-documented limitations of Bubble’s database, these items would either not be created at all or they would not be added to the Building’s List of Apartments.

The main problem was that it was trying to add multiple Apartments to one Building’s List of Apartments. That lead to data inconsistencies.


The solution I came up with - with the tutelage of the all-knowing :woman_technologist: @romanmg :woman_mage: - was to create a recursive workflow for each Building. So that only 1 Apartment is added to the Building per iteration.

When the user clicks a button, it schedules an API workflow on a list; running on a list of Buildings and I pass a list with texts that will be used to create the Apartments.

  1. that API Workflow creates an Apartment
  2. then adds it to the Building
  3. schedules itself again, but this time it takes that list of texts:minus list of texts:first item (which was the item just used).
  4. it will stop scheduling itself when that list of texts:count is 0

This is probably child’s play for you pros, but for me it was like the first time I discovered VLOOKUP in Excel.


I hope this helps some poor soul in the future.

Thanks! :bowing_man:

20 Likes