FTP / SFTP Integration in FlowMattic
Connect your FTP, FTPS, or SFTP server to FlowMattic to upload, download, manage, and monitor files on remote servers — all from within your automated workflows.
Overview
The FTP/SFTP application enables file management operations on remote servers as part of your workflow automation. It supports three protocols:
| Protocol | Port | Security | Description |
|---|---|---|---|
| FTP | 21 | None | Standard File Transfer Protocol |
| FTPS | 21 | SSL/TLS | FTP over SSL/TLS encryption |
| SFTP | 22 | SSH | SSH File Transfer Protocol (most secure) |
Connection Setup
Step 1: Add a New Connection
- Go to FlowMattic > Connects in your WordPress dashboard.
- Click Add New Connection.
- Search for FTP and select FTP / SFTP.
Step 2: Configure Connection Settings
Fill in the connection fields based on your server’s protocol:
| Field | Required | Description |
|---|---|---|
| Protocol | Yes | Select FTP, FTPS, or SFTP. |
| Host | Yes | Server hostname or IP address (e.g., ftp.example.com). |
| Port | No | Defaults to 21 for FTP/FTPS, 22 for SFTP. Leave empty to use defaults. |
| Username | Yes | Login username for the server. |
| Password | Yes | Login password (or key passphrase for SFTP with SSH key). |
| Private Key | No | SSH private key content (SFTP only). Leave empty for password authentication. |
| Passive Mode | No | Recommended: Yes. Applies to FTP/FTPS only. Not relevant for SFTP. |
Connection Examples
Standard FTP:
- Protocol: FTP
- Host:
ftp.example.com - Port: (leave empty for default 21)
- Username:
ftpuser - Password:
yourpassword - Passive Mode: Yes
SFTP with Password:
- Protocol: SFTP
- Host:
sftp.example.com - Port: (leave empty for default 22)
- Username:
sftpuser - Password:
yourpassword
SFTP with SSH Key:
- Protocol: SFTP
- Host:
sftp.example.com - Port: (leave empty for default 22)
- Username:
ubuntu - Password: (key passphrase, if your key is encrypted)
- Private Key: (paste your private key content)
FTPS (Secure FTP):
- Protocol: FTPS
- Host:
secure-ftp.example.com - Port: (leave empty for default 21)
- Username:
secureuser - Password:
securepassword - Passive Mode: Yes
Step 3: Test and Save
Click Test Connection & Save to verify the connection. FlowMattic will validate:
- Server connectivity on the specified host and port.
- Username and password credentials.
- Required PHP extensions are installed.
Note: Your server must have the required PHP extensions installed:
- FTP/FTPS: PHP
ftpextension (usually built-in)- FTPS: PHP
opensslextension- SFTP: PHP
ssh2extension
Triggers
The FTP/SFTP app includes two polling-based triggers that monitor folders for changes.
New File in a Folder
Triggers when a new file is added to a monitored folder on the FTP/SFTP server.
Configuration:
| Field | Required | Description |
|---|---|---|
| Folder Path | Yes | Full path of the folder to monitor (e.g., /uploads). Defaults to / (root). |
Trigger Output Data:
| Field | Description |
|---|---|
file_name |
Name of the newly detected file |
file_path |
Full path of the file on the server |
file_size |
Size of the file in bytes |
modified_time |
Last modification timestamp |
folder_path |
The monitored folder path |
trigger_event |
new_file |
total_files |
Total number of files in the folder |
File Modified in a Folder
Triggers when an existing file in the monitored folder is modified (size or timestamp changes).
Configuration:
| Field | Required | Description |
|---|---|---|
| Folder Path | Yes | Full path of the folder to monitor (e.g., /uploads). Defaults to / (root). |
Trigger Output Data:
| Field | Description |
|---|---|
file_name |
Name of the modified file |
file_path |
Full path of the file |
file_size |
Current file size in bytes |
previous_size |
Previous file size before modification |
modified_time |
Current modification timestamp |
previous_modified |
Previous modification timestamp |
folder_path |
The monitored folder path |
trigger_event |
file_modified |
How Polling Works
- Initial capture: FlowMattic creates a baseline snapshot of all files in the monitored folder.
- Subsequent polls: On each check, FlowMattic compares the current file state against the baseline.
- Detection: New files or modified files (changed size/timestamp) trigger the workflow.
- Baseline update: After a trigger fires, the baseline is updated to reflect the current state.
Note: Only files are monitored — directories are skipped. Polling frequency depends on your WordPress cron schedule.
Actions
The FTP/SFTP app provides 8 file management actions.
Upload a File
Upload a file to the remote FTP/SFTP server from a URL or a local server path.
Configuration:
| Field | Required | Description |
|---|---|---|
| FTP Connect | Yes | Select your FTP/SFTP connection. |
| Source URL | No | URL of a file to download and upload (e.g., https://example.com/file.pdf). |
| Source File Path (Server) | No | Local file path on your WordPress server (e.g., wp-content/uploads/2024/01/file.pdf). |
| Remote File Path | Yes | Destination path on the FTP server (e.g., /uploads/file.pdf). |
Note: Provide either a Source URL or a Source File Path — not both. Parent directories on the remote server are created automatically if they don’t exist.
Output:
| Field | Description |
|---|---|
status |
success or error |
message |
Result message |
remote_path |
Full path of the uploaded file on the server |
Download a File
Download a file from the remote FTP/SFTP server to your WordPress site.
Configuration:
| Field | Required | Description |
|---|---|---|
| FTP Connect | Yes | Select your FTP/SFTP connection. |
| Remote File Path | Yes | Full path of the file on the FTP server (e.g., /reports/monthly.csv). |
| Local Save Path | No | Where to save the file locally. Leave empty to save to WordPress uploads folder. |
Output:
| Field | Description |
|---|---|
status |
success or error |
message |
Result message |
local_path |
Full path where the file was saved |
file_url |
URL of the downloaded file (if saved to uploads) |
attachment_id |
WordPress Media Library attachment ID |
file_size |
Size of the downloaded file in bytes |
remote_path |
Original FTP path |
Tip: When saved to the WordPress uploads folder, the file is automatically registered in the Media Library with proper MIME type detection.
Delete a File or Folder
Delete a file or an empty folder on the remote server.
Configuration:
| Field | Required | Description |
|---|---|---|
| FTP Connect | Yes | Select your FTP/SFTP connection. |
| Remote Path | Yes | Full path of the file or folder to delete. |
| Is it a folder? | Yes | Select Yes for folders, No for files. |
Output:
| Field | Description |
|---|---|
status |
success or error |
message |
Result message |
path |
The deleted path |
Important: Folders must be empty before they can be deleted. Delete all files inside the folder first.
List Folder Content
List all files and folders inside a directory on the remote server.
Configuration:
| Field | Required | Description |
|---|---|---|
| FTP Connect | Yes | Select your FTP/SFTP connection. |
| Folder Path | No | Path of the folder to list. Defaults to / (root). |
Output:
| Field | Description |
|---|---|
status |
success |
path |
The folder path listed |
item_count |
Number of items in the folder |
items |
Array of items (see below) |
Each item in the items array contains:
| Field | Description |
|---|---|
name |
File or folder name |
path |
Full path |
type |
file or directory |
size |
Size in bytes |
modified |
Last modification timestamp |
permissions |
File permissions |
Rename / Move a File or Folder
Rename a file or folder, or move it to a different directory.
Configuration:
| Field | Required | Description |
|---|---|---|
| FTP Connect | Yes | Select your FTP/SFTP connection. |
| Current Path | Yes | Full path of the current file/folder. |
| New Path | Yes | New path/name. Use a different directory to move. |
Output:
| Field | Description |
|---|---|
status |
success or error |
message |
Result message |
old_path |
Original path |
new_path |
New path |
Examples:
- Rename:
/uploads/old-name.pdf→/uploads/new-name.pdf - Move:
/uploads/file.pdf→/archive/file.pdf - Move and Rename:
/uploads/report.csv→/archive/2024-report.csv
Create a Folder
Create a new folder on the remote server.
Configuration:
| Field | Required | Description |
|---|---|---|
| FTP Connect | Yes | Select your FTP/SFTP connection. |
| Folder Path | Yes | Full path for the new folder (e.g., /uploads/new-folder). |
Output:
| Field | Description |
|---|---|
status |
success or error |
message |
Result message |
path |
The created folder path |
Note: SFTP supports recursive folder creation (parent directories are created automatically). For FTP, parent directories must already exist.
Check if File Exists
Check whether a file or folder exists on the remote server.
Configuration:
| Field | Required | Description |
|---|---|---|
| FTP Connect | Yes | Select your FTP/SFTP connection. |
| Remote Path | Yes | Full path of the file or folder to check. |
Output:
| Field | Description |
|---|---|
status |
success |
exists |
true or false |
type |
file, directory, or unknown |
path |
The checked path |
Use Case: Use with a Branch step to conditionally upload, download, or delete files based on whether they exist.
Get File Info
Retrieve detailed information about a file on the remote server.
Configuration:
| Field | Required | Description |
|---|---|---|
| FTP Connect | Yes | Select your FTP/SFTP connection. |
| Remote File Path | Yes | Full path of the file. |
Output:
| Field | Description |
|---|---|
status |
success or error |
path |
Full file path |
name |
File name |
size |
File size in bytes |
type |
file or directory |
modified |
Last modification timestamp |
accessed |
Last access timestamp (SFTP only) |
permissions |
File permissions |
Workflow Examples
Example 1: Auto-Process Uploaded Files
Automatically download and process new files uploaded to an FTP folder.
- Trigger: New File in a Folder — Monitor
/incomingon the FTP server. - FTP > Download File — Download
{Trigger1.file_path}to WordPress. - Email — Send notification with the download URL.
Example 2: Backup WordPress Exports
Upload WordPress export files to a remote SFTP server for backup.
- Schedule Trigger — Run daily.
- HTTP Request — Call WordPress export endpoint.
- FTP > Upload File — Upload the export file to
/backups/on the SFTP server. - Slack — Notify the team that backup is complete.
Example 3: File Sync Between Servers
Move files from one folder to another after processing.
- Trigger: New File in a Folder — Monitor
/to-process. - FTP > Download File — Download the file.
- (Process the file with other workflow steps)
- FTP > Rename / Move — Move from
/to-process/file.csvto/processed/file.csv.
Example 4: Conditional File Management
Check if a file exists before uploading, to avoid duplicates.
- Webhook Trigger — Receive file upload request.
- FTP > Check File Exists — Check if
/uploads/{Trigger1.filename}exists. - Branch — If
{FTP1.exists}istrue, skip upload. Otherwise, continue. - FTP > Upload File — Upload the file.
Troubleshooting
Connection Issues
“Connection failed”
- Verify the host, port, and protocol are correct.
- Ensure your server firewall allows connections on the specified port.
- For FTP/FTPS, try enabling Passive Mode.
“Login failed”
- Double-check the username and password.
- For SFTP with SSH key, ensure the private key content is pasted correctly.
“PHP extension not installed”
- FTP/FTPS requires the PHP
ftpextension. - FTPS additionally requires the PHP
opensslextension. - SFTP requires the PHP
ssh2extension. - Contact your hosting provider to enable the required extension.
Action Errors
“Folder not empty” when deleting
- You must delete all files inside a folder before deleting the folder itself.
- Use List Folder Content to see what’s inside, then delete files first.
“File not found” on download
- Verify the remote file path is correct and the file exists.
- Use Check File Exists to verify before downloading.
Upload fails with no error
- Check that the remote directory exists or that auto-creation is working.
- Verify the FTP user has write permissions to the target directory.
SFTP Authentication
SSH key authentication fails:
- Ensure the private key is in the correct format (OpenSSH or PEM).
- If the key has a passphrase, enter it in the Password field.
- FlowMattic will automatically fall back to password authentication if key-based auth fails.
Summary
| Feature | Details |
|---|---|
| Supported Protocols | FTP, FTPS (SSL/TLS), SFTP (SSH) |
| Connection | Host, port, username, password, SSH key |
| Triggers | 2 (New File, File Modified) |
| Actions | 8 (Upload, Download, Delete, List, Rename/Move, Create Folder, Check Exists, Get Info) |
| Trigger Type | Polling-based (cron-dependent) |
| Media Library Integration | Downloaded files auto-registered in WordPress Media Library |
| Auto Directory Creation | Yes (upload and SFTP folder creation) |
| Authentication | Password, SSH key (with passphrase), or both |