Agent orchestration with durable execution lets a healthcare AI agent wait for a person, survive a restart and continue from the same step. The design rests on a durable record: a workflow id, the waiting step and who must act. Temporal is one engine that can hold it.
Digital health founders and hospital CTOs get the fields that record needs, the rules for resume, and the tests that prove no human step is skipped.
What is durable execution in healthcare AI agent orchestration?
Durable execution in healthcare AI agent orchestration means the agent's workflow state lives in a store that survives restarts, not in process memory. The record holds a workflow id, the step that is waiting, the person who must act and when the wait began, so the run resumes at that step after downtime.
An agent that must wait for a person?
We store the workflow id, the waiting step, and who must act, then resume from that row.
Agnotic Technologies resumes from that row after downtime. It does not keep the wait only in process memory, where a deploy or a host patch would erase it.
- Workflow id: one id for the run. A restart uses the same id.
- Waiting step: named, such as 'approve the draft note'. Not a stack trace.
- Person: who must act. A queue name is not a person.
- Resume: after downtime, the run continues from the waiting step. It does not start over and it does not skip the person.
Temporal is one engine that can store this row. The row is the requirement. The engine is a choice you make later.
What must not happen on resume?
On resume the agent must not call a tool that was not already on the allow-list, and it must not file an order because the wait timed out. Agnotic treats a timeout as a still-waiting step, not as consent.
- Timeout: still waiting. Notify the person again. Do not proceed.
- Tool: only tools already allowed for this run.
- Order: a person still has to file it. Resume is not a signature.
How should the workflow id be chosen?
Choose a workflow id that comes from the business event the run serves, so a second start for the same event finds the run already in progress. A random id lets a retry start a duplicate run that waits for the same person twice.
Temporal guarantees that at most one Workflow Execution with a given Workflow ID is running at any point in time, while each run gets its own system-generated Run ID.
- Derived: built from the task type and an internal event key, such as a draft-note task for one encounter.
- Opaque: the key is an internal reference, not a name, a date of birth or a medical record number.
- Stable: the same event always produces the same id, across restarts and deploys.
Keep the mapping from the opaque key to the encounter in a protected table. The workflow store and its logs then never hold a patient identifier in plain sight.
What fields belong on the waiting-step row?
The waiting-step row holds the identifiers, the step, the person and the clock, plus a fingerprint of what the person is being asked to approve. Without the fingerprint, nobody can prove later which version of a draft was approved.
- Identifiers: workflow id and run id.
- Step: the named waiting step and the time the wait began.
- Person: the assignee, plus any reassignment with who made it and why.
- Content: a hash and version of the draft shown to the person, not the draft text itself.
Keep the draft in the clinical system that owns it, not in the workflow store. The row points to it by id and hash, which keeps the durable record free of clinical text.
How does the person's answer reach the waiting run?
The answer reaches the run as a message tied to a signed-in user whose identity the system has checked. A link in an email that anyone could click does not count as the named person acting.
45 CFR 164.312(d) requires procedures to verify that a person or entity seeking access to electronic protected health information is the one claimed.
- Approve: carries the user id, the time and the content hash the user saw.
- Reject: carries the same fields plus a reason, and the run ends or returns to drafting.
- Mismatch: if the hash differs from the waiting draft, the answer is refused and the person sees the current version.
Expire the approval screen when the draft changes. An approver who left a tab open from the day before should be asked to reload, not allowed to approve a version that no longer exists.
What happens to an in-flight tool call during downtime?
A tool call that was running when the worker stopped may or may not have finished, so the resumed run checks before it calls again. Agnotic gives every side-effecting call a key that the receiving system can use to ignore a repeat.
Temporal documents that a Workflow Execution is fully recoverable after a failure: the platform persists its state through failures and outages and resumes execution from the latest state.
- Read-only call: safe to repeat after a restart.
- Write call: sent with an idempotency key derived from the workflow id and step.
- Unknown result: query the receiving system for the key before deciding to resend.
Durable state covers the workflow's own progress. It does not make an outside system's write safe to repeat; the key does that.
How should reassignment work when the named person is away?
Reassignment is a recorded event that names the new person, who made the change and why. It is never automatic approval, and it never leaves the step without a named person.
- Manual: a supervisor reassigns the step, and the row records both names.
- Rule-based: a written cover rule picks the deputy, and the row records the rule applied.
- Escalation: after repeated reminders, the step goes to the supervisor, still waiting for a human answer.
Show the reassignment on the new person's screen, with the original assignee's name. The cover approver knows they are covering, and the original person can see on return that the step was handled.
A worked example: a discharge summary draft waits overnight
A worked example: an agent drafts a discharge summary late in a shift and reaches the step 'attending approves the draft'. The run stores its workflow id, the step, the attending's user id and a hash of the draft.
The worker hosts are patched during the night and restart. When the workers return, the run continues at the same waiting step with the same workflow id, and no second draft is generated.
In the morning the attending opens the draft, sees the version that matches the hash and approves it. The run files nothing on its own; it hands the approved draft to the step where a clinician signs the note.
What must be logged for each wait and resume?
Each wait and resume should leave an audit trail of state changes, not a transcript of the clinical content. An investigator should be able to replay who was asked, when, and what they answered.
- Wait started: workflow id, run id, step, assignee and time.
- Reminder sent: the time and the channel used.
- Resumed after downtime: the time and the step the run resumed at.
- Answered: user id, answer, content hash and time.
Write these events to the same audit store as the clinical system's other access records. An investigator should not have to join two systems to answer one question about who approved a draft.
How do code changes affect a run that is already waiting?
A code change can break a run that is already waiting, because durable engines rebuild state by replaying recorded history against the current code. Agnotic versions any change to step order or step names and keeps the old path until waiting runs have finished.
- Safe: changing a reminder message or a log line outside the recorded steps.
- Versioned: adding, removing or reordering steps before the waiting point.
- Checked: replay a sample of recorded histories against the new code before release.
Before each deploy, list the runs that are waiting and the code version each one started on. If an old path has to stay for a long time, plan its removal as its own change once those runs have closed.
How do you test resume after downtime?
Test resume by stopping every worker while a run is waiting, then restarting and checking that the run is at the same step with the same id. A test that only restarts an idle system proves nothing.
- Step 1, wait: start a test run and let it reach the human step.
- Step 2, stop: shut down all workers and leave them down.
- Step 3, restart: bring the workers back and read the waiting-step row.
- Step 4, answer: approve as the named test user and confirm no tool call ran twice.
Repeat the test with the workflow service itself restarted, not only the workers. Both hold part of the record, and both can go down in the same maintenance window.
How do you tell the durable record is working?
The record is working when no waiting step is lost across restarts, none has gone without a named person, and no run moved past a human step without a signed-in answer. Agnotic reports all three to the workflow owner.
- Lost waits: zero runs whose waiting step disappeared after a restart.
- Orphans: zero waiting steps with no assignee.
- Bypass: zero steps completed without a recorded user answer.
Look into any count above zero the same day. Each one is either a defect in the workflow or a person who was never told they had something to approve.
What are the common mistakes with durable agent workflows?
The common mistakes treat durability as a feature of the engine rather than a property of the design. Each one below lets a restart, a timeout or a deploy skip the person the workflow was built to wait for.
- Waits in memory: the pending approval lives in a worker process, so a restart forgets it.
- Random workflow ids: a retry starts a second run that asks the same person twice.
- Timeout as consent: the run continues when nobody answers instead of reminding and escalating.
- Unkeyed writes: a resumed run repeats a write to an outside system because the call had no idempotency key.
- Unversioned deploys: step order changes while runs are waiting, and replay fails on the new code.
How can Agnotic help with durable agent orchestration?
Agnotic builds the workflow record, the waiting step and the resume path for the client's agent, on Temporal or on the engine the team already runs. Every build includes the stop-all-workers test before any clinician is asked to approve anything.
Store the wait, then resume
Workflow id, waiting step, named person. Downtime does not skip the person.
Related reading on Agnotic
More on healthcare AI agents, their limits and HIPAA-ready AI builds.


