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.

Destinations are defined in intu.yaml as a map from name to config. Add a File destination and reference it by name in your channel’s destinations list:

intu.yaml
destinations:
archive:
type: file
file:
scheme: local
directory: "/data/outbound/hl7"
filename_pattern: "{{channelId}}_{{messageId}}_{{timestamp}}.hl7"

In channel.yaml, reference by name:

destinations:
- archive
PropertyTypeDefaultDescription
schemestringlocalStorage scheme. Currently only local is supported.
directorystring(required)Target directory. Created automatically if it does not exist.
filename_patternstringTemplate for the output filename. Supports the variables listed below.
VariableDescriptionExample Value
{{messageId}}Unique message identifiera1b2c3d4-e5f6-7890
{{timestamp}}Message or write timestamp20260316160906
{{channelId}}ID of the channel processing the messagepatient-sync
{{correlationId}}Correlation ID when present

Combine variables to build descriptive filenames:

filename_pattern: "{{channelId}}_{{messageId}}.hl7"
# → patient-sync_a1b2c3d4-e5f6-7890.hl7

A File destination for daily archiving, referenced by channels:

intu.yaml
destinations:
daily-archive:
type: file
file:
scheme: local
directory: "/data/archive/adt"
filename_pattern: "adt_{{channelId}}_{{timestamp}}.hl7"