Move to Trash

Action trash

action.move_trash

Move a file to the macOS Trash. The source path comes from filePath in config (template-rendered with the upstream payload; defaults to {{filePath}}) or from filePath on the incoming payload. By default this routes through the macOS Trash, so an accidental trash is recoverable — enable Permanent to bypass the Trash and remove the file for good.

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 removed. 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.

Destructive action

This node removes files. The default mode routes through the macOS Trash so deletion is recoverable; toggling permanent bypasses the Trash entirely and the file cannot be undone. With Allow Folders on, the whole folder and everything inside it is removed too — the default recoverable Trash mode is the safer choice when that's what you mean to do. Workflows containing this node prompt for confirmation on every arm.

Ports

DirectionNameData TypeDescription
InputInputAnyPayload with source file path
OutputOutputAnyPayload with trash result

Configuration

FieldTypeDefaultDescription
filePathText{{filePath}}Path to the file to trash. 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 trash the file.
permanentBooleanfalseBypass the Trash and remove the file directly — irreversible.
allowFoldersBooleanfalseAllow the source to be a folder instead of a single file. With this on, the whole folder and everything inside it is removed.

Output Variables

VariableTypeDescription
originalPathStringPath of the file before trashing
trashedPathStringResulting path inside the Trash (empty when permanent is true, or in Dry Run)
successBooleanWhether the trash operation succeeded
permanentBooleanWhether the file was permanently deleted (Trash bypassed)
dryRunBooleanPresent and true only when Dry Run skipped the actual trash

Example

Clear out expired downloads, recoverably: