
SALESFORCE FILE INTEGRATION VIA AWS AND SFTP
THE CHALLENGE
Our client needed to export files from Salesforce and upload them to an SFTP server in order to share data with a third-party company. However, because Salesforce does not natively support direct SFTP connections, this process was being done manually—adding unnecessary time, effort, and risk of human error. The client required a solution that could fully automate the file transfer process while remaining secure and reliable.
TECHNOLOGIES & SERVICES
Salesforce
* Scheduled Job - used for scheduling
* Apex (Scheduler & Batch classes)
* Custom Settings - store configuration for different file export types
* Named Credential - contains credentials to access AWS S3
AWS
* S3 Bucket - storage location where files from Salesforce are uploaded to
* Lambda Function - code to retrieve files from S3 Bucket and upload to SFTP Server folder
* pysftp python module for SFTP interface * IAM Role - controls access
* Secrets Manager - stores credentials to SFTP server
OUR SOLUTION
We built an automated process to transfer files from Salesforce to an SFTP server using AWS as an intermediary platform. Custom Apex code was developed to query records, generate CSV files, and upload them to an AWS S3 bucket via REST API. An S3 event trigger then executed a Lambda function, which retrieved the file and uploaded it to the SFTP server using a secure connection.
We used Salesforce Custom Settings to allow admins to control job frequency without code changes, making the solution flexible and reducing reliance on developers. This eliminated manual work and provided a scalable, low-maintenance integration.