Test, version and deploy safely
Test a saved change to a live workflow, compare it with the deployed version, keep test cases that every deploy runs, dry-run it, get approval, deploy all at once, as a canary or on a schedule, and roll back.
On this page
This guide takes one change to a live workflow from save to production and back. You test the change with a sample message, compare it with the deployed version, save the sample as a test case, dry-run it against stored messages, deploy with an approval (all at once, as a canary or on a schedule), and roll back.
Every save is a version. Saving never changes what production runs: the engine keeps running the deployed version until you deploy a newer one. Everything here happens on the workflow's page, in its Build and Versions tabs. See The workflow page for every part of it.
sequenceDiagram
participant You
participant Build as Build tab
participant Versions as Versions tab
participant Engine as MedHook engine
You->>Build: Save a change (new version)
You->>Build: Run test
Engine-->>Build: Dry run, nothing delivered
You->>Versions: Open Versions
Versions-->>You: Diff against the deployed version
You->>Versions: Save sample as case, Run all, dry run
You->>Versions: Request approval
Note over Versions: A different admin approves
You->>Versions: Deploy, or start a canary
Engine->>Engine: Dry-run test cases, swap traffic
You->>Versions: Roll back to an older versionBefore you start
- A deployed workflow with at least one destination, and a saved change to it. The JSON webhook guide builds one.
- A saved sample message on the workflow. See Add a sample message.
- The
operatorrole to test, save test cases and request approval. Approving and deploying needadmin. - Synthetic messages only. Use made-up patients such as
TESTPATIENT.
Steps
1. Test the change
Open the workflow from Workflows and choose the Build tab. The toolbar shows the version you are editing, for example v2. Choose Load sample, then Run test. The engine runs the sample through every step, including edits you have not saved, and delivers nothing. Each destination shows WOULD SEND with the output it would send, or FILTERED, FAILED or NOT RUN with the reason.
Test one message that the change should accept and one it should drop. For example, after narrowing Message types to ADT^A01, ADT^A04, ADT^A08, an ADT^A03 should no longer match.
Run test takes HL7v2, JSON, raw X12 (starting with ISA) for an X12 trigger, and any text (CSV, X12, a flat file) for an SFTP or file trigger: it is wrapped as a live pickup wraps it. A read step (a FHIR search or read, an SFTP read, a SQL query, an EHR read) is simulated too: it reads no data, so the steps after it run on a stand-in. The result says so, for example Passed · 4 steps · 1 read step was simulated, and the step shows SIMULATED (no data read). Check those reads on a real message before you rely on them.
What a step shows is what a live run stores: a mapping row whose source field is missing writes nothing (no given: [null]).
2. Compare it with the deployed version
Choose the Versions tab, or the version number in the Build toolbar. A 1 on the tab means a save is not deployed yet. Versions has three columns:
- The version list, newest first. The newest save is Draft, and the version production runs is Live. Each version shows the change note written when it was saved, and who saved it and when.
- The diff: the selected version against the one before it, one card per changed step.
+lines were added,~lines changed (old → new) and−lines were removed. Adapter profiles show by name. - The deploy panel, titled Deploy v2, with its checks, the deploy button and the rollback. Test cases, Releases and Template follow below it.
Select any version in the list to compare it with the version before it.
3. Save test cases
In Test cases, enter a Case name and choose Save sample as case. It saves the workflow's current sample. Choose Run all: each case shows Passed, the fields that differ, Filtered by the trigger or Timed out. You can also save a real run from the Runs tab with Save as test case.
From then on, every deploy dry-runs every case and needs each one to pass. A workflow keeps up to 50 cases. To check fields of the output, choose Edit checks on a case and add field checks (for example MSH.9 equals ADT^A04); a failed check is listed under its case with what it expected and what it read. To add a whole expected output, create the case through the API, as Save test cases shows.
4. Run the checks and get approval
The deploy panel lists the checks:
| Check | Passes when |
|---|---|
| Test cases | Every saved case passes, for example 2 of 2 test cases pass. Only shown when there are cases. |
| Test run | A test or run passed after this version was saved. A test that simulated read steps warns that it doesn't prove them. |
| Validation | The workflow has no validation errors. |
| Callers can authenticate | Webhook workflows only: the trigger has a signing secret, or an API client can call the workspace. Generate signing secret makes one and shows it once. |
| Dry run against the last 50 messages | No output changed outside the steps this change touches. |
| Approval | A different admin approved this version. |
Choose Run on the dry run. The engine runs the newest 50 stored messages through the new version on the server and compares each output with the deployed version's. It returns counts only, for example 50 delivered · 0 changed outputs outside Filter ADT. If an output changed outside the steps you touched, the check shows ! and the deploy waits: Dry run changed outputs · review first.
Choose Request approval. Another admin, signed in to the engine UI as a person, opens the same tab and chooses Approve. You cannot approve your own request, and an API token cannot approve at all. The header pill changes from v2 needs approval to v2 approved.
5. Deploy
Rollout and When sit above the deploy button. For a change you want everyone to get now, pick All at once and Now, then choose Deploy v2 to all messages. The version shows Live, and the panel reads v2 is live: All messages run on v2 · 0 errors since deploy · v1 kept for one-click rollback.
Deploying swaps traffic with no dropped messages: messages already in flight finish on the version they started with.
6. Deploy as a canary or on a schedule
To try the change on a share of traffic first, pick Canary and 10, 25 or 50%, then Start canary at 10%. That share of messages, chosen by message id, runs on v2 beside v1. The panel reads Canary · v2 on 10% of messages with its counts and when it promotes. Every minute the engine checks it:
- after 30 minutes with an error rate under 1%, it promotes v2 to every message;
- at 1% or more, it rolls the canary back on its own.
You can end it sooner: Promote to 100% or Roll back to v1, each after a confirmation. A rolled-back canary goes back to a draft and needs a new approval. A canary needs a deployed version to run beside, and the approval: it never starts through an override.
To deploy later, pick Schedule. Deploy at starts at the workflow's quietest hour of the last 24 hours, for example Tonight · 22:00 CDT · low traffic, and you can type another time. Choose Schedule v2 for 22:00. The panel shows the scheduled deploy with Cancel schedule. A later save cancels it.
Canary and scheduled deploys are on by default. Set CANARY_DEPLOY_ENABLED=false to turn them off.
7. Roll back
Under the deploy panel, Roll back to v1 offers the version before the deployed one. To roll back further, select an older version in the list first. Choose the button, then Roll back to confirm. Messages in flight finish on the version they started with.
Nothing is deleted: the version you rolled back from stays in the list, tagged Rolled back, and you can deploy it again later.
Promote to staging or production
When the change works in one workspace, promote it to the next one instead of rebuilding it there. Each workspace is an environment, such as Dev, Staging and Production.
- On the Versions tab, open the ··· menu (More version actions) and choose Promote to another workspace. Pick the workspace under Promote to. Only admins can promote.
- Read What changes there: the diff against the version that workspace runs. Goes with it lists the topics and template the workflow uses, and whether each is created there or already there.
- Under Connections, pick the connection in that workspace for each one the workflow uses. Connections and their secrets are never copied, and your choice is remembered for the next promotion.
- Choose Promote to Staging. The workflow lands there as a draft: nothing runs until it is deployed there.
- Choose Open Versions there and deploy as above. That workspace's own test cases run, and approval is required.
Environments, in the same ··· menu, shows each workspace's deployments, for example v2 deployed (promoted from Dev v5). Roll back to v1 in a workspace restores its previous deployed version and deploys it again, through the same checks as a deploy. See Environments and promotion for every rule.
Over the API
GET /api/workflows/{id}/deploy returns the versions, the checklist and what is missing. POST /api/workflows/{id}/deploy takes an action:
curl -s -X POST "$ENGINE_URL/api/workflows/wf_example/deploy" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"action": "request-approval"}'action | What it does |
|---|---|
request-approval | Asks for approval of the newest version. |
approve | Approves it. A signed-in admin other than the requester only. |
dry-run-recent | Dry-runs the newest 50 stored messages through the newest version. Counts only. |
deploy | Deploys the newest version. Answers 409 with missing while checks are open. Add rollout and at for a canary or a schedule. |
promote | Promotes a running canary to every message. Needs confirm: true. |
rollback-canary | Ends a running canary and sends every message to the deployed version. Needs confirm: true. |
cancel-schedule | Cancels a scheduled deploy. |
rollback | Restores the version in versionId and deploys it. Needs confirm: true. |
A canary at 10%, scheduled for tonight:
curl -s -X POST "$ENGINE_URL/api/workflows/wf_example/deploy" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"action": "deploy", "rollout": {"mode": "canary", "percent": 10}, "at": "2026-10-19T22:00:00-05:00"}'Every action is written to the audit log.
Troubleshooting
| Problem | Fix |
|---|---|
| The checklist says "Not tested since this version was saved" | Choose Run test in Build again. A test counts only if it is newer than the save. |
| Approve is disabled | You requested the approval, or you are not an admin. The note under the checks says which. |
The dry run shows ! and Deploy waits | An output changed outside the steps you touched. Check the change, or an admin can Override and deploy. |
Deploy says WEBHOOK_ID_IN_USE | Another live workflow answers the same webhook id. Give this trigger its own id, or turn the other one off. |
| Save says a destination can't hold this step | A loop, parallel or router step sits inside a router destination, where it can never run. Move it before the router. |
| Canary is off | Nothing is deployed yet. The first deploy is all at once. |
Deploy answers 409 with missing: ["test-cases"] | A case fails, or the cases have not run since the last save. Choose Run all and fix the failing case. |
| The diff shows only additions | The selected version is the first one. Select a newer version. |