Skip to content

File arrived

Starts when a file arrives in a folder on an SFTP or FTPS server.

@lainstack/file-server/file-arrived-trigger · Triggers

Use File arrived to start a run for each file that appears in a folder on an SFTP or FTPS server. Choose it for partner drops, such as a customer who uploads orders to your server. The run gets the file’s path, size and modified time. To read the file, add Read file from server after the trigger and give it the path.

Good to know:

  • Pick the server under SFTP or FTPS connection, then the Folder to watch. The folder is relative to the connection’s root folder.
  • Name pattern limits the files, for example *.xml. Leave it empty to take every file.
  • The folder is checked every 5 minutes. A file starts a run once its size and modified time stayed the same across two checks at least a minute apart, so a file that is still uploading doesn’t start a run early.
  • With Each file, every file starts its own run. With When a marker file appears, a marker such as *.done says the files with the same name before the extension are complete, and one run gets all of them (up to 64; a larger set starts no run).
  • Files already in the folder at the first check after publishing or turning the automation on start no run, and so do files there when the connection’s location or this trigger’s settings change. The first check runs as soon as you publish.
  • Nothing is moved or deleted on the server. Handled files still count toward the limit of 1,000 matching files, past which no run starts, so end the run with Move file on server or Delete file on server.
  • A file replaced with a new size or modified time starts a new run, as does one sent again after a check saw it gone. Where FTPS gives no exact time, a same-size file replaced on the same day is not noticed.
  • After a failed connect the trigger waits before it tries again.
  • A draft run takes its trigger data from a past run or a pinned sample on the Samples tab.
Setting Key Type Details
SFTP or FTPS connection (required) credentialId Connection The server to watch.
Folder folder Text Relative to the connection’s root folder. Empty watches the root folder. At most 1,024 characters.
Name pattern pattern Text Optional glob on file names, for example *.xml. Empty takes every file. At most 256 characters.
Start a run for mode One of Each file, When a marker file appears Default each_file.
Marker pattern marker Text A file that says its files are complete, for example *.done. The run gets every file with the same name before the extension. At most 256 characters.
Output Path Type
Path payload.data.path Text
Size payload.data.size Number
Modified At payload.data.modifiedAt Text
Paths payload.data.paths List
Marker payload.data.marker Text
Credential Id payload.system.credentialId Text
Received At payload.system.receivedAt Text

Last updated: