Skip to content

SFTP Delete

Type: sftp-delete  ·  Package: SFTP Activities v1.1.0

Deletes a file from the SFTP server. Useful to clean up files already processed, if the flow requires it.

Deletes the file at remotePath on the server, permanently (SFTP has no trash). It only deletes files: for a folder, the server rejects the operation. If the file does not exist, it fails.

ParameterTypeDefaultDescription
remotePathstring—Path of the remote file to delete.
ParameterTypeDefaultDescription
sessionZoanSftpSession—Session from SFTP Connect. Inherited inside a body.

This activity does not return a value.

MessageCause and fix
'remotePath' is required.The parameter is missing or the expression returned null.
'session' must be a ZoanSftpSession.The activity is outside the SFTP Connect body and received no session.
Server error: file not foundThe file no longer exists. If that is fine, check it first with SFTP Exists.
Server error: permission deniedThe user cannot delete in that folder, or the path is a folder.

Delete a temporary file only if it exists:

SFTP Exists remotePath = "/temp/batch.csv" → output: hasBatch
If condition = hasBatch
└─ then:
SFTP Delete remotePath = "/temp/batch.csv"