Avoiding rate limiting while parsing many records

Hey Team!

It’s your best bud Matt Cruz! Remember me? No? That’s fine lol.

SO! I am working on this thing which works well and good provided that I am only parsing records under my burst rate.

The ‘thing’ is a custom coded workflow action that automates the creation of a custom object im calling an ‘event relation’ which stores data of a specific contact’s relationship to an ‘event’ (not a hubspot event, different custom object)
So the contact hits the action and it makes a few calls (depending on circumstance anywhere between like 4 and 8 per contact). Those calls check to see if there’s already a record for this contact and this event, and if not it creates and associates one, simple stuff.

This works great in my testing on small batches but I forgot to account for potential rate limiting when I am processing a larger list.
I don’t necessarily need the data to populate immediately, I am happy to have to do batches at a time, but I am struggling to think of a good way to say basically
“Regardless of the size of this list I send you (the workflow) I want you to run 20 of these, wait 10 seconds, do another 20, repeat until done”
The way the workflow receives its ‘list’ is by way of two properties being set, when they are both known, the contact is enrolled.
Again the whole idea of this process is to take something that used to be very manual over here and automate it, so I am trying to avoid anything like “manually set batch numbers before it’s enrolled” that’d be harder to scale out to my team than “just set the ID of your event and the status and let it ride”

I think I know my workaround though im dragging my feet on implementing it.

I think I am going to make a local app that I present the CSV with the data
Then, it will do the job of being like “do 20, wait 15 seconds, do 20 more, repeat until done”
That way, the workflow is only ever enrolling 20 or so at a time. It’s still replacing hours of work for me and my team so that’s cool for me. That said, it would be cool to see a “stagger enrollment” option and have the ability to define records per timeframe

This is great feedback, @MCruz69! Thanks for taking the time to come back and update this thread.

Have fun building! — Jaycee