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.
Configuration
Section titled “Configuration”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:
destinations: archive: type: file file: scheme: local directory: "/data/outbound/hl7" filename_pattern: "{{channelId}}_{{messageId}}_{{timestamp}}.hl7"In channel.yaml, reference by name:
destinations: - archiveProperties
Section titled “Properties”| Property | Type | Default | Description |
|---|---|---|---|
scheme | string | local | Storage scheme. Currently only local is supported. |
directory | string | (required) | Target directory. Created automatically if it does not exist. |
filename_pattern | string | — | Template for the output filename. Supports the variables listed below. |
Filename Pattern Variables
Section titled “Filename Pattern Variables”| Variable | Description | Example Value |
|---|---|---|
{{messageId}} | Unique message identifier | a1b2c3d4-e5f6-7890 |
{{timestamp}} | Message or write timestamp | 20260316160906 |
{{channelId}} | ID of the channel processing the message | patient-sync |
{{correlationId}} | Correlation ID when present | — |
Combine variables to build descriptive filenames:
filename_pattern: "{{channelId}}_{{messageId}}.hl7"# → patient-sync_a1b2c3d4-e5f6-7890.hl7Complete Example
Section titled “Complete Example”A File destination for daily archiving, referenced by channels:
destinations: daily-archive: type: file file: scheme: local directory: "/data/archive/adt" filename_pattern: "adt_{{channelId}}_{{timestamp}}.hl7"