SFTP (SSH File Transfer Protocol) is a secure file transfer protocol that runs over an SSH connection, letting you move and manage files on a remote server without exposing credentials or data in plaintext. It supports authentication via password or private key, making it a standard choice for secure file exchange with servers, hosting providers, and legacy systems.
With this block, you can:
- Upload files: Send files or direct text content to a directory on a remote server
- Download files: Retrieve a file from the remote server as text or base64-encoded content
- List directory contents: Browse files and folders, optionally with detailed metadata like size and permissions
- Delete files or directories: Remove remote files, with optional recursive deletion for directories
- Create directories: Make new directories on the remote server, optionally creating parent directories as needed
In Zoen, the SFTP block allows your agents to upload, download, list, delete, and create files and directories on a remote server, all authenticated with a password or private key. This enables workflows that move generated files to a remote destination, pull files from a server for processing, sync directory contents, or manage remote file structures as part of a larger automation.
Upload, download, list, and manage files on remote servers via SFTP. Supports both password and private key authentication for secure file transfers.
Upload files to a remote SFTP server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SFTP server hostname or IP address |
port | number | Yes | SFTP server port (default: 22) |
username | string | Yes | SFTP username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
remotePath | string | Yes | Destination directory on the remote server |
files | file[] | No | Files to upload |
fileContent | string | No | Direct file content to upload (for text files) |
fileName | string | No | File name when using direct content |
overwrite | boolean | No | Whether to overwrite existing files (default: true) |
permissions | string | No | File permissions (e.g., 0644) |
| Parameter | Type | Description |
|---|
success | boolean | Whether the upload was successful |
uploadedFiles | json | Array of uploaded file details (name, remotePath, size) |
message | string | Operation status message |
Download a file from a remote SFTP server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SFTP server hostname or IP address |
port | number | Yes | SFTP server port (default: 22) |
username | string | Yes | SFTP username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
remotePath | string | Yes | Path to the file on the remote server |
encoding | string | No | Output encoding: utf-8 for text, base64 for binary (default: utf-8) |
| Parameter | Type | Description |
|---|
success | boolean | Whether the download was successful |
file | file | Downloaded file stored in execution files |
fileName | string | Name of the downloaded file |
content | string | File content (text or base64 encoded) |
size | number | File size in bytes |
encoding | string | Content encoding (utf-8 or base64) |
message | string | Operation status message |
List files and directories on a remote SFTP server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SFTP server hostname or IP address |
port | number | Yes | SFTP server port (default: 22) |
username | string | Yes | SFTP username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
remotePath | string | Yes | Directory path on the remote server |
detailed | boolean | No | Include detailed file information (size, permissions, modified date) |
| Parameter | Type | Description |
|---|
success | boolean | Whether the operation was successful |
path | string | Directory path that was listed |
entries | json | Array of directory entries with name, type, size, permissions, modifiedAt |
count | number | Number of entries in the directory |
message | string | Operation status message |
Delete a file or directory on a remote SFTP server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SFTP server hostname or IP address |
port | number | Yes | SFTP server port (default: 22) |
username | string | Yes | SFTP username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
remotePath | string | Yes | Path to the file or directory to delete |
recursive | boolean | No | Delete directories recursively |
| Parameter | Type | Description |
|---|
success | boolean | Whether the deletion was successful |
deletedPath | string | Path that was deleted |
message | string | Operation status message |
Create a directory on a remote SFTP server
| Parameter | Type | Required | Description |
|---|
host | string | Yes | SFTP server hostname or IP address |
port | number | Yes | SFTP server port (default: 22) |
username | string | Yes | SFTP username |
password | string | No | Password for authentication (if not using private key) |
privateKey | string | No | Private key for authentication (OpenSSH format) |
passphrase | string | No | Passphrase for encrypted private key |
remotePath | string | Yes | Path for the new directory |
recursive | boolean | No | Create parent directories if they do not exist |
| Parameter | Type | Description |
|---|
success | boolean | Whether the directory was created successfully |
createdPath | string | Path of the created directory |
message | string | Operation status message |