Skip to content

SFTP Destination

The SFTP destination uploads each processed message as a file to a remote SFTP server. It supports password and private-key authentication and writes to a temporary filename first to prevent downstream systems from reading partially uploaded files.

Add an SFTP destination to a channel in intu.yaml:

destinations:
- name: lab-drop
type: sftp
properties:
host: "sftp.lab.example.com"
port: 22
directory: "/inbound/hl7"
filename_pattern: "${messageId}.hl7"
PropertyTypeDefaultDescription
hoststring(required)Hostname or IP address of the SFTP server.
portinteger22SSH port number.
directorystring(required)Remote directory to upload files into.
filename_patternstring${messageId}.datTemplate for the remote filename. Supports the same variables as the File destination.
temp_prefixstring.tmp_Prefix added to the filename during upload. Once the transfer completes, the file is renamed to remove the prefix.
auth:
type: password
username: "${SFTP_USER}"
password: "${SFTP_PASS}"
auth:
type: private_key
username: "${SFTP_USER}"
key_file: "/etc/intu/keys/sftp_id_rsa"
passphrase: "${SFTP_KEY_PASSPHRASE}"

The passphrase field is optional — omit it if the key is unencrypted.

An SFTP destination that uploads HL7 files with private-key authentication:

destinations:
- name: lis-sftp-drop
type: sftp
properties:
host: "sftp.lab.hospital.org"
port: 22
directory: "/inbound/results"
filename_pattern: "ORU_${date}_${time}_${messageId}.hl7"
temp_prefix: ".tmp_"
auth:
type: private_key
username: "intu-service"
key_file: "/etc/intu/keys/lab_sftp_rsa"