Skip to main content

Delete File (v2)

The Delete File node in Automations v2 deletes each incoming file from the folder where it is stored. Use it to remove working files after the nodes before it have processed them, to clear processed exports from an inbound folder, or to remove files that match a pattern on a schedule.

Delete File accepts only file items that refer to stored files. A data item has no file to delete, and a temporary email file has not been saved in a folder. Temporary email files are cleaned up under the run's retention rules and do not need a Delete File step.

Settings

Exclude Pattern removes matching files from the items the node deletes, using the same syntax as the trigger's Exclude Pattern. The files a run deletes are otherwise the files the trigger selected and the nodes before Delete File passed on.

What the Next Node Receives

Delete File passes on one data item for each deleted file, recording the file's former path, its size, and the time it was deleted, because the file itself no longer exists. A Send Email node after it can report what was removed, and an Aggregate node can combine the data items into one summary.

Errors

A temporary run file fails with a processing-failure error explaining that Delete File requires a stored file. To delete a saved copy of an attachment, first write it to a folder with Copy File or Move File, then connect Delete File after that node. Delete File removes the saved destination file, while the run retains its temporary content.

A stored file that no longer exists when the node runs fails with a not-found error. Error Handling rules on the node determine what happens to a failed item.

Delete File vs. File Expiration

File Expiration is a Folder Setting that deletes the files in a folder that have not been modified for a number of days. Use it when the only rule is age and the scope is one folder, with or without its subfolders. Use a Delete File node when the files are selected by pattern or by the nodes before it, when the deletion follows another operation, or when it runs on a trigger other than time.