Triggers

Directory Changed

Runs your flow when a file lands in a folder you watch — or changes there, or goes away.

trigger.directory_changed
TRIGGERDirectory Changed

At a glance

Fires when
A file inside the folder is created, modified, or deleted
Emits
Path, name, parent directory, extension, file type, change type, timestamp
Works with
Local folders, iCloud Drive, Dropbox, OneDrive, Google Drive

Set it up

Pick the folder, say whether subfolders count, and choose which changes you care about. macOS file-system events do the watching, so nothing polls.

The inspector for Directory Changed. Event Types starts at Created.
The inspector for Directory Changed. Event Types starts at Created.

Configure

FieldDefaultWhat it does
Directory—The folder to watch. Choose it with the picker.
Watch SubdirectoriesOnWatch everything nested inside too. Off means this folder's own files only — a subfolder appearing or going away does not fire.
Event TypesCreatedCreated, Modified, Deleted, or All Events.
Wait for iCloud downloadOnIf a file syncs in before its bytes reach this Mac, download it first and fire once it is complete. Turn off to fire on the placeholder.
Custom Arguments—Extra key-value pairs merged into the payload.

Output

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

KeyTypeValue
filePathStringFull path of the changed file
fileNameStringName, with extension
directoryStringParent directory path
fileExtensionStringLowercased, no dot: dmg
fileTypeStringImages, Documents, Audio, Videos, Spreadsheets, Presentations, Archives, or Other
changeTypeStringcreated, modified, or deleted
timestampStringWhen the change was seen, ISO 8601

Example: file downloads by type

Directory Changed watches ~/Downloads. Move File sends each arrival to ~/Documents/Sorted/{{fileType}}/{{fileName}}. Notification says where it went.

Three nodes. A download lands and it is filed.
Three nodes. A download lands and it is filed.

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

Watch ~/Downloads and move each new file into a folder under ~/Documents/Sorted named after its file type, then notify me.

Files already in the folder

This trigger only reacts to new files. Files already in the folder don't run on their own — when you switch the flow on, Watchflows asks what to do with them. See Folder Sweep + Preview Mode.

Good to know

A flow that moves files out of the folder it watches can re-trigger itself. Event Types defaults to Created for exactly that reason — with All Events, your own deletions come straight back round.

One file you already know the path of? Use File Changed. Directory Changed is for a folder whose contents you cannot name in advance.