I want to create a temporary file with a unique name alongside an execution path in a node-red flow. I know that this would be safe:
- Node1 - exec, calls
mktemp, which creates a temporary file with a unique name
- Node2, fills temporary file with content
- Node3 - exec, calls executable which requires the content present in tempfile
- Node4, deletes temporary file again
And in-between some change nodes to shuffle the data between fields as needed.
Now I'm considering to replace the call to
mktemp by using a temporary file named
"/tmp/nodered-" + msg._msgid. Is
_msgid unique enough provided I take care in my flow that the same original message cannot be routed to my Node1-Node4 sequence through multiple paths?