How to generate unique node ID when creating a flow via node-red API

Hi Charlotte, I had the same problem as you. I have found that IDs are generated with this JScript function (1 + Math.random () * 4294967295) .toString (16);

You can find it on file @node-red/util/lib/util.js, function generateId()

I hope it is useful for you
Ciao

1 Like