---
title: "Comment by max on \"Tidbit 01: How Does Event Loop Handle Promises? Ever Thought?\" | Hashnode"
description: "This microtask vs macrotask priority is something I ran into the hard way building an async agent orchestration system on Node.js. I had a chain of Promise.reso"
url: "https://hashnode.com/posts/how-does-event-loop-handle-promises-ever-thought/68480b9fb9cb417f4415e5e0/comment/69cf5141845022635fc621a1"
---

[Discussion](https://hashnode.com/posts/how-does-event-loop-handle-promises-ever-thought/68480b9fb9cb417f4415e5e0)

Comment [Tidbit 01: How Does Event Loop Handle Promises? Ever Thought?](https://hashnode.com/posts/how-does-event-loop-handle-promises-ever-thought/68480b9fb9cb417f4415e5e0)

[max](https://hashnode.com/@maxxmini)

[Apr 3](https://hashnode.com/posts/how-does-event-loop-handle-promises-ever-thought/68480b9fb9cb417f4415e5e0/comment/69cf5141845022635fc621a1)

This microtask vs macrotask priority is something I ran into the hard way building an async agent orchestration system on Node.js. I had a chain of Promise.resolve() callbacks coordinating sub-processes, and a setTimeout(0) health check that kept getting starved because the microtask queue never fully drained between cycles.

Ended up refactoring the health checks to use setImmediate() on the I/O callback phase instead, which gave them a more predictable slot in the loop.

One thing I am curious about — have you noticed any practical difference in how queueMicrotask() behaves vs Promise.resolve().then() in terms of ordering? In theory they both hit the microtask queue, but I have seen some edge cases with nested microtasks where the scheduling felt slightly different.
