Files

Rename File

Change a file's name where it stands — from a template, or through a stack of transforms applied in order.

action.rename_file
FILERename File

At a glance

Does
Renames one file in its own folder
Emits
sourcePath, destPath, fileName, fileSize, renamed
Works with
Any file the flow can reach

Set it up

The source comes from filePath on the incoming payload. You supply the name. Base Name is a template — {{date}}-{{fileName}} — and path separators in it are stripped, because this is a name, not a path: a rename can never move a file out of its folder.

The inspector for a Rename File node showing the pipeline: base name, operations, result.
The inspector for a Rename File node showing the pipeline: base name, operations, result.

For anything beyond one template, add Rename Operations — an ordered stack applied top to bottom. The order is fixed: Base Name renders first, then each operation runs on the result, then the result is cleaned into a safe file name last (path separators stripped, colons swapped out). The extension is split off before the stack runs and re-attached at the end, so a Truncate or a Slugify can never eat the .pdf. Leave Base Name empty and the stack starts from the file's own name.

The inspector draws the stack as a pipeline: an editable sample at the top, the name as it exists after each step, and the final result at the bottom, all recomputed as you type.

A filename edit — spaces to dashes, a date on the front, lowercase — is an operation here. It never needs a Run Script node.

The operations

Every operation works on the name without its extension, except Extension Case. Every parameter is optional; a missing one takes the default shown.

OperationkindWhat it doesParameters (default)
Insert TextinsertTextPuts text at the start, the end, or a character index. Supports {{variable}}, including dotted paths like {{exif.dateTakenCompact}}.text (empty) · placement: start, end, index (end) · index: a number, used with index placement (0)
Add DateaddDateJoins a date to the name.source: today, created, modified (today) · format: iso = 2026-10-11, compact = 20261011, timestamp = 2026-10-11_14-30-00, custom (iso) · customFormat: a date pattern like yyyy-MM (yyyy-MM-dd) · placement: start, end (end) · separator (-)
Parent FolderparentFolderJoins the containing folder's name, e.g. Downloads-report.pdf.placement: start, end (end) · separator (-)
Change CasechangeCaseChanges the case of the name.mode: upper, lower, capitalize (lower)
SlugifyslugifyFolds accents, lowercases, and turns every run of spaces and punctuation into one separator.style: kebab = my-file, snake = my_file (kebab)
Extension CaseextensionCaseChanges the extension's case only, .JPG to .jpg.mode: upper, lower (lower)
TruncatetruncateDeletes characters from the start or the end. A stack that leaves only the extension fails the run instead of hiding the file as .pdf.from: start, end (end) · count (0)
Find & ReplacefindReplaceReplaces every literal occurrence. Both fields take {{variable}}. An empty find does nothing.find (empty) · replace (empty) · caseSensitive: true, false (true)
Regex ReplaceregexReplaceReplaces every match; the template supports $1 capture groups. The pattern is never interpolated, so payload values cannot inject regex. An invalid pattern fails the run and names the step.pattern (empty) · template (empty; supports {{variable}})

Created and modified dates fall back to now when the file has none to give.

Example: replace spaces with dashes

One Find & Replace operation, find a single space, replace a dash. Quarterly report final.pdf becomes Quarterly-report-final.pdf. Saved on the node, the stack is a list of operations:

[{"kind": "findReplace", "params": {"find": " ", "replace": "-"}}]

Paste this into the Flow Builder to get it on a folder:

Watch ~/Downloads for new files and replace spaces in each new filename with dashes.

Configure

FieldDefaultWhat it does
Base Name (template)—The new name, before the operations run. Empty starts from the original name.
Rename OperationsemptyThe ordered stack. Empty means template-only.
Overwrite ExistingOffOff auto-numbers a collision (report-1.pdf); on replaces the file.
Allow FoldersOffLet the source be a folder instead of a single file.

Output

Every key is available downstream as {{key}}.

KeyTypeValue
sourcePathStringThe path before the rename
destPathFileThe path after it
fileNameStringThe new name
fileSizeNumberSize in bytes
renamedBooleanTrue on a real rename; false for a no-op

Example: date-stamp every screenshot

Photo Added fires on screenshots only. Rename File slugifies the name, then stamps the file's creation date on the front.

Two nodes. A screenshot arrives and comes out renamed.
Two nodes. A screenshot arrives and comes out renamed.

Paste this into the Flow Builder to get the same flow:

When I take a screenshot, rename it to the date followed by a slugified version of its name.

Good to know

Allow Folders widens the blast radius. These nodes act on one file: a folder as the path is refused until you turn Allow Folders on, and then the whole tree goes with it. Your home folder and its top-level folders — Desktop, Downloads, Documents, Pictures, Movies, Music — are never a source, toggle or not; a file inside one is ordinary. A package like .app counts as a file either way.

Overwrite replaces a file that cannot be recovered. Off is the default and auto-numbers instead, which is almost always what you want. A flow with it on asks for confirmation every time it is armed. A folder already at the new name is never removed — the rename fails instead.

Order matters in the stack. Slugify-then-insert and insert-then-slugify give different names. The pipeline view shows exactly where each step lands before the flow ever fires.