If you're automating file transfersâpulling reports from a legacy server, pushing exports to a client's SFTP drop zone, or syncing files between systemsân8n's FTP node handles it without writing a single line of bash.
This guide covers everything: credentials, operations, error handling, and a free copy-paste workflow JSON.
What the FTP Node Does
The FTP node in n8n supports both FTP and SFTP protocols. You can:
- Download a file from a remote server
- Upload a file to a remote server
- List directory contents
- Delete a file
- Rename a file or move it between directories
- Create a directory
SFTP (SSH File Transfer Protocol) is the secure versionâalways prefer it over plain FTP when the server supports it.
Setting Up Credentials
FTP Credentials
- In n8n, go to Credentials â New â FTP
- Fill in:
- Host: your server hostname or IP
- Port: 21 (FTP default) or 22 (SFTP default)
- Username and Password
- Toggle SFTP on if your server uses SSH-based file transfer
SFTP with Private Key (more secure)
If your server uses SSH key auth instead of a password:
- Select Private Key as the authentication type
- Paste your private key (PEM format)
- Add the Passphrase if your key is encrypted
Tip: Test the connection with the Test button before wiring it into a workflowâFTP servers are picky about passive/active mode and firewall rules.
Core Operations
Download a File
Set Operation â Download, then specify:
-
Path:
/reports/daily-export.csv
The node outputs the file as binary data. Wire it into an HTTP Request node (to POST it somewhere), an Email node (as attachment), or a Write Binary File node to save it locally.
Schedule Trigger â FTP (Download) â Send Email (with attachment)
Upload a File
Set Operation â Upload, then:
-
Path:
/uploads/processed-data.csv - Connect binary data from a previous node (e.g., a Spreadsheet node or HTTP Request that returned a file)
HTTP Request (get CSV from API) â FTP (Upload to client server)
List Directory Contents
Returns an array of files and folders with metadata (name, size, modified date, type). Useful for discovering what files exist before downloading them.
FTP (List) â IF (filter by .csv extension) â FTP (Download each)
Delete / Rename / Move
- Delete: specify the full path to remove
- Rename: provide current path + new path (use this to "move" files too)
Practical Workflow: Download New Files, Process, Archive
Here's a pattern that's useful for scheduled file ingestion:
Schedule Trigger (every morning)
â FTP: List /incoming/
â IF: filename ends with .csv
â FTP: Download each file
â Spreadsheet File: parse CSV
â Google Sheets: append rows
â FTP: Rename file to /archive/filename.csv (mark as processed)
This avoids reprocessing the same file twice by moving it to an archive folder after reading it.
Error Handling
FTP connections fail silently in bad network conditions. Always add:
- Continue On Fail on the FTP node â catches connection errors
-
IF node checking
{{ $json.error }}â branches to a Slack/email alert - Retry on Fail: for transient network blips, set 2â3 retries with a delay
FTP (Download) [Continue On Fail]
â IF: error exists?
YES â Slack: FTP download failed
NO â next processing step
Common Gotchas
| Problem | Fix |
|---|---|
| Connection refused on port 21 | Try passive mode; check firewall allows outbound 21 and passive port range |
| SFTP key auth fails | Ensure key is PEM format, not OpenSSH format; convert with ssh-keygen -p -m PEM |
| File not found | Path is case-sensitive on Linux servers; double-check slashes and capitalization |
| Binary data is empty | The previous node must output binary, not JSON â check the node output panel |
| Timeout on large files | Increase the node timeout or split large transfers into chunks |
Free Workflow JSON
Here's a complete SFTP workflow that downloads a CSV report each morning and appends it to Google Sheets. Import it directly into your n8n instance.
{
"name": "SFTP Daily Report to Google Sheets",
"nodes": [
{
"parameters": {
"rule": { "interval": [{ "field": "hours", "hoursInterval": 24 }] }
},
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.1,
"position": [240, 300]
},
{
"parameters": {
"operation": "download",
"path": "/reports/daily-report.csv"
},
"name": "SFTP Download",
"type": "n8n-nodes-base.ftp",
"typeVersion": 1,
"position": [460, 300],
"credentials": { "ftp": { "id": "1", "name": "My SFTP Server" } }
},
{
"parameters": {
"operation": "fromFile",
"fileFormat": "csv",
"options": { "includeEmptyRows": false }
},
"name": "Parse CSV",
"type": "n8n-nodes-base.spreadsheetFile",
"typeVersion": 2,
"position": [680, 300]
},
{
"parameters": {
"operation": "appendOrUpdate",
"documentId": { "__rl": true, "value": "YOUR_SHEET_ID", "mode": "id" },
"sheetName": { "__rl": true, "value": "Sheet1", "mode": "name" },
"columns": { "mappingMode": "autoMapInputData", "value": {} }
},
"name": "Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.2,
"position": [900, 300]
}
],
"connections": {
"Schedule Trigger": { "main": [[{ "node": "SFTP Download", "type": "main", "index": 0 }]] },
"SFTP Download": { "main": [[{ "node": "Parse CSV", "type": "main", "index": 0 }]] },
"Parse CSV": { "main": [[{ "node": "Google Sheets", "type": "main", "index": 0 }]] }
}
}
Replace YOUR_SHEET_ID with your Google Sheets document ID (from the URL) and swap in your SFTP credential.
When to Use FTP vs. Other Transfer Methods
| Method | Best For |
|---|---|
| FTP/SFTP node | Legacy systems, dedicated file servers, client drop zones |
| HTTP Request node | REST APIs, modern file hosting (S3, Dropbox, Drive) |
| S3 node | AWS S3 and S3-compatible storage (R2, MinIO) |
| Google Drive node | Google Workspace file sharing |
If the remote system offers an API, use that instead of FTPâit is more reliable and easier to authenticate. Reserve FTP/SFTP for cases where no API exists.
Get the Full Starter Pack
This workflow is part of the n8n Workflow Starter Packâ15+ production-ready workflows covering scheduling, webhooks, email, databases, APIs, and file handling.
Grab the Starter Pack on Gumroad ($29)
Drop a comment if you are using SFTP with a specific systemâhappy to help debug connection issues.
Top comments (1)
Are you using the FTP/SFTP node for legacy server syncs, client file drops, or archiving? Drop your setup below â curious what people are still running over FTP. If you're running scripts on the same server afterward, just published a guide on the Execute Command node too if useful.