SFTP Activities
Version: 1.0.0 · ID: zoan-packages-sftp · Author: Zoan Software
The SFTP package transfers files securely with a remote server using the SFTP (SSH File Transfer Protocol) protocol. It is widely used in integrations between companies: upload files to a server (a batch of invoices for a supplier), download files left there (reports from a bank), or manage remote folders.
Concept 1: the session
Section titled “Concept 1: the session”All operations work on a session that you open with SFTP Connect and share with the other activities:
- With
body: activities inside inherit the session; When the connection ends it closes itself. - Without
body: you save the session in a variable and close it with SFTP Close.
SFTP Connect host = "sftp.proveedor.com" username = "zoan" password = = credential("sftp") └─ body: SFTP Upload localPath = = rutaLocal remotePath = "/entrada/factura.xml"Concept 2: authentication
Section titled “Concept 2: authentication”SFTP supports two ways to authenticate (choose one in SFTP Connect):
| Method | How |
|---|---|
| Password | Parameter password with a credential — = credential("sftp"). |
| Private key | Parameter privateKeyPath with the path to your key (.pem / OpenSSH), and privateKeyPassphrase if it is encrypted. |
Remote routes
Section titled “Remote routes”Server paths use / slashes and are usually absolute: /entrada/datos.csv, /salida/reportes/. Do not confuse them with the local routes (on your machine), which go in localPath.
Activities
Section titled “Activities”Session
Section titled “Session”| Activity | Type | Output | What it does |
|---|---|---|---|
| SFTP Connect | sftp-connect | ZoanSftpSession | Conecta al servidor SFTP |
| SFTP Close | sftp-close | — | Close the connection |
Transferir
Section titled “Transferir”| Activity | Type | Output | What it does |
|---|---|---|---|
| SFTP Upload | sftp-upload | — | Upload a local file to the server |
| SFTP Download | sftp-download | string | Download a file from the server |
Gestionar archivos y carpetas
Section titled “Gestionar archivos y carpetas”| Activity | Type | Output | What it does |
|---|---|---|---|
| SFTP List Directory | sftp-list | List | Lista archivos y carpetas remotas |
| SFTP Exists | sftp-exists | boolean | Is there a file/folder? |
| SFTP Move / Rename | sftp-move | — | Move or rename a remote file |
| SFTP Delete | sftp-delete | — | Delete a remote file |
| SFTP Create Directory | sftp-mkdir | — | Create a remote folder |
Next steps
Section titled “Next steps”- SFTP Connect — conectarse al servidor.
- SFTP Download / SFTP Upload — transferir archivos.
- Files — manage local files.