Delete input file
Once processing is complete, you may want to delete an input file to avoid reprocessing the file, or to clean the watched folder. This can be done using the file operations node. Select Delete for the Operation option, in the Properties panel
See Trigger flow with a folder capture node for instructions on setting up a watched folder. That is the first step for this flow.
When deleting the file, you can use the full file path stored in msg.filename, or, if you backed it up earlier, use a custom property like msg.myFile or msg.currentFile. The filepath should be absolute; otherwise it is relative to the working directory of the Node-RED process.
Next use case: Move input file to an error folder