Skip to content
Preptima
mediumConceptMidSeniorStaff

Walk me through the phases of the Node event loop.

Node.js event loop phases explain callback ordering across timers, poll, check, nextTick and promise microtasks. Correct answers separate macro-task phases from microtasks instead of memorising one log order.

4 min readUpdated 2026-08-15

Answer

Short answer

Timers, I/O callbacks and setImmediate run in event loop phases, while process.nextTick and promise microtasks drain between turns. Use that model to predict callback order and avoid starving I/O with unbounded microtasks.

Was this answer helpful?

Likely follow-ups

  • In what order would a promise callback, a setTimeout, a setImmediate and a process.nextTick run?
  • Why is setTimeout versus setImmediate non-deterministic in the main module but deterministic inside an I/O callback?
  • What happens if a process.nextTick callback recursively schedules another nextTick?
  • Where do worker threads help with a blocked loop and where do they not?
  • How does an async function's await interact with the microtask queue compared to a .then chain?

Related questions

Further reading