Best practice on doing hundreds of API queries

@Top_Admin

For Point A I found it best when I send only the id or basically the least amount of information possible to be functional.
for the following reasons
1- it helps with the performance in front facing UI: you won't have to run the query that will get the information needed for the workflow on the client side.
2- as the workflow grows and you need more information (names of the users to contact for example) it will be much easier to just do that in one place at the workflow and leave the app functioning as is.

This is all just personal experiences. it might be more suitable for you to send the list of phone numbers.

As for the concurrency question:

Good news is loops in retool workflows execute in parallel by default.


They use Promise.all() to resolve all the values in parallel.
so there is no need to trigger the same workflow more than once.

However, one thing that you will have to take care of ,as the number of users grow, is the rate limit of the API you're working with.
you might have to work in batches or execute sequentially to get around the rate limit.

2 Likes