Back up file metadata

In some flows, downstream nodes may overwrite msg.file. To preserve the original file metadata, you can back it up into a custom property using a change node.

Note: See Trigger flow with a folder capture node for instructions on setting up a watched folder. That is the first step for this flow.

For example, you can add a change node and a debug node, and set the Properties of the change node to Set:

  • msg.file to the value msg.myFile or

  • msg.file to the value msg.currentFile.

Flow described above, with properties for the change node as described above.

This ensures that the original file reference remains available for later use, even if msg.file is modified or replaced during processing.

Next use case: Read XML file contents