SFTP
SFTP (ssh2) with a pinned host key and env-only, redacted credentials, list, stat and read remote files inside SFTP_ROOT, download to an allowed local directory, staged uploads that never overwrite unless a node asks, agent writes opt-in, deletes node only, timeouts
About
A Graphrt plugin for one SFTP server: list, stat and read remote files, download them to a local directory and upload local files, using the ssh2 package. The server's host key is pinned, credentials come only from the environment, remote paths stay inside SFTP_ROOT and local paths inside allowlisted directories.
What it can do
- list_directory: name, type, size, modified time and permission bits, sorted, limit with truncated.
- stat: one remote path.
- read_file: UTF-8 or base64, offset and max_bytes (never more than SFTP_MAX_READ_BYTES), truncated and next_offset.
- download: a remote file to a new file with a generated name (<name>-<timestamp>-<random>.<ext>) in SFTP_OUTPUT_DIR, size-capped, nothing local is overwritten.
- upload: a local file from SFTP_INPUT_DIRS to a remote path, create_parents makes missing remote directories. overwrite: true (workflow nodes only) replaces an existing regular file.
- make_directory, and delete_path (workflow nodes only: one file, symlink or empty directory).
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- List a remote directory
sftp.list_directory - Stat a remote path
sftp.stat - Read a remote file
sftp.read_file - Download a file
sftp.download - Upload a file
sftp.upload - Make a remote directory
sftp.make_directory - Delete a remote file or empty directory
sftp.delete_path
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
SFTP_HOST(required), 22The server -
SFTP_USERNAME(required)Login name -
SFTP_PASSWORDPassword authentication -
SFTP_PRIVATE_KEYPrivate key as text, or the path of a key file, SFTP_PRIVATE_KEY_PASSPHRASE if it is encrypted -
SFTP_HOST_FINGERPRINT(required)The server's host key, SHA256:... as ssh-keygen -l prints it, comma-separated for a key rotation -
SFTP_ROOT(required)Absolute directory on the server that every remote path stays inside -
SFTP_INPUT_DIRSComma-separated local directories that uploads may read from -
SFTP_OUTPUT_DIRExisting local directory that downloads are written to -
SFTP_MAX_INPUT_BYTES1 GiBLargest upload / download -
SFTP_MAX_READ_BYTES1 MiBMost bytes one read_file returns -
SFTP_TOOL_ALLOW_WRITES(off)1 lets agents call upload (new files only) and make_directory -
SFTP_CONNECT_TIMEOUT_MS15000Handshake time limit -
SFTP_OPERATION_TIMEOUT_MS600000Whole-call time limit (connect + work), the connection is closed when it passes -
SFTP_PORT -
SFTP_PRIVATE_KEY_PATH -
SFTP_PRIVATE_KEY_PASSPHRASE -
SFTP_MAX_OUTPUT_BYTES
How to use it
In Graphrt Desktop
- Open Plugins and search for SFTP.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
$ graphrt plugin install sftp - id: sftp type: sftp.list_directory