Back to Blog

Try n8n free for 10 days — no charge until day 11 on select plans

Or skip the trial and start from $4/mo today

n8nFTP/SFTPintegrationautomationfiles

n8n + FTP/SFTP Integration: 5 Powerful Workflows You Can Build

n8nautomation TeamNovember 11, 2026

Automating file transfers between legacy infrastructure and modern cloud systems remains a key operational challenge for scaling businesses. While modern SaaS platforms rely on JSON APIs, enterprise financial tools, suppliers, and backup systems still mandate the use of FTP/SFTP servers. Coupling your FTP/SFTP file pipelines with n8n transforms these dated file-sharing methods into highly reactive event-driven systems. Instead of checking a server manually, you can build workflows that monitor directories, extract nested files, write to modern databases, and trigger Slack notifications. By hosting your instances on a managed dedicated platform like n8nautomation.cloud, you eliminate server management constraints while running high-frequency file tasks.

How to Connect FTP/SFTP to n8n

To build file transfer workflows, you first need to establish a secure connection between your file storage server and your n8n workflows. This requires three distinct steps to configure and verify the connection:

  1. Retrieve the connection details from your file storage provider, including the host domain or IP address, the port number, your login credentials, or a private SSH key file.
  2. Create a new credential inside your n8n dashboard under the Credentials tab, selecting either 'FTP' or 'SFTP' based on your server's technical configuration.
  3. Add an FTP node to your workflow canvas, select your newly created credential, and configure the target folder path to test the active connection.

Selecting the Connection Protocol

Choosing the correct protocol is essential for security and connection stability. Plain FTP transmits passwords and file data in cleartext, making it unsuitable for sensitive business transactions. SFTP (SSH File Transfer Protocol) runs over an encrypted SSH channel, which is the standard choice for modern cloud integrations. Ensure your firewalls allow outgoing traffic on port 22 for SFTP, or port 21 for traditional FTP configurations.

Configuring the Credentials

When setting up your credentials inside the n8n interface, you can select between password-based authentication or private key authentication. Private keys provide a higher layer of security. If you are using an SSH private key, copy the complete block of text including the header and footer lines. The FTP node will parse this key to establish the encrypted handshake with your target server. For traditional FTP, password fields are standard, but ensure any special characters are not URL-encoded as the node handles the raw string directly.

Testing the Connection and Fetching File Lists

Once your credentials are saved, drag the FTP node into your workflow. Change the default action from 'Download' to 'List'. Input a directory path, such as '/incoming/' or './backups/', and execute the node. If successful, n8n returns an array of JSON objects containing metadata for each file in the target directory, including name, size, type, and modification date. If you receive a connection error, it typically points to firewall restrictions or key formatting mismatches.

Tip: If you run into "No SFTP connection available" errors, check that your server allows the public IP address of your n8n instance. When hosting with n8nautomation.cloud, you receive a dedicated instance with a reliable path to make troubleshooting firewall rules simple.

Workflow 1: Automated PDF Invoice Processing from SFTP to ERP

Receiving financial documents via external servers is common in accounts payable departments. Managing these files manually creates significant delays and data entry mistakes.

How It Works

The workflow begins with a Schedule Trigger node set to run once every business day. The first step uses an FTP node with the 'List' operation, targeting the raw invoice drop folder and filtering for files ending in '.pdf'. These file objects are passed to a Split In Batches node, which processes each file individually to prevent memory overloads. For each iteration, an FTP node executes the 'Download' action using the specific file path. The resulting binary file data is passed to a document extraction service like OpenAI with structured outputs or another document parsing service. The extracted JSON data containing the vendor name, invoice date, line items, and total amount is sent directly to your ERP or accounting platform. Once completed, another FTP node moves the processed PDF to an '/archive' directory on your server.

Real-World Example

A retail distribution center receives up to fifty raw PDF invoices every morning from different logistics providers. Instead of a financial specialist spending two hours extracting data and typing it into NetSuite, the n8n pipeline downloads each file, structures the billing information, drafts the invoice record inside NetSuite, and routes a Slack confirmation to the accounting team with a link to the draft for review.

Pro Tips

Always implement a mechanism to track processed files. You can write the unique file name and modification timestamp to a lightweight database like PostgreSQL before running the extraction step. Before downloading any file, query the database to verify if that specific file name was already processed, ensuring that accidental double-runs never result in duplicate bills being created.

Workflow 2: Inventory Sync from Supplier FTP to Shopify

E-commerce brands often dropship or rely on external warehouse suppliers who update their physical stock quantities via flat files on an external server.

How It Works

This workflow executes every hour using a Schedule Trigger node. The FTP node connects to the warehouse server to download the supplier’s inventory file, typically named 'inventory.csv' or 'stock.xml'. After fetching the file, a CSV Parser or XML node converts the raw file binary into standard JSON elements. A Code node matches the supplier’s SKU values with your Shopify SKU fields. Next, a Compare or Filter node isolates items where the stock level has changed compared to your active store inventory. Finally, the Shopify node updates the specific product variant quantities in bulk. This keeps your store stock aligned with real supply limits.

Real-World Example

An online fashion brand sells shoes sourced from a European supplier. The supplier updates their warehouse inventory every hour on a secure SFTP server. The n8n workflow retrieves the CSV, parses the 8,000 product rows, compares the current stock numbers, and updates the Shopify variant quantities. This prevents customers from placing orders for sold-out shoe sizes, lowering cancellation rates significantly.

Pro Tips

Parsing massive CSV lists with thousands of lines can exhaust your memory resources. To avoid crashing, use the Item Lists node to split the parsed JSON array into smaller chunks of 100 or 500 items, and process them sequentially. Running this on a dedicated resource environment like n8nautomation.cloud prevents performance drops during heavy parsing phases.

Workflow 3: Automated CSV Lead List Enrichment and CRM Import

Sales development representatives regularly purchase or export prospect sheets and store them in shared folders for processing and system upload.

How It Works

A Schedule Trigger runs every evening to scan a specific SFTP folder for fresh CSV uploads containing lead lists. An FTP node lists and downloads any new CSV files. The CSV data is converted to JSON objects, which are passed to an HTTP Request node that queries data enrichment tools like Apollo.io or Clearbit. The enrichment tool appends corporate details, accurate phone numbers, and LinkedIn URLs to each prospect's email. A second branch uses an IF node to check if the contact already exists in your CRM (like HubSpot or Salesforce). If the contact is new, a CRM node creates the record; if it exists, it updates the lead record with the enriched metadata.

Real-World Example

An enterprise SaaS marketing team drops event attendee spreadsheets into a shared SFTP directory. The automated n8n pipeline immediately grabs the sheet, runs the attendees through Clearbit to find their job titles and company sizes, categorizes them by target tier, and inserts them into Salesforce as qualified outbound leads. This allows SDRs to begin personalized outreach within hours of event completion.

Workflow 4: Automated FTP/SFTP to AWS S3 Sync in n8n

Local servers, security cameras, and telephone systems often save daily backup archives and log files to a local SFTP path with limited storage capacity.

How It Works

This pipeline runs on a daily interval. An FTP node scans the target directory and compiles a list of all backup files that are older than seven days. For each old backup file, the FTP node downloads the binary payload. Next, the AWS S3 node uploads this binary object to an archival S3 bucket configured with low-cost Glacier storage rules. Once the S3 upload returns a successful verification code, a final FTP node deletes the original file from the local SFTP server. This free-up action maintains clean storage boundaries on your local network.

Real-World Example

A medical billing office has an on-premise server generating database backups every night to a small SFTP storage machine. Because of strict HIPAA archiving laws, they must keep these records for seven years, but the local disk only holds thirty days of data. The n8n workflow automatically migrates backups older than a week to an AWS S3 bucket with strict access controls, deleting the local copies to prevent disk saturation.

Workflow 5: Exporting Database Reports to a Secure SFTP Server via n8n

External partners, marketing networks, and financial auditors often need access to your operational metrics, but lack direct access to your internal databases.

How It Works

A Schedule Trigger fires at the end of every week. A Postgres or MySQL node executes a read-only query to aggregate transactional data, active user counts, or shipping metrics. The resulting JSON dataset is passed to a CSV node, which formats the structured rows into a standard comma-separated text string and converts it to a binary file payload. An FTP node then logs into the external partner's SFTP server and uploads this binary data, naming the file dynamically with the current date using an expression.

Pro Tips

When constructing dynamic file names in n8n, use the internal date utility expressions inside the file path parameter. For instance, entering reports/weekly_summary_{{ $today.format('yyyy-MM-dd') }}.csv ensures that files are uploaded with a clean, chronological naming format that prevents overwriting previous uploads. Additionally, wrap your database queries in Try/Catch structures or configure error triggers to notify you in Slack if a database query fails, preventing empty files from being uploaded to your clients.

Why Use n8nautomation.cloud for FTP/SFTP Workflows?

Building file-based automations presents specific technical challenges that are difficult to manage on shared or DIY infrastructure. High-frequency polling, large CSV conversions, and binary downloads demand dedicated system resources and reliable up-time. Here is why hosting your workflows on n8nautomation.cloud is the best choice for your enterprise automation needs:

  • No Server Management: You get an active, dedicated instance ready to run in seconds without managing servers, configuring firewalls, or maintaining database backends.
  • Dedicated Resources for File Processing: Processing massive XML files or large PDF downloads can trigger out-of-memory errors on shared plans. Our instances start at just $4/month and provide dedicated environments to handle large payloads efficiently.
  • Advanced Logs for Debugging: Troubleshooting SFTP connections, key failures, or directory read permissions is simple with our dashboard’s built-in logs viewer, designed for advanced users who need to audit execution history.
  • Frictionless Domain Management: You get a custom subdomain like yourname.n8nautomation.cloud out of the box, and you can change the domain name at any point to match your branding.
  • Instant Migration: Moving your workflows from self-hosted setups is easy. Our migration tool takes your source URL and API key and transfers your workflows in seconds, preserving your layouts while keeping credentials secure.

By relying on a hosting partner that maintains 24/7 uptime and automated backups, your operational file exchanges run continuously in the background without manual oversight.

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.