Skip to content

File Destination

The File destination writes each processed message to the local filesystem. It supports filename templates with dynamic variables and configurable write modes, making it useful for archiving, audit trails, and batch file drops.

Add a File destination to a channel in intu.yaml:

destinations:
- name: archive
type: file
properties:
scheme: local
directory: "/data/outbound/hl7"
filename_pattern: "${messageId}.hl7"
PropertyTypeDefaultDescription
schemestringlocalStorage scheme. Currently only local is supported.
directorystring(required)Target directory. Created automatically if it does not exist.
filename_patternstring${messageId}.datTemplate for the output filename. Supports the variables listed below.
modestringoverwriteWrite mode: overwrite replaces existing files, append adds to the end.
file_permissionsstring0644Unix file permission bits applied to created files.
VariableDescriptionExample Value
${messageId}Unique message identifiera1b2c3d4-e5f6-7890
${timestamp}Unix timestamp in milliseconds1718472000000
${channelId}ID of the channel processing the messagepatient-sync
${date}Current date in YYYYMMDD format20260315
${time}Current time in HHmmss format143052

Combine variables to build descriptive filenames:

filename_pattern: "${channelId}_${date}_${time}_${messageId}.hl7"
# → patient-sync_20260315_143052_a1b2c3d4-e5f6-7890.hl7

A File destination that appends messages to a daily log file:

destinations:
- name: daily-archive
type: file
properties:
scheme: local
directory: "/data/archive/adt"
filename_pattern: "adt_${date}.log"
mode: append
file_permissions: "0640"