To automate a connection to SFTP with a private key in FME, the private key cannot have a passphrase. A system caller is needed to start the Putty Pageant.exe file and specify the private key.

System caller: start “” “C:\Program Files\PuTTY\pageant.exe” E:\Private_Key.ppk
The FTP caller parameters can be filled as shown below. In this example a test file is uploaded to a SAAS in folder.

URL- sftp://Domain.com:21/TESTFile.csv (remember the port number)
File – E:\data\TESTFile.csv
A second systemcaller is needed to stop the pageant process. If this isn’t included, the workbench won’t run after the initial run and a ‘log in failed’ error will appear in Flow.
System caller 2: taskkill /IM “pageant.exe” /F (to stop the pageant process)