const async = require("async"); async.eachSeries(updates, (up, next) => { techEntriesList.push(up.entryId); if (up.subJobType && up.userId) { up.jobId = jobId; updatePeopleWithCallback(jobId, up, jobUpdates, (err, technician) => { if (technician) technicianList.push(technician); console.log(Date.now()); next(); return; }); } });