SFTP v2
The SFTP Node reads, writes, copies, moves, deletes, inspects, and lists files on a remote server through SSH.
Revision History
0.0.0.1 - Initial release.
0.0.0.3 - Project restructure.
0.0.0.5 - SupportedCluster update.
0.0.0.10 - Node name correction.
0.0.0.22 - Published the file-operation contract.
0.0.0.23 - Updated the Node icon.
0.0.0.26 - Added certificate-based SSH authentication.
0.1.0.0 - Added SSH private-key file authentication.
0.1.1.0 - Added List method.
0.1.1.1 - Fixed template methods.
0.1.1.8 - Added Rename, CreateDirectory and ListDirectory methods, folder support for Copy, Move and Delete, and the IgnoreMissing option for Delete. Renamed the Overwrite Existing parameter to OverwriteExisting.
Connection
The Connection stores the remote server address, timeout, and credentials used for SFTP access.
| Property | Type | Description |
|---|---|---|
Host |
String | Host name or IP address of the remote server. |
Port |
Integer | Port to connect to. The default is 22. |
Timeout (seconds) |
Integer | Time to wait for the server before timing out. |
Username |
String | Username used to authenticate with the server. |
Password |
Masked | Account password, or the passphrase for an encrypted value in Client Private Key File Contents. |
Client Private Key File Contents |
Masked | SSH private-key file contents used for public-key authentication. |
Certificate |
Certificate | X.509 certificate containing an RSA or ECDSA private key used for SSH public-key authentication. |
Setup Notes
Make sure the remote SFTP account can access the folders and files that the Workflow needs to use.
Choose one authentication configuration:
- Enter
Passwordfor password authentication. - Enter the private-key text in
Client Private Key File Contents. For an encrypted key, enter its passphrase inPassword. - Select a
Certificatecontaining an RSA or ECDSA private key. You can also enterPasswordwhen the server requires password authentication in addition to the certificate key.
Do not configure both Client Private Key File Contents and Certificate on the same Connection.
Remote paths are normalized to use forward slashes, so provide the server path exactly as the remote system expects it.
Methods
The SFTP Node exposes file and folder operations, filtered file listings, and directory browsing against one remote SFTP server.
Read
Reads a file from the remote server and returns its content as a stream.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | SFTP Connection profile. |
Path |
String | Path of the remote file to read. |
| Return | Type | Description |
|---|---|---|
Content |
Stream | Stream containing the remote file content. |
Write
Writes content to a file on the remote server and can replace an existing file when requested.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | SFTP Connection profile. |
Path |
String | Path of the remote file to write. |
Content |
Stream | Content stream to upload. |
OverwriteExisting |
Boolean | When true, an existing remote file is replaced. When false, the method fails if the file already exists. The default is true. |
| Return | Type | Description |
|---|---|---|
None |
None | This method does not emit output values. |
Copy
Copies a file or folder tree into a destination folder on the same remote server, preserving its name. With OverwriteExisting enabled, matching folders merge and matching files are replaced.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | SFTP Connection profile. |
Path |
String | Path of the remote file or folder to copy. |
Destination |
String | Destination folder on the remote server. |
OverwriteExisting |
Boolean | When true, an existing destination file is replaced. The default is true. |
| Return | Type | Description |
|---|---|---|
None |
None | This method does not emit output values. |
Move
Moves a file or folder tree into a destination folder on the same remote server, preserving its name. With OverwriteExisting enabled, matching folders merge and matching files are replaced.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | SFTP Connection profile. |
Path |
String | Path of the remote file or folder to move. |
Destination |
String | Destination folder on the remote server. |
OverwriteExisting |
Boolean | When true, an existing destination file is replaced. The default is true. |
| Return | Type | Description |
|---|---|---|
None |
None | This method does not emit output values. |
Rename
Renames a file or folder on the remote server within its current parent folder. The method fails if an entry with the new name already exists; existing entries are never replaced.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | SFTP Connection profile. |
Path |
String | Path of the remote file or folder to rename. |
NewName |
String | New name for the entry. Supply a single name without a folder path, separators, . or ... |
| Return | Type | Description |
|---|---|---|
None |
None | This method does not emit output values. |
Delete
Deletes a file, or a folder and all of its contents, from the remote server. Links are removed without deleting their targets.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | SFTP Connection profile. |
Path |
String | Path of the remote file or folder to delete. |
IgnoreMissing |
Boolean | When true, a missing path succeeds without change. When false, a missing path fails. Other errors always fail. The default is false. |
| Return | Type | Description |
|---|---|---|
None |
None | This method does not emit output values. |
CreateDirectory
Creates a folder on the remote server and any missing parent folders. An existing folder is left unchanged, but the method fails if a file exists at the path.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | SFTP Connection profile. |
Path |
String | Path of the remote folder to create. |
| Return | Type | Description |
|---|---|---|
None |
None | This method does not emit output values. |
Info
Retrieves metadata for a file stored on the remote server.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | SFTP Connection profile. |
Path |
String | Path of the remote file to inspect. |
| Return | Type | Description |
|---|---|---|
Metadata |
Object | Metadata for the selected remote file or folder. |
List
Lists files in a remote directory using a wildcard filter and bounded subdirectory traversal.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | SFTP Connection profile. |
DirectoryPath |
String | Path of the remote directory containing the files to list. |
Filter |
String | Wildcard expression matched against file names. The default is *. |
FolderDepthLimit |
Integer | Maximum number of subdirectory levels to traverse, from 0 to 50. Set 0 to list only the supplied directory. |
ReturnFullPath |
Boolean | When true, each item contains the full path. When false, each item contains only the file name. The default is true. |
| Return | Type | Description |
|---|---|---|
Files |
Array | Matching files sorted by path. Each item includes FilePath, the one-based CurrentRow, and TotalRows. |
The Node captures the complete listing before returning the output stream, so path, permission, and provider failures surface before downstream enumeration begins. No matches return zero rows. Only files are returned; duplicate full paths are removed before row numbers are assigned. Later file changes are not reflected in the snapshot.
ListDirectory
Lists the immediate files, folders and links in a remote folder, with their available metadata. Unlike List, this method includes folders and links, and does not traverse subfolders.
| Parameter | Type | Description |
|---|---|---|
Connection |
Connection | SFTP Connection profile. |
DirectoryPath |
String | Path of the remote folder whose immediate children should be returned. |
| Return | Type | Description |
|---|---|---|
Response |
Array | Entries sorted by full path. Each item includes Name, FullPath, ObjectType (File, Directory, Link or Unknown), SizeInBytes (null for folders, links and unavailable sizes), and LastWriteTime (null when unavailable). |
LastWriteTime is reported in UTC. Hidden entries are included when the server exposes them, and folder links are identified without traversing their targets. A missing path, or a path to a file, fails the method.
Usage Notes
Use remote paths that are valid on the SFTP server. The Write, Copy, and Move methods create missing remote destination folders.
Copy and Move operate within the same remote server exposed by the Connection, so use separate steps if you need to transfer files between different servers.
When Copy or Move receives a folder, the folder is placed inside Destination with its nested folders, empty folders, hidden files and file contents. For example, copying /in/reports to /archive produces /archive/reports. With OverwriteExisting disabled, an existing destination entry fails before anything is written. A conflict between a file and a folder of the same name always fails. The source and destination must not overlap, and folder transfers reject symbolic links and special entries. Permissions, ownership and timestamps are not copied.
A folder Move copies all contents before removing the source, so it is not an atomic rename. A failure during the copy leaves the source intact but can leave partial content at the destination. Avoid changing the source or destination while a folder transfer is running.
Rename and Delete require a path that names an entry, not the server root or a . or .. segment. Delete fails when the path does not exist unless IgnoreMissing is enabled.
The List method captures a snapshot before it returns the matching files. Use Filter and FolderDepthLimit to limit the listing.