Generic function to batch a list and apply an async function to each batch
The input list to batch and process
The async function to apply to each batch
The maximum size of each batch
A promise that resolves to the flattened results of all batch operations
This function prevents exeeding the max argument limit of node API endpoints
Generic function to batch a list and apply an async function to each batch