Monitor a feed and recover a failed message
Find a message in Messages, read why a delivery failed in Needs action, replay it safely after a dry run, and add an alert rule for a feed that goes quiet.
On this page
A live feed needs a short routine: find a message when someone asks about it, recover one that failed, and hear about the next problem before the sending healthcare organization calls. This guide walks through that routine in the engine UI, with one failed delivery as the example.
Here is the flow.
sequenceDiagram
participant You
participant Engine as MedHook engine
participant Dest as Receiving system
You->>Engine: Search Messages for a patient
Engine-->>You: The message, field by field, PHI masked
You->>Engine: Open Needs action
Engine-->>You: The cause and a suggested fix
You->>Dest: Ask whether it already has the message
You->>Engine: Replay, after a dry run
Engine->>Dest: The message again, to the failed destination only
Dest-->>Engine: ACK (AA)
You->>Engine: Add an alert ruleBefore you start
- A deployed workflow that takes traffic, for example an MLLP source with one destination.
- The
operatorrole in the workspace, to show PHI, replay messages and change alert rules. A viewer can read Messages, but not message content. - Synthetic messages when you practise. The examples use the patient
TESTPATIENT^DELTA, control IDDEMO0004, and the receiving system Demo Health EHR.
Steps
1. Find a message
Open Messages. The Stream tab shows every message the engine accepts, live, with its time, control ID, type, workflow and result. The time window starts at the last 15 minutes. Change it with the Time chip.
To look for one message, type a query in the search box and press Enter. Enter searches every message, not only the live sample.
PID.5:TESTPATIENT^DELTA*A query term is an HL7 field path and a pattern. * matches any run of characters. Join terms with AND, OR and NOT, for example type:ADT^* AND ack:AE. The Workflow, Type, Status, ACK and Time chips write their terms into the box. A patient search is audited and never goes in a URL. See Search.
Choose a row to open it in the message panel. PHI is masked until you choose Show PHI and a reason. Fields shows each segment field by field, Input → Output the message next to what the workflow produced, Trace each step with its timing, Delivery what each send step sent and what came back, and Raw the message as it arrived. See The message panel.
When the final output is wrong, open Trace to find the step that changed it. Each row is one step in the order it ran, with its timing. Choose a row to load its input, its output, the lines that changed between them and any JavaScript console lines. While PHI is masked, masked values show as •••. A line whose value changed is still marked and counted in the diff, as ••• on both sides, and console lines are hidden until Show PHI. If a step failed, it is marked in red. Open execution shows the same steps on the run. Viewers see step names, status and timings, but not the content.
When a destination says it never got a message, open Delivery. Each send step shows a timeline per destination and every request it made, retries included: the host, the status (an HTTP status, or the ACK code for MLLP) and the time it took. Operators and admins also see the request and response headers and bodies, with credentials replaced by [redacted] before anything is stored. Opening a message is recorded in the audit log as a message view. A Generic REST request also shows its Correlation id: give it to the destination's team to find the same call in their logs; see Correlation id. For a workflow that encrypts stored messages, the recorded requests and responses are encrypted with the rest of the message.

2. Read the failure in Needs action
Open the Needs action tab. It holds the last 7 days' failed messages and the destination queues that are not delivering, grouped by cause: failures of one workflow with the same error are one group. Each group has a kind.
| Kind | Means |
|---|---|
| Queued · retrying | A destination queue is down. Its messages wait in order and deliver when it is back. |
| Queued · paused | Someone paused a destination queue with messages waiting. |
| AE · rejected | The message failed with an error: a step failed, or the destination answered an error. |
| AR · rejected | The destination refused the message for good. Fix the message or the mapping first. |
| Error · auth | The destination refused the credentials. Fix the adapter profile. |
Choose a group to see the Agent · cause and fix card: the cause in a sentence, the suggested fix, and the actions for it. The card works the same with AI off.
A result that ends in delivery uncertain means the message went out, but the receiving system never confirmed it. For MLLP, its ACK did not arrive, named another message, or was only a commit ACK. The engine never resends such a message on its own, because the receiving system may already have it, and a second copy could admit the same patient twice.
By default the engine answers the sending system AA as soon as it has stored the message, before the workflow runs, so the sender will not resend it. Recovering it is up to you. A trigger with ackMode: "destination" answers with the outcome instead. See MLLP and ACKs.
3. Replay
Choose Replay in the message panel, or a group's replay button in Needs action. The replay dialog opens. Nothing is delivered until a dry run has passed: it runs the message through the live version with nothing sent, and says, for example, "1 of 1 would deliver". That result is a preview: nothing was sent yet. Then choose Send replay on v4. The engine writes a new execution of the same message and runs it like live traffic. In Messages, the new run is tagged replay.
Replay is guarded:
- It sends only to the destinations that failed or have not received the message yet. A destination that already has it is skipped.
- It is not available while another attempt of the message is running, or while an automatic retry waits for its time.
- Edit & replay lets you correct an HL7 v2 or JSON message before it is sent again, for example a value a destination rejected, such as a record your API refused because of one field. For a polled item or a webhook's JSON body you edit the value by its path (
data.status) and the edited copy runs with it; a replayed polled item never moves the poll's cursor. The original is kept and the edited copy links to it. - A replay of more than 1,000 messages needs a second admin's approval.
To replay the results of a search, type it in Messages, press Enter and choose Replay {n}. It replays the results loaded on screen from one workflow, with a dry run first. To reprocess every match, or to run the messages through another workflow, use POST /api/messages/reprocess. See Replay and Edit & replay and Reprocess a search.
4. Add an alert rule
Open Settings, then Alert rules, and choose New rule. For an inbound feed, start with a rule that fires when the feed goes quiet.
| Field | Example |
|---|---|
| Name | ADT feed quiet |
| Condition | No messages |
| Workflow | the feed's workflow |
| Silent for | 30 min |
| Active hours | 06:00-20:00 |
| Time zone | the workspace time zone |
| Priority | P2 · waits for quiet hours |
| Notify | Webhook |
| Notify target | https://alerts.example.test/medhook |
Set Active hours to the hours the sender really sends. Without them, a feed that is quiet every night pages someone every night. Time zone starts at the workspace's, set under Settings → Overview. A P1 rule pages even in on-call quiet hours; P2 and P3 wait for them to end.
The notify target is write-only: once saved, nobody can read it back. Below the fields, a dry run says how often the rule would have fired in the last 30 days, so you can adjust it before it pages anyone. Choose Create rule. The engine checks every enabled rule every 30 seconds, and sends a resolve when the condition clears.
A workflow's own alerts are quicker to add from the workflow. Open it, choose Settings, and under Alerts choose Add next to Error rate, Silence, Queue depth or Certificate. Each is created for that workflow and emailed to its owner.
Other conditions cover the error rate, failures that match an error type, step, adapter or text (Error match), the queue size, latency, a tunnel that is down, tunnel failover events, a secret about to expire, an HL7 field value, and a polling workflow whose polls keep failing (Polling is failing). See Engine alert rules.
To watch one workflow, open it from Workflows. Its Overview shows the last 24 hours, and the Open issue card groups its failures by step with the next thing to do. View runs opens its Runs tab on the failed runs. See The workflow page.
🎉 You can now find any message, recover a failed one without sending it twice, and hear about a quiet feed first. Next, read Monitoring for the engine's health checks and metrics.