const allPromises = []; for (r in records) { const promise = update(r); allPromises.push(promise); }; await Promise.all(allPromises);