1. Inbound Call Answer and Mandatory Emergency Statement
Trigger: any inbound call to the main number, the after-hours flow, or any tracked number.
Actions in order:
- Answer within two rings. Create a routing event in Received, write contact_channel Inbound Call, and attempt a match on caller ID without asserting identity.
- Speak the emergency statement as the first words, every call, with no condition on it: "Thanks for calling {{custom_values.practice_name}}. If this is a medical emergency, hang up and call 911 or go to your nearest emergency room. I am an automated assistant and I cannot give medical advice or tell you how urgent something is. Press zero at any time for a person. How can I help you today?" Set emergency_statement_delivered true and stamp emergency_statement_timestamp.
- Apply the recording notice the practice's jurisdiction requires, in the wording its counsel approved, and write recording_consent with the rule applied. Where consent is required and declined, continue the call without recording rather than refusing the call.
- Enable zero-out to a human at every point in the flow, including during the statement. A caller must never be trapped with an automated agent.
- Capture the caller's response verbatim into stated_reason_verbatim. Do not paraphrase, do not summarize into a clinical term, do not normalize "my chest is tight" into "chest pain". The verbatim is the clinical handoff and the audit record.
- Pass to workflow 2 for classification.
Stop and exit conditions: caller presses zero, which transfers immediately; caller hangs up, which starts workflow 5; silence or no input twice, which escalates to a human rather than repeating the menu, with escalation_trigger Silence or No Input. The statement is never skipped, never shortened, and never moved later in the flow. A call record with emergency_statement_delivered false is a routing incident and must alert.
2. Intent Classification and Non-Clinical Self-Service
Trigger: verbatim captured in workflow 1, or a web chat or SMS conversation opened.
Conditions and branches:
- Urgency and clinical screen runs first and wins over everything. If the verbatim matches the urgency lexicon or any clinical term, go immediately to workflow 3. No further questions.
- Classify against the closed non-clinical allowlist only. BO may self-serve exactly these: opening hours; location, directions and parking; booking, rescheduling or canceling an appointment; what to bring to a visit; forms and registration links; requesting a callback about a bill; requesting records through the regulated intake path; general service availability. Nothing else. This is an allowlist, not a blocklist, anything not on it goes to a human, which is the opposite of how a sales chatbot is usually built and is the correct construction here.
- Confidence gate. If BO's classification confidence is below the configured threshold, or the caller's intent spans both a clinical and a non-clinical matter, escalate. Set escalation_trigger Agent Could Not Classify and tag unclassified-escalated. One clarifying question is permitted; a second is not. A second attempt is how a caller with a real problem gets stuck in a loop.
- Third-party branch. If the caller is not the patient (a parent, a caregiver, another practice, a pharmacy) write caller_relationship and escalate to a human. BO does not navigate who may be told what. Where the contact concerns a minor, tag minor-contact and apply the guardian and consent rules the practice's counsel specified.
- Distress branch. If the caller is crying, shouting, incoherent, or says anything about being frightened or alone, tag caller-distressed, repeat the emergency instruction, and transfer to a human immediately regardless of stated intent.
- Self-serve path. For an allowlisted intent, complete the action (book the slot, send the link, create the front desk task) then close with "Anything else? And remember, for anything medical please call our clinical line on {{custom_values.clinical_line}}, or 911 in an emergency." Set routing_path Self-Served or Administrative.
- Billing branch. Capture the request, create a Billing Question task on the front desk board, and state the callback timeframe. BO does not discuss balances, coverage or denials.
Stop and exit conditions: intent served; escalation fired; caller abandoned. Every exit writes routing_path and files the routing event. There is no exit in which BO has decided a clinical matter is not urgent, because that branch does not exist in the flow.
3. Clinical Contact Capture and Immediate Human Escalation
Trigger: urgency lexicon match; any clinical term; caller asks for a nurse or doctor; caller says the word emergency or urgent; classification failure; distress detected; third party calling about a patient.
Actions in order, with no waits anywhere in the clinical path:
- Deliver the fixed escalation response immediately. "I am not able to help with medical questions, and I cannot tell you how urgent this is. If this is an emergency, or if you are having chest pain, trouble breathing, severe bleeding, or you think someone's life is at risk, hang up now and call 911 or go to your nearest emergency room. If you can stay on the line, I will put you straight through to our clinical team." Repeat the emergency instruction even if it was given forty seconds earlier in workflow 1. Repetition is the design.
- Set routing_path, escalation_trigger, tag clinical-escalation and emergency-instruction-given, and set transcript_contains_clinical true so the transcript is restricted to clinical roles and blocked from outbound templating.
- Read the Clinical Availability Calendar. Branch A, clinical staff available: transfer live with a whisper carrying the caller's verbatim and the record identifier: never BO's interpretation of it. Move to Clinical - Transferred Live. Stamp escalation_acknowledged_at on pickup.
- Branch B, no clinical staff available during open hours: do not hold the caller. Say "Our clinical team are all with patients right now. I am going to have one of them call you back, and the standard for that is {{custom_values.clinical_callback_standard}}. If anything gets worse in the meantime, please call 911 or go to your nearest emergency room." Confirm the callback number by reading it back. Set clinical_callback_due_at, move to Clinical - Callback Queued, and alert the clinical team and the practice manager immediately, not on a timer.
- Branch C, outside open hours: hand to workflow 4.
- In every branch, create the Clinical Escalation Record prefilled with the verbatim, the channel, the time and the trigger, assigned to the receiving human. The human completes the clinical content; BO completes only the routing facts.
- If the transfer fails (no answer, line busy, technical failure) do not return the caller to the menu. Go straight to Branch B, and additionally open a routing incident. A failed clinical transfer is always an incident even if the callback then goes fine.
Stop and exit conditions: live transfer connected; callback queued with an owner and a clock; on-call paged. There is no exit condition in which the contact ends without a human owning it. BO never asks a clinical follow-up question at any point in this workflow, and never offers an appointment as an alternative to clinical contact.
4. After-Hours On-Call Escalation Ladder
Trigger: inbound call, SMS or chat outside the hours on the Front Desk Shift Calendar, or on a practice closure day.
Actions in order:
- Deliver the emergency statement as in workflow 1, with the out-of-hours variant: "...our office is closed. If this is a medical emergency, hang up and call 911 or go to your nearest emergency room now."
- Offer exactly two choices, and no more: press 1 for an urgent clinical matter that cannot wait until we reopen; press 2 to leave a message for the office. Two options, because an after-hours menu with six branches is a menu nobody navigates correctly at ten at night.
- Press 2 branch: capture the message, create a front desk task due at opening, confirm the timeframe, repeat the emergency instruction, end.
- Press 1 branch: capture the verbatim and read the callback number back. Repeat the emergency instruction. Then page the primary on-call from the On-Call Rotation Calendar by simultaneous voice call and SMS. The SMS carries the callback number, the time and a record identifier, and the verbatim only if the practice's counsel has confirmed the SMS path is covered by a signed business associate agreement. Otherwise the SMS says "Urgent clinical callback waiting: open {{secure_link}}."
- Wait the practice's acknowledgement window: commonly five minutes, set by the practice, not by the builder. If On-Call Acknowledgement is not submitted, tag on-call-unacknowledged and page the secondary on-call by voice and SMS.
- Wait the same window again. If still unacknowledged, page the practice owner by voice, SMS and email, and open a routing incident automatically.
- In parallel with step 6, call the patient back with one fixed message: "This is {{custom_values.practice_name}}. I am still working on reaching our on-call clinician for you. If your symptoms are getting worse at all, or you are worried, please call 911 or go to your nearest emergency room now." No estimate of how long, no reassurance, no assessment. Repeat this call once more at the next window if still unacknowledged.
- On acknowledgement: stamp escalation_acknowledged_at, remove on-call-unacknowledged, move to Clinical - On-Call Paged, and create the escalation record for the clinician to complete after speaking with the patient.
- If the on-call clinician has not recorded a completed callback within the practice's standard, alert the practice manager regardless of the hour.
Stop and exit conditions: acknowledgement received and callback completed; caller calls 911, which the clinician records on the escalation record. The ladder never terminates without a human having been reached. It terminates at the practice owner, who is a human. Any gap in the On-Call Rotation Calendar must raise a loud configuration alert the day before, because an unstaffed window is this build's worst failure mode.
5. Abandoned Call and Dropped Contact Recovery
Trigger: call disconnects before a routing_path is written; caller hangs up on hold; SMS or chat conversation abandoned mid-flow; voicemail left with no callback number.
Conditions and branches:
- Branch A, abandoned during or immediately after the emergency statement, or before any intent was captured. Treat as potentially clinical. Within 2 minutes, attempt one outbound call. If unanswered, send an SMS that leads with safety: "We missed your call to {{custom_values.practice_name}}. If this is a medical emergency, call 911. For a clinical question, call {{custom_values.clinical_line}}. For anything else, reply here or call {{custom_values.front_desk}}." Tag abandoned-recovery, file in Abandoned, and create a front desk callback task due within the hour.
- Branch B, abandoned after a clinical escalation had already started. This is the highest-priority recovery in the build. Attempt the callback immediately, then every 10 minutes up to three attempts, alert the clinical lead on the first failure, and open a routing incident. A caller who was mid-clinical-escalation and dropped is not an abandoned call; it is an open clinical contact with no contact.
- Branch C, abandoned during a confirmed non-clinical self-serve flow: for example mid-booking. One callback attempt and one SMS with the booking link, then close to the front desk board as routine.
- If all recovery attempts fail: tag abandoned-unrecovered, and on a Branch B record notify the practice manager and the clinical lead by name. Unrecovered Branch B records are reviewed individually at the weekly clinical review, every one of them.
- Daily at close, report abandoned counts by branch and recovery rate to the front desk lead and practice manager, with Branch B listed individually.
Stop and exit conditions: caller reached; caller calls back in; three attempts exhausted on Branch B. Never classify an abandoned call as routine because of the time of day or the number it came from.
6. Inbound SMS and Web Chat Urgency Interception
Trigger: any inbound SMS to any practice number, any web chat message, any web form submission with a free-text field.
Actions in order:
- Screen before replying anything. Run the urgency and clinical lexicon against the message content before BO generates a single word of response.
- On match: send the fixed safety response and nothing else: "I cannot help with medical questions by message, and I cannot tell you how urgent something is. If this is an emergency, call 911 or go to your nearest emergency room now. For a clinical question, call us on {{custom_values.clinical_line}} and a member of our clinical team will speak with you." Then: notify the clinical line immediately during open hours, or page the on-call after hours through workflow 4; tag clinical-escalation and emergency-instruction-given; set transcript_contains_clinical true; create the escalation record. BO sends no further messages on that thread.
- During open hours, additionally create a clinical callback task with clinical_callback_due_at, because a patient who texted about a symptom should get a call, not a text telling them to call.
- No match: proceed to the allowlisted non-clinical handling in workflow 2. Append to the first reply of every new conversation: "I can help with appointments and practice information. For medical questions please call {{custom_values.clinical_line}}, or 911 in an emergency."
- After-hours auto-reply on every channel, unconditional: "Our office is closed and this number is not monitored right now. If this is a medical emergency, call 911. For an urgent clinical matter, call {{custom_values.after_hours_line}}. Otherwise we will reply when we reopen at {{custom_values.open_time}}."
- Web chat and web form hardening: a persistent, always-visible line at the top of the widget naming emergency services, before the first message is typed; controlled lists rather than free text wherever possible; and a form-level notice that it is not for medical questions or emergencies.
- If a caller supplies clinical detail anyway, capture it, restrict it, and escalate. Never reply to it with content, and never ask a follow-up question about it.
Stop and exit conditions: escalated to a human; non-clinical request served. BO never sends a second message on a thread it has escalated. The human owns the conversation from that point, and a well-meaning follow-up from an automated agent on a clinical thread is a real harm risk.
7. Clinical Callback Queue and Documentation Handoff
Trigger: routing event enters Clinical - Callback Queued.
Actions in order:
- Assign to the clinical team queue, not to an individual, so it cannot sit on an absent person's name. Surface it at the top of the clinical queue view ordered by clinical_callback_due_at ascending.
- Alert the clinical team immediately with the record identifier, the channel, the time received and the due time. Clinical content stays in the record, not in the alert.
- At 50 percent of the callback window: nudge the clinical team. At 75 percent: alert the clinical lead by name. At 100 percent: tag clinical-callback-overdue, page the practice manager, and open a routing incident automatically. These thresholds are not negotiable downward to reduce alert noise. If the alerts are noisy, the staffing or the standard is wrong, not the alerting.
- The clinician calls the patient, stamps callback_completed_at, and completes the Clinical Escalation Record: the caller's verbatim, what was asked, what was advised, the disposition, and the clinician's name. This record must flow into the chart through the EHR integration or be entered there by the clinician. A clinical interaction documented only inside a marketing-adjacent platform is a documentation gap.
- Disposition branch. Advised to attend emergency care: tag it, notify the practice manager, and do not send any automated follow-up message. Same-day appointment needed: the clinician books from the held clinical slots on the Nurse Callback Calendar; the ordinary confirmation sequence runs with no clinical content. Routine appointment: hand to the scheduling flow. Resolved on the call: close the routing event.
- If the patient cannot be reached: three attempts across the window, each logged, then a letter or portal message per the practice's own documented unable-to-reach procedure, and a notification to the clinical lead. Never close an unreached clinical callback silently.
Stop and exit conditions: callback completed and documented; patient unreachable after the documented procedure is exhausted. The routing event does not close until the escalation record is complete.
8. Escalation Audit, Call Review and Weekly Safety Report
Trigger: continuous monitoring, plus scheduled Friday 08:00 and the first business day of each month.
Actions in order:
- Continuous integrity checks, alerting immediately on any failure: any routing event with emergency_statement_delivered false; any clinical escalation with no escalation_acknowledged_at inside the window; any on-call page with no acknowledgement after the full ladder; any clinical callback past due; any Branch B abandoned record unrecovered; any gap in the On-Call Rotation Calendar in the next 7 days. Each opens a routing incident and pages a named human.
- Weekly, assemble the safety report for the clinical lead, the practice manager and the practice owner: total contacts by channel; escalations by escalation_trigger; unclassified-escalated rate; median and 90th-percentile seconds from emergency statement to human pickup; on-call acknowledgement times with every breach listed individually; clinical callback breach count; abandoned counts by branch with recovery rate; and routing incidents opened and closed.
- Create the clinician review task: "Review this week's sample. Every escalation record, plus a random sample of calls BO handled as non-clinical. Against our standard." The second half of that sample is the important half: the risk in this build is not the calls that escalated, it is the calls that did not. The sample size and frequency should be set by the practice's clinical lead.
- For each reviewed call, the clinician records on the Weekly Call Review Sample form whether the routing was correct, and any call where BO gave advice, assessed urgency, asked a clinical question or failed to deliver the emergency instruction is a routing incident regardless of outcome. Tag reviewed-by-clinician.
- Branch: if the unclassified-escalated rate is rising, the fix is to widen the non-clinical allowlist only where the clinical lead agrees it is safe. Never to loosen the urgency lexicon or raise the confidence threshold's tolerance. Record the decision.
- Monthly: reconcile every clinical escalation against the chart documentation; review the urgency lexicon with the clinical lead and add any term that appeared in a verbatim and did not match; confirm the On-Call Rotation Calendar for the coming month has no gaps; and test the failover path end to end and record the result.
Stop and exit conditions: none. This workflow is the control that makes the rest of the build acceptable to operate. If the weekly review stops happening, the practice should turn the automated answering off and go back to a human on the phone.
9. Failover and Degraded-Mode Routing
Trigger: platform unreachable; carrier failure; speech recognition failure; internet outage at the practice; or the agent returning errors on consecutive calls.
Actions in order:
- Fail toward a human, always. Configure a carrier-level failover on the main number that forwards to a defined mobile held by the front-desk lead during hours and the on-call clinician outside them. This forward lives at the carrier, outside the platform, so it survives the platform being down.
- If the agent cannot run but calls still connect, serve a static recorded greeting that carries the emergency instruction and the clinical line number, then forward. Never serve a greeting that lacks the emergency instruction, even in degraded mode.
- On detecting three consecutive agent errors, automatically switch the main number to the static greeting plus forward, notify the practice manager and the build owner, and open a routing incident.
- Disable all outbound automated messaging while in degraded mode, so the practice is not texting appointment nudges while unable to answer the phone.
- On recovery, do not auto-resume. A named human confirms the agent is healthy, and the first ten calls after recovery are flagged for review.
- Test the full failover path monthly as part of workflow 8 and record the test result with a date and a name against it.
Stop and exit conditions: service restored and confirmed by a human. Degraded mode is permitted to be inconvenient; it is not permitted to be silent. A phone that rings out is a worse failure than a phone answered by a person reading from a card.