SFTP List Directory

View as Markdown

The List Directory node looks inside a directory on a remote SFTP server and hands back the files and folders it finds, with optional filters on name and date. It is the starting point for any workflow that picks files up off a server.

When to use it

  • You want to see what files are waiting in a directory before downloading them.
  • You need only files that match a pattern, such as *.csv, or a date window.
  • You want to loop over the results and download each file in turn.

Inputs

FieldWhat it’s forExample
ServerThe SFTP server to connect to.sftp.example.com
PortThe server’s port, usually 22.22
UsernameThe username to sign in with.automation-user
Password or keyThe password or private key to sign in with, stored as a secret.A Secret reference
DirectoryThe directory to list./outbound/reports
Name patternOnly return files whose name matches this pattern.*.csv
Modified afterOnly return files changed after this date and time.2026-01-01
Modified beforeOnly return files changed before this date and time.2026-02-01
Include foldersWhether to include subfolders in the results.false
Sort byWhich field to order the results on: name, modified, or size.modified
Max resultsThe most entries to return.10

The password or key must reference a workflow Secret. Any field can be a fixed value or an expression that reads from an earlier step.

Outputs

FieldWhat you get back
EntriesThe files and folders found, each with its name, full path, size, whether it is a folder, and last-modified time.
Total matchedHow many entries matched the filters before the limit was applied.
CountHow many entries were returned.

Example

A carrier drops daily CSV reports onto an SFTP server for Chen Insurance Group. A workflow uses List Directory to find the *.csv files in /outbound/reports sorted newest first, then loops over the results with a For Each step to download and process each report.

The SFTP List Directory node configuration panel, showing the server, directory, and filters.

The password or private key must be stored as a workflow Secret and referenced from the node - a plain-text credential is rejected when you publish. Provide whichever one your server accepts.