SFTP Delete
SFTP Delete
Section titled “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.
How it works
Section titled “How it works”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.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
remotePath | string | — | Path of the remote file to delete. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanSftpSession | — | Session from SFTP Connect. Inherited inside a body. |
Output
Section titled “Output”This activity does not return a value.
Common errors
Section titled “Common errors”| Message | Cause 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 found | The file no longer exists. If that is fine, check it first with SFTP Exists. |
| Server error: permission denied | The user cannot delete in that folder, or the path is a folder. |
Example
Section titled “Example”Delete a temporary file only if it exists:
SFTP Exists remotePath = "/temp/batch.csv" → output: hasBatchIf condition = hasBatch └─ then: SFTP Delete remotePath = "/temp/batch.csv"Related activities
Section titled “Related activities”- SFTP Move / Rename — archive instead of deleting.
- SFTP Exists — check first.