File node: how to create an uniquely named file every time the node gets data passed through it?

If you use a Retained topic in MQTT then that will remember it for you. Alternatively you could use Persistent Context in node-red.

[Edit] But I like @hotNipi's idea better.