Delete File

Action trash.slash

action.delete_file

Permanently deletes a file. There is no Trash safety net — the file is gone the moment this node runs. Use Move to Trash when you want recoverability.

The source path comes from filePath in config (template-rendered with the upstream payload) or from filePath on the incoming payload. Paths are resolved through the standard safety checks: ~/Library/, /System, /etc, and other protected locations are refused, and .. traversal is rejected.

This node also acts on a single file by default: a source that resolves to a folder is refused unless you turn on Allow Folders. A package like .app or .numbers is technically a folder on disk, but Finder shows it as a single file, and this node treats it the same way — it's never refused as a folder, with or without Allow Folders. With Allow Folders on, the whole folder and everything inside it is permanently removed — since this node has no Trash route, prefer Move to Trash with Allow Folders on when you want that removal to be recoverable. Your home folder and its top-level folders (Desktop, Downloads, Documents, Pictures, Movies, Music) are never accepted as a source, toggle or not — only the folders themselves are refused, and a file inside one of them, like a download sitting in ~/Downloads, is an ordinary source.

Extra restriction beyond Move to Trash: Delete File also refuses paths under ~/Documents/ by default. Permanent deletion in your Documents folder is too easy a footgun to expose by default. Use Move to Trash there, or run a shell script if you genuinely need to delete in that scope.

Enable Dry Run while you're wiring up the workflow — it returns the same output payload as a real delete but skips the destructive call, so you can confirm the path resolves correctly before letting the node remove files for real.

Destructive action

This is the most destructive node in the action palette — it removes a file from disk with no Trash route and no built-in recovery. Watchflows treats it as destructive by identity: the canvas badge, library palette tint, and inspector banner all surface unconditionally. Workflows containing this node prompt for confirmation on every arm, regardless of whether the path is still being typed.

Ports

DirectionNameData TypeDescription
InputInputAnyPayload with a file path
OutputOutputAnyPayload merged with delete result

Configuration

FieldTypeDefaultDescription
filePathText{{filePath}}Path to the file to delete. Supports {{var}} templating; falls back to filePath on the incoming payload if blank.
dryRunBooleanfalseIf true, the node resolves the path, validates safety, and returns the success payload — but does not actually delete the file.
allowFoldersBooleanfalseAllow the source to be a folder instead of a single file. With this on, the whole folder and everything inside it is permanently removed.

Output Variables

VariableTypeDescription
deletedPathStringResolved path of the file that was deleted (or would have been, in Dry Run)
successBooleanWhether the delete operation succeeded
dryRunBooleanPresent and true only when Dry Run skipped the actual delete

Safety