 <p>The best way to coordinate multiple asynchronous operation is to use promises. So, if this were my code, I would change or wrap <code>saveImageToLocalTo()</code> and <code>Posts.insert()</code> to return promises and then use promise features for coordinating them. If you're going to be writing much node.js code, I'd suggest you immediately invest in learning how promises work and start using them for all async behavior.</p> <p>To solve your issue without promises, you'd have to implement a counter and keep track of when all the async operations are done:</p> <pre><code>var savedPath = []; var doneCnt = 0; for(i=0;i&lt;n;i++) { savesaveImageToLocalTo(files[i], function(path) { ++doneCnt; savedPath.push(path); // if all the requests have finished now, then do the next steps if (doneCnt === n) { var post = req.body; post.images = savedPath; Posts.insert(postfunction(err, result) { res.send(err, result) }); } }); } </code></pre> <p>This code looks like it missing error handling since most async operations have a possibility of errors and can return an error code.</p>