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.

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.

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