Per-sender connections
Send each sender's messages through its own adapter profile from one workflow, with a default connection, a clear failure for unlisted senders, and the sender handed to workflows a step starts.
On this page
One workflow can serve every customer with their own credentials. A destination's send step keeps its connection (an adapter profile) as the default, and a small table picks a different connection for a sender. The engine chooses the connection for each message when it arrives, from the message's sending facility (MSH-4) and, if you give one, its sending application (MSH-3).
Set it up
- Open the workflow in the builder, on the Steps view, and select the destination.
- Under Send, choose the default connection in Adapter profile.
- Choose Different connection per sender. The Connection per sender table opens and says what a row does.
- Choose + Add sender. Enter the sender's Sender (MSH-4), optionally its Application (MSH-3), and choose its Connection. Choose + Add sender again for the next one.
- In Senders not listed, choose what a message from any other sender does.
- Choose Save, then deploy the workflow as usual.
Use one connection asks first, for example "Remove 2 senders?". Remove senders removes the table, and the step sends everything through its default connection again. Keep them leaves the table as it is.
The table offers connections of the same adapter as the default connection that can send. A row you have started, or left, says what it is missing before you save: "Enter the sender's MSH-4", "Choose a connection for the sender", or "Sender DH-NORTH is listed twice". If you change the default connection to another adapter, each row whose connection is now a different kind says so, for example "Drop box is a sftp connection; the default is generic-rest. Choose a generic-rest connection."
In the Graph view, a send step with a table says so on its node, for example "write · 2 senders, own connections". Edit the table in the Steps view.
Which connection a message gets
| Order | Connection |
|---|---|
| 1 | The row with the message's MSH-4 and MSH-3. |
| 2 | The row with the message's MSH-4 and no MSH-3. |
| 3 | Senders not listed: the default, or a failure. |
| Senders not listed | A message from an unlisted sender, or with no MSH-4 |
|---|---|
| use the default connection | Goes through the step's own connection. |
| fail the message | Fails the step before anything is sent. The error names the sender's MSH-4 and the step, and the failure is not retried: it fails the same way until you add the sender. |
A message from a webhook or another source without raw HL7 matches on its sendingFacility and sendingApp fields, as the sender table does.
What the run shows
Each run records the connection the step used. Open the message's Steps tab, or the execution, and the send step reads, for example:
- "Connection: North API, for sender DH-NORTH"
- "Connection: Default API, the default (sender DH-EAST isn't listed)"
People who can't view message content still see this line: it names a connection and a sending facility, not message content. A dry run and Run with sample show the connection they would use, and send nothing.
Components
A component is shared, so it never holds a customer's connections: the workflow that uses it does. When the component's pinned release sends (it has a send step), its Component step offers Different connection per sender too, in the Steps view under the destination's steps. The table is the same: a sender (MSH-4, optionally MSH-3) and its connection. It applies to every send step inside the component; the component's own connection is the default, and Senders not listed can fail the message instead. A lookup inside the component keeps its one connection: an action that reads or searches, such as get-patient, search-patients, query or getObject. Every other adapter action counts as a send.
- The step inside the component records the connection it used, as a send step does: Connection: North API, for sender DH-NORTH.
- The component's steps also read the run's sender settings (
{{sender.key}},sender.key,SENDER|coderows): they run inside the workflow's run. - A save checks each mapped connection: in the workspace, able to send, and of the same adapter as the component's own connection.
- One table stands in for one connection. When the component's send steps go through more than one connection (say a REST post and an SFTP drop), the Steps view says so instead of offering the table, and a save of an active workflow with a table on that step is refused (
COMPONENT_SENDS_DIFFER). Split it into one component per destination. - A step inside the component never holds a table itself: saving or releasing a component whose own step has Different connection per sender is refused, naming the step.
- Save as component moves a send step's table to the new Component step, so the workflow still sends each sender through its own connection, and the component keeps none.
- The graph view's Component step reads, for example, Post the patient row · release 1.0.0 · 2 senders, own connections.
Workflows a step starts
A Call workflow step (wait or hand off) and an older Run workflow step hand the run's sender to the workflow they start, with the sender settings the parent matched. A script's router.routeMessage does the same, and a Publish to topic step hands it to each subscriber's run. In the started workflow:
- per-sender connections pick by the parent's sender, even when the message it receives is a converted one with no MSH segment;
{{sender.key}}andsender.keyread the started workflow's own sender table for that sender, or the parent's matched settings when it has no table;- code table rows written
SENDER|codeapply for that sender.
So one shared workflow can post for every customer, each with their own connection, whichever workflow received the message. A started workflow whose destination is queued keeps the sender too: the queued delivery sends through that sender's connection.
Secrets and reuse
- The table holds connection ids and sending facilities only. Credentials stay in each adapter profile, encrypted, and are read when the message is sent.
- A save rejects a row that holds anything other than the sender, the application and the connection.
- An active workflow can't be saved, deployed or rolled back with a sender mapped to a connection that is not in the workspace, to one that can't send, or to one of a different adapter than the step's default connection. The error names the step and the sender.
- A copy others reuse never takes the table (a send step's or a Component step's): a workflow made from a template starts without one, Update all keeps each linked workflow's own table and never copies the template's, and a marketplace publish leaves it out.
- Export, import and promotion carry the table with the workflow, mapped to the target workspace's connections like the default connection.
Audit
Every save that adds, changes or removes a table (on a send step or a Component step) writes workflow.sender_connections_changed with each step's default connection, its rows (sending facility, application and connection id) and what unlisted senders do. Deleting a send step that had a table records it with removed: true. Never a credential. A workflow created with a table records it on workflow.created.
When the change reaches production, the entry says so too: workflow.deployed lists the tables that differ from the version that was running, and workflow.rollback and workflow.version_rolled_back list the tables the rollback changes, under senderConnections.
API
The table is part of the send step's data in Workflows:
{
"type": "adapter",
"adapterProfileId": "default-api-profile-id",
"action": "write",
"config": { "endpoint": "/adt" },
"senderProfiles": [
{ "facility": "DH-NORTH", "adapterProfileId": "north-api-profile-id" },
{
"facility": "DH-SOUTH",
"application": "LAB",
"adapterProfileId": "south-lab-profile-id"
}
],
"unmappedSender": "default"
}unmappedSender is default (the same as leaving it out) or fail. The step result's connection field records the choice: adapterProfileId, profileName, match (sender or default), facility and application.