Help with backend workflow

I am building a volunteer management application. We plan by season, which is roughly 13 weeks per season. We have 52 preset weekly time slots (eg Monday 8:30 to 11:30am) that we need to fill each season. A Volunteer commits to particular time slots per season. So over a complete season, that is 676 volunteer sessions that we need to manage (52 slots x 13 weeks).

I built a backend workflow that creates the 676 sessions in advance when you create a new season. The idea being that the app assigns one or more volunteers to these sessions after they commit to a time slot. I need to create the sessions in advance so I can see where our gaps are that need to be filled.

The problem I am having is that the back-end workflow is extremely slow in creating the 676 sessions and sometimes stops mid-way thru, only creating a partial list of sessions. I get emails from Bubble saying I have used up all the capacity and recommends I upgrade my plan.

676 records doesn’t seem like a lot to me so I was surprised I maxed out my capacity. Does anyone have any ideas how I can do this more efficiently? Keep in mind that we plan to turn this into an app that other nonprofits can use. I am concerned that multiple users could be creating new seasons in parallel and I run into this problem no matter what plan I am on.

Thanks

Hey @ianhayes2121 :wave:

What does your backend workflow look like? How many seconds in between each ‘create a new thing’ are you doing?

As an alternative, I noticed a huge difference when I ‘copy a list of things’ compared to ‘create a new thing’. To make a lot of new things faster, create 676 things in the database as templates. Then use a workflow to copy 50-100 things at a time. Then it only takes 6-10 seconds to create all those things.

Let me know if that helps. :blush:

3 Likes

I would create filtered Timeslots on the fly using the full calendar scheduler suite element called Timeslot generator.

2 Likes

How are you running the backend workflow? (on a list, or recursively?)…

Also, you could use the Data API Bulk Create instead which should be a lot faster…

2 Likes

It’s recursively. Each session has a specific Start Date/Time and End Date/Time. I cycle thru creating a new session record for each specific date/time. Is there a way to do this as a stored list then sending it to the bulk data api?

Is there a way to do this as a stored list then sending it to the bulk data api?

Sure… you can do just that… just define the list and format it correctly for the API call… (as per the Bubble docs)…

I dont see how to do that. In the backend workflow, I only see options to create things in the database. Can you point me to the documentation that you mentioned.

Here’s the docs for the Bubble Data API: Data API - Bubble Docs

…although, your question sounds more like you’re asking how to create and make API calls more generally?..

… you’ll need to set up the call in the API connector plugin (as an action)… then you can call it from the backend (or frontend), and pass the list into the call in the body.

I know how to make API calls. I guess my specific question is can you dynamically build an array and then send that to the bulk data api to create the list of records. I don’t see any method to do that. Seems like I need to build a json file externally and then call that with a post to create the records. I must be missing something.

I guess my specific question is can you dynamically build an array and then send that to the bulk data api to create the list of records

Yes…

You can do that directly in the ‘make API call action’ in your workflow…

So just use the list (the one you’re currently iterating over with a recursive workflow), formatted correctly (using format as text), in the body of the Bulk Create API call.

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