Skip to content

SFTP Close

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

Closes an SFTP session and releases the connection. Needed when you open the session with SFTP Connect without body.

Disconnects from the server and releases the given session. After this, the session can no longer be used: activities that receive it will fail. Do not use it inside the SFTP Connect body: there the connection already closes by itself on exit, and closing it earlier makes that final close fail.

None.

ParameterTypeDefaultDescription
sessionZoanSftpSession—The session returned by SFTP Connect. If omitted, the inherited session is used, if any.

This activity does not return a value.

MessageCause and fix
'session' must be a ZoanSftpSession.No valid session was passed and none is inherited. Pass the variable returned by SFTP Connect (session = sftp).

Guarantee the close even if the upload fails:

SFTP Connect host = "sftp.vendor.com" username = "zoan" password = credential("sftp-vendor")["password"] → output: sftp
Try / Catch errorVariable = error
├─ try:
│ SFTP Upload session = sftp localPath = file remotePath = "/inbound/data.csv"
├─ catch:
│ Log level = error message = "Upload failed: " + error.Message
└─ finally:
SFTP Close session = sftp