Skip to main content

SFTP Component

Read, write, move and delete files on an SFTP server

Component key: sftp

Changelog ↓

Description

SFTP (SSH File Transfer Protocol) is a secure file transfer protocol that operates over SSH. The SFTP component allows uploading, downloading, moving, and deleting files on an SFTP server.

A common integration pattern involves listing files in a file store, and performing a series of actions on the array of files that are returned. See our looping over files quickstart for information about how to create a loop over an array of files.

Connections

Basic Authentication

key: basic

The Basic Authentication connection is used to connect to SFTP servers that support username / password login.

Prerequisites

  • An SFTP server with username/password authentication enabled
  • Valid credentials (username and password)

Configure the Connection

  • Username: Enter the SFTP account username
  • Password: Enter the SFTP account password
  • Host: Enter the SFTP server hostname or IP address
  • Port: Enter the SFTP server port (default: 22)

Advanced Settings (Optional)

  • Timeout: Connection timeout in milliseconds (default: 3000)
  • Enable Unsecure Server Host Key Algorithms: Enable deprecated host key algorithms for legacy servers
  • Enable Unsecure Ciphers: Enable CBC ciphers for legacy servers
  • Custom Server Host Key Algorithms: Comma-separated list of custom host key algorithms (overrides defaults)
  • Custom Ciphers: Comma-separated list of custom ciphers (overrides defaults)

Consult the SFTP server administrator to determine which login method the server supports.

On-prem enabled: this connection can be configured to connect to an on-prem resource on a private network. Learn more.

InputNotesExample
Custom Ciphers

A comma-separated list of custom ciphers. Overrides the default ciphers. Cipher order matters. Advanced setting.

aes128-ctr, aes192-ctr, aes256-ctr
Custom Server Host Key Algorithms

A comma-separated list of custom server host key algorithms. Overrides the default server host key algorithms. Algorithm order matters. Advanced setting.

ssh-rsa, ssh-dss
Enable Unsecure Ciphers

When true, CBC ciphers will be added to the connection.

false
Enable Unsecure Server Host Key Algorithms

When true, unsecure server host key algorithms will be added to the connection.

false
Host

The address of the SFTP server. This should be either an IP address or hostname.

sftp.example.com
Password

The password for SFTP authentication.

p@s$W0Rd
Port

The port of the SFTP server.

2222
Timeout

How long the client will await a request.

4000
Username

The username for SFTP authentication.

john.doe

Private Key

key: privateKey

The Private Key connection allows access to an SFTP server via SSH public/private key authentication.

Prerequisites

  • An SFTP server with public key authentication enabled
  • A generated public/private SSH key pair
  • The public key must be stored on the SFTP server

Setup Steps

  1. Generate a public/private SSH key pair if not already available
  2. Copy the public key to the SFTP server (usually to ~/.ssh/authorized_keys)
  3. Verify the key is properly configured with the SFTP server administrator

Configure the Connection

  • Username: Enter the SFTP account username
  • Private Key: Enter the complete private key (including headers and footers)
  • Key Passphrase: Enter the passphrase for the private key (if applicable)
  • Password: Enter the password if the server requires both private key and password authentication (uncommon)
  • Host: Enter the SFTP server hostname or IP address
  • Port: Enter the SFTP server port (default: 22)

Advanced Settings (Optional)

  • Timeout: Connection timeout in milliseconds (default: 3000)
  • Enable Unsecure Server Host Key Algorithms: Enable deprecated host key algorithms for legacy servers
  • Enable Unsecure Ciphers: Enable CBC ciphers for legacy servers
  • Custom Server Host Key Algorithms: Comma-separated list of custom host key algorithms (overrides defaults)
  • Custom Ciphers: Comma-separated list of custom ciphers (overrides defaults)

Authentication is performed using the username and corresponding private key.

On-prem enabled: this connection can be configured to connect to an on-prem resource on a private network. Learn more.

InputNotesExample
Custom Ciphers

A comma-separated list of custom ciphers. Overrides the default ciphers. Cipher order matters. Advanced setting.

aes128-ctr, aes192-ctr, aes256-ctr
Custom Server Host Key Algorithms

A comma-separated list of custom server host key algorithms. Overrides the default server host key algorithms. Algorithm order matters. Advanced setting.

ssh-rsa, ssh-dss
Enable Unsecure Ciphers

When true, CBC ciphers will be added to the connection.

false
Enable Unsecure Server Host Key Algorithms

When true, unsecure server host key algorithms will be added to the connection.

false
Host

The address of the SFTP server. This should be either an IP address or hostname.

sftp.example.com
Key Passphrase

The passphrase for the private key. Leave blank if none.

p@s$PHr@$3
Password

Though uncommon, some SFTP servers that use private keys may also require a password. Leave blank if none.

p@s$W0Rd
Port

The port of the SFTP server.

2222
Private Key

The SSH private key for authentication.

-----BEGIN OPENSSH PRIVATE KEY----- abc123...
Timeout

How long the client will await a request.

4000
Username

The username for SFTP authentication.

john.doe

Triggers

New or Modified Files

Checks for new and modified files in a directory on an SFTP server on a configured schedule. | key: newOrModifiedFiles

InputNotesExample
Connection

The SFTP connection to use.

Include Subdirectories

When true, recursively monitors files in all subdirectories. When false, only monitors files in the specified directory.

false
Path

The path of the directory on the SFTP server to list files from.

/path/to/directory/
Pattern

The glob-style pattern for filtering files (e.g., *.txt).

*.txt

This trigger polls an SFTP server for new and modified files in a specified directory on a configured schedule.

The trigger detects:

  • New files: Files that did not exist during the previous poll
  • Modified files: Files whose size or modification timestamp changed since the previous poll

How It Works

  1. The trigger runs on the configured schedule (e.g., every 5 minutes)
  2. It connects to the SFTP server and lists all files in the configured directory
  3. Each file's path, size, and modification timestamp are recorded
  4. The current file list is compared against the previous poll's state
  5. Files not present in the previous state are reported as new
  6. Files whose size or modification timestamp differ from the previous state are reported as modified
  7. The trigger updates its state with the current file map for the next poll

If no new or modified files are detected, the trigger reports no changes and the flow does not execute.

Configuration

Configure the following inputs:

  • Connection: The SFTP server connection credentials
  • Path: The directory path on the SFTP server to monitor (e.g., /uploads/incoming/)
  • Pattern: A glob-style pattern to filter files (e.g., *.csv, *.txt). Defaults to * (all files)
  • Include Subdirectories: When enabled, the trigger recursively scans subdirectories within the specified path. Defaults to false

Returned Data

Example Payload
{
"data": {
"newFiles": [
{
"path": "/uploads/incoming/report-2026-02-11.csv",
"size": 24576,
"modifiedAt": 1739308800000
}
],
"modifiedFiles": [
{
"path": "/uploads/incoming/daily-log.txt",
"size": 102400,
"modifiedAt": 1739312400000
}
]
}
}

Each file entry includes:

  • path: The full path to the file on the SFTP server
  • size: The file size in bytes
  • modifiedAt: The file's last modification timestamp (Unix milliseconds)

Notes

  • The trigger tracks changes using file size and modification timestamp. If a file is replaced with content of the same size and timestamp, the change will not be detected.
  • Enabling Include Subdirectories on directories with many nested files may increase polling time and SFTP server load.
  • The trigger does not detect deleted files. It only reports files that are new or have changed.
  • On the first poll, all files matching the pattern are reported as new since there is no previous state.

Actions

Append File

Append data to an existing file on a SFTP server. | key: appendFile

InputNotesExample
Connection

The SFTP connection to use.

Data

The text or data to append to the file.

Path

The path on the SFTP server where data will be appended.

/path/to/remote/file.txt

{
"data": "Appended data to /upload/path/to/file.txt"
}

Create Directory

Create a new directory. When Include Subfolders is enabled, recursively creates any missing directories in the path. | key: createDirectory

InputNotesExample
Connection

The SFTP connection to use.

Path

The path of the directory on the SFTP server to list files from.

/path/to/directory/
Include Subfolders

When true, recursively creates any missing directories in the path.

true

{
"data": "/path/to/new/directory/"
}

Delete File

Delete a file from a SFTP server | key: deleteFile

InputNotesExample
Connection

The SFTP connection to use.

Path

Path of file to delete

/path/to/file.txt

{
"data": null
}

Fast Get

Read a file from SFTP | key: fastGet

InputNotesExample
Connection

The SFTP connection to use.

Path

Path of file on SFTP server to read data from

/path/to/file.txt
Return Buffer

When true, treats the file as a binary file with content type 'application/octet-stream', even if it is a text file. This is helpful if you are processing non-UTF-8 text files, as the runner assumes text files are UTF-8.

false

{
"data": {
"type": "Buffer",
"data": [
83,
97,
109,
112,
108,
101,
32,
102,
105,
108,
101,
32,
99,
111,
110,
116,
101,
110,
116,
115
]
},
"contentType": "text/plain"
}

List Directory

List files and directories in a directory on an SFTP server. Optionally list files in subdirectories. | key: listDirectory

InputNotesExample
Connection

The SFTP connection to use.

Include Directories

When true, lists directories in addition to files. When false, only lists files.

false
Include Subdirectories

When true, recursively monitors files in all subdirectories. When false, only monitors files in the specified directory.

false
Path

The path of the directory on the SFTP server to list files from.

/path/to/directory/
Pattern

The glob-style pattern for filtering files (e.g., *.txt).

*.txt

{
"data": [
"folder1/file.txt",
"folder1/subfolder/example.txt",
"root.txt"
]
}

Move File

Move a file on an SFTP server | key: moveFile

InputNotesExample
Connection

The SFTP connection to use.

Destination Path

Path of file to move

/my/destination/path.txt
Source Path

Path of file to move

/my/starting/path.txt

{
"data": null
}

Read File

Read a file from SFTP | key: readFile

InputNotesExample
Connection

The SFTP connection to use.

Path

Path of file on SFTP server to read data from

/path/to/file.txt
Return Buffer

When true, treats the file as a binary file with content type 'application/octet-stream', even if it is a text file. This is helpful if you are processing non-UTF-8 text files, as the runner assumes text files are UTF-8.

false

{
"data": "Sample file contents",
"contentType": "text/plain"
}

Stat File

Pull statistics about a file | key: statFile

InputNotesExample
Connection

The SFTP connection to use.

Path

Path of file on SFTP server to read data from

/path/to/file.txt

{
"data": {
"mode": 33279,
"uid": 1000,
"gid": 985,
"size": 5,
"accessTime": 1566868566000,
"modifyTime": 1566868566000,
"isDirectory": false,
"isFile": true,
"isBlockDevice": false,
"isCharacterDevice": false,
"isSymbolicLink": false,
"isFIFO": false,
"isSocket": false
}
}

Write File

Write a file to SFTP | key: writeFile

InputNotesExample
Connection

The SFTP connection to use.

Data

The text or data to write into the file.

Path

The path to the file on the SFTP server.

/we/love/commas.csv

{
"data": "Uploaded data stream to /upload/path/to/file.txt"
}

Changelog

2026-02-24

  • Added New or Modified Files polling trigger that detects new and modified files in a directory on a configured schedule