# 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

Direction | Name | Data Type | Description
--- | --- | --- | ---
Input | Input | Any | Payload with a file path
Output | Output | Any | Payload merged with delete result

## Configuration

Field | Type | Default | Description
--- | --- | --- | ---
filePath | Text | `{{filePath}}` | Path to the file to delete. Supports `{{var}}` templating; falls back to `filePath` on the incoming payload if blank.
dryRun | Boolean | `false` | If `true`, the node resolves the path, validates safety, and returns the success payload — but does not actually delete the file.

## Output Variables

Variable | Type | Description
--- | --- | ---
deletedPath | String | Resolved path of the file that was deleted (or would have been, in Dry Run)
success | Boolean | Whether the delete operation succeeded
dryRun | Boolean | Present and `true` only when Dry Run skipped the actual delete

## Safety

- Irreversible. Files deleted by this node bypass the macOS Trash. There is no Undo.
- Allowlist. Paths resolving to `~/Library/`, `~/Documents/`, the running app bundle, or protected system locations (`/System`, `/etc`, `/var`, `/usr`) are refused.
- Recommended pairing. Combine with Compare to gate deletion behind an explicit confirmation field on the payload, and with Move to Trash as the safer default for user-facing flows.