Skip to content

Instantly share code, notes, and snippets.

@bensteadybow
Created February 23, 2026 17:50
Show Gist options
  • Select an option

  • Save bensteadybow/4e29dfc15545098dfc73e053febbeef0 to your computer and use it in GitHub Desktop.

Select an option

Save bensteadybow/4e29dfc15545098dfc73e053febbeef0 to your computer and use it in GitHub Desktop.
This is the large, complex example Mermaid JSON for an AI Receptionist - genericised from a real production agent.
```mermaid
flowchart TB
%% ============================================
%% CALL INTRODUCTION & EARLY TRIAGE
%% ============================================
start_call([Call starts — greet with opening line]) -->
early_triage{EARLY TRIAGE: What type of call is this?}
early_triage -->|Caller submitted a form or email and is chasing a response| form_chase
early_triage -->|Safety emergency or life-threatening situation| critical_escalation
early_triage -->|Chasing an existing quote| quote_chase_start
early_triage -->|Existing customer, returning missed call, has a reference number, or wants a quick message| fast_track_start
early_triage -->|Caller asks to speak to a human or specific team member| wants_human
early_triage -->|New enquiry — wants a quote, booking, or service info| classify_need
early_triage -->|Unclear| clarify_intent
%% ============================================
%% WANTS A HUMAN
%% ============================================
wants_human["Acknowledge: 'I completely understand — let me see what I can do for you.'"] -->
wants_human_check{Is it office hours?}
wants_human_check -->|Yes| wants_human_offer["Offer: 'I can try to put you through, or I can take a quick message — which would you prefer?'"]
wants_human_check -->|No — outside hours| wants_human_outside["Explain team unavailable, offer to take message for first-thing callback"]
wants_human_offer -->|Caller wants transfer| attempt_transfer[Attempt call transfer]
wants_human_offer -->|Caller wants message| fast_track_start
attempt_transfer -->|Transfer succeeds| end_call
attempt_transfer -->|Transfer fails| transfer_failed["'I wasn't able to get through — they're just busy. Let me take your details so they can call you back.'"] --> fast_track_start
wants_human_outside --> fast_track_start
clarify_intent["Ask: 'Are you following up on something existing, or is this a new enquiry?'"]
clarify_intent -->|Existing / follow-up| fast_track_start
clarify_intent -->|New enquiry| classify_need
%% ============================================
%% FORM / EMAIL CHASE
%% ============================================
form_chase["Reassure: 'The team will have received that — let me take your details so I can flag it for a prompt response.'"] --> fast_track_start
%% ============================================
%% CRITICAL ESCALATION
%% ============================================
critical_escalation["IMMEDIATE ESCALATION: Take caller name and location. Log as URGENT. Attempt transfer during office hours. Outside hours: capture everything and reassure caller it will be escalated immediately."] --> end_call
%% ============================================
%% FAST TRACK MESSAGE (Existing / Urgent)
%% ============================================
fast_track_start["Acknowledge: 'I can get a message to the right person straight away.'"] -->
fast_track_name[Collect first and last name] -->
fast_track_phone["'Shall I note the number you're calling from?'"] -->
fast_track_message["Infer message from context — only ask for more detail if unclear"] -->
fast_track_reference[Note any reference number if mentioned] -->
fast_track_urgency{Infer urgency from context — on-site, waiting, deadline = URGENT}
fast_track_urgency -->|Clearly urgent| fast_track_mark_urgent[Mark as URGENT in notes]
fast_track_urgency -->|Not obviously urgent| fast_track_close
fast_track_mark_urgent --> fast_track_close
fast_track_close["Reassure: 'I've noted this down. Someone will be in touch shortly.'"] --> end_call
%% ============================================
%% NEW ENQUIRY CLASSIFICATION
%% ============================================
classify_need{What type of new enquiry?}
classify_need -->|Wants a quote, booking, or specific service| identify_service
classify_need -->|General question| general_query
classify_need -->|Unclear| explain_services
explain_services["Briefly explain what the business offers and ask which service they need"] --> identify_service
identify_service[Identify which service the caller needs] --> quote_offer
%% ============================================
%% QUOTE / BOOKING FLOW
%% ============================================
quote_offer["Explain you can help and offer to take details for a quote or booking"] -->
quote_ask["'Would you like to go ahead with that?'"]
quote_ask --> quote_decision{Proceed?}
quote_decision -->|Yes| quote_begin
quote_decision -->|No — just wants a callback| callback_collect_name
quote_begin["'I'll just need a few details.'"] -->
quote_collect_name[Collect first and last name] -->
quote_confirm_name[Confirm full name by repeating back] -->
quote_collect_address[Collect site or property address] -->
quote_confirm_address[Confirm address by repeating back — first line and postcode minimum] -->
quote_collect_email[Request email — attempt 1] -->
quote_check_email{Did they provide an email?}
quote_check_email -->|Yes| quote_confirm_email[Confirm email by repeating back]
quote_check_email -->|No — refused or unclear| quote_skip_email
quote_confirm_email --> quote_email_correct{Confirmed or corrected?}
quote_email_correct -->|Confirmed| quote_collect_phone
quote_email_correct -->|Corrected — attempt 2| quote_final_email[Confirm corrected email — do NOT ask again]
quote_email_correct -->|Still wrong after 2 attempts| quote_skip_email
quote_final_email --> quote_collect_phone
quote_skip_email["'No problem — the team can confirm that with you directly.'"] --> quote_collect_phone
quote_collect_phone["'Shall I note the number you're calling from?'"] -->
quote_collect_details[Gather job-specific details — description, requirements, preferences] -->
quote_pricing_check{Did the caller ask about pricing?}
quote_pricing_check -->|Yes| quote_defer_pricing["Share standard pricing if available, or explain the team will provide a bespoke quote"]
quote_pricing_check -->|No| quote_next_steps
quote_defer_pricing --> quote_next_steps
quote_next_steps["Explain next steps: details will be passed to the team, and they'll follow up"] --> additional_support
%% ============================================
%% QUOTE CHASE (Existing quote follow-up)
%% ============================================
quote_chase_start[Acknowledge they're chasing a quote — collect name] -->
quote_chase_phone["'Shall I note the number you're calling from?'"] -->
quote_chase_ref[Collect any reference or address to identify the quote] -->
quote_chase_reassure["Reassure: 'The team are working on that — I'll flag your call so they can update you.'"] -->
quote_chase_close["'Is there anything else I can help with?'"] --> end_call
%% ============================================
%% CALLBACK ONLY
%% ============================================
callback_collect_name[Collect first and last name] -->
callback_confirm_name[Confirm full name by repeating back] -->
callback_collect_phone["'Shall I note the number you're calling from?'"] -->
callback_collect_email[Request email — max two attempts] -->
callback_confirm_email[Confirm email — if still unclear after two tries, note for team to check] -->
callback_confirm_details[Confirm contact details and enquiry summary] --> additional_support
%% ============================================
%% GENERAL QUERY
%% ============================================
general_query[Answer the question using reference information] -->
general_check{Would a quote or booking help?}
general_check -->|Yes| quote_offer
general_check -->|No| callback_collect_name
%% ============================================
%% CALL CLOSING
%% ============================================
additional_support[If appropriate, mention other services the business offers] -->
end_call(["Thank the caller and ask if there's anything else before ending the call"])
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment