Presenter view

Workflow orchestration speaker notes

Explain the durable control plane, then go deep on panel prioritization before contrasting inbox and practice-improvement workflows.

Opening cue

“The reasoning core decides what should happen. Temporal owns whether that work starts, waits, retries, resumes, cancels and finishes across hours or days.”

01 · Temporal boundary

Services coordinate; agents reason briefly

“A workflow has a stable business ID and versioned inputs. Temporal stores orchestration history. PostgreSQL stores product state. Model calls and database operations are activities. Agents never become the durable state machine.”

One sentence per capability

Start

Schedule, clinician request or a meaningful domain event starts a workflow with a stable business ID.

Checkpoint

Temporal records orchestration history; PostgreSQL records product state, versions, budgets and audit references.

Resume

A replacement worker replays history and continues from the last completed activity after a crash or deployment.

Wait

Signals resume workflows after clinician approval, new patient data or an external result—without holding a process open.

Cancel

Cancellation stops unstarted work, asks active children to stop and preserves completed evidence and audit history.

Observe

Search attributes expose tenant, clinician, patient, workflow type, status, risk, version and cost without logging PHI.

Why not a for-loop?

“A crash loses progress, retries can duplicate actions, a deploy interrupts the batch, approvals cannot wait safely, cancellation is ambiguous, one failure can poison the run and the final result has no durable version history.”

02 · Panel deep dive

Walk from 1,200 patients to one reviewed queue

01

Freeze review

Create review_id; snapshot panel membership, patient-state versions and policy versions.

02

Score cheaply

Run safety overrides, eligibility rules, change detection and longitudinal SQL/features for all 1,200 patients.

03

Select candidates

Keep roughly 30 strong candidates; reuse any fresh, already-validated DecisionCandidates.

04

Fan out safely

Start at most eight patient child workflows that need fresh reasoning, with bounded concurrency and budget.

05

Collect + rank

Accept typed results, isolate partial failures, deduplicate actions and apply the explainable priority policy.

06

Publish queue

Write a frozen, evidence-backed weekly queue and notify the clinician only when it is ready.

07

Wait for decisions

Receive approve, modify, dismiss, defer or request-information signals per candidate.

08

Close + learn

Track execution and outcomes, write feedback records and continue-as-new before history grows unbounded.

“The parent freezes panel membership and versions, scores everyone deterministically, selects roughly 30 candidates and starts at most eight patient child workflows that actually need fresh reasoning. Concurrency and budget are explicit workflow inputs.”

Important failure answer

One patient failure does not invalidate the panel. I publish valid candidates, show missing coverage, route high-risk failures to review and retry only the failed child when safe.

03 · Three workflow shapes

Do not force three problems into one abstraction

Panel prioritization

“What should I focus on this week?”

Unit
PanelReview parent + PatientDecision children
Path
Snapshot → deterministic score → bounded fan-out → rank → queue
Failure
Publish successful candidates; mark missing coverage explicitly

Inbox drafting

“Draft responses to my inbox.”

Unit
One InboxItemWorkflow per message, result, refill or staff task
Path
Classify → load patient/thread context → safety route → draft/hold/escalate
Failure
Never guess: hold, label the missing context and route to a human

Practice improvement

“How can I improve my diabetes management?”

Unit
PracticeInsightWorkflow over governed aggregate features
Path
Define cohort/measure → aggregate → compare over time → explain → drill down
Failure
Suppress unstable slices; disclose small samples and missing/confounded data
“Panel work is breadth plus ranking. Inbox work is event-driven and patient-local. Practice improvement is aggregate and longitudinal. They share state, tools, policy, evaluation hooks and orchestration primitives—not one identical workflow.”

04 · Failure, retry + cancellation

Retry I/O; never blindly retry a clinical conclusion

Activities

All I/O: database reads, model calls, notifications and EHR actions. Retry transient failures only.

Child workflows

One durable unit per patient or inbox item. Bound concurrency; isolate failure and cancellation.

Signals

PatientStateChanged · ClinicianDecision · ExternalResult · CancelReview

Queries

Progress · candidate counts · current budget · waiting approvals · failure coverage

Timers

Batch windows, approval expiration, SLA escalation and scheduled refresh without worker sleep.

Continue-as-new

Roll long-lived histories forward while preserving the stable business identifier.

Transient timeout

Activity retry with backoff and same idempotency key.

Invalid model output

One schema repair or approved fallback; record the failure.

Cancellation

Stop new children, request active cancellation and preserve completed audit evidence.

05 · Clinician experience

Show completed work and control—not workflow machinery

“The clinician sees a ranked queue when it is ready, with progress only when useful. Each item explains what changed, why now, evidence, confidence, missing data, expiry, accountable owner and exactly what approval will do.”

Correction signals

Approve
Modify
Dismiss + reason
Defer
Request data
Escalate

Closing transition

“Temporal makes the work durable. The next section defines the records that make every workflow, recommendation, approval and outcome reproducible.”