I wonder how one does this on nodejs across instances gracefully.

Well, there's RabbitMQ and the rest of the message queues out there. But I don't know if those fall in your definition of "graceful".

No, I mean with just NodeJS only.

"easiest/low tech" would be some sort of unix file-locking and inode. Only works if you are on the same host machine though...AAAND sounds like it would be quite hacky.