Skip to main content

Recipe: Post-discharge voice follow-up call

Goal: after a patient goes home, an automated assistant phones them, confirms who they are, asks a fixed set of recovery questions (pain, wound, fever, medication) and records the answers. If anything worries the patient or the assistant, a clinician callback task is created. If nobody answers, a retry task is created.

The workflow: an input supplies phone, language and patient; the Call Patient node places the call; conditions then draft a note, create an urgent clinician callback task or create a retry task; every call is audited.

Before you start​

You needDetail
Telephony set up by an operatorVoice runs through a carrier (Twilio is the only one implemented). It is configured by your Tietai operator with deployment settings, not in the application. If it is off, the Voice Workflows page cannot place calls.
A number you may call fromA caller ID in E.164 format (for example +34910000000) assigned to your organization.
An EU-resident voice engine for clinical callsA call with the clinical profile is refused on an engine that processes outside the EU.
An organization-owned agentA base-template agent will not run. Copy voice-clinical-followup into your organization first (Create an agent).
A FHIR server for the TasksIn the ready-made definition the two Task nodes take their server and token from the placeholders {{FHIR_BASE_URL}} and {{FHIR_BEARER_TOKEN}}. Check that they resolve in your deployment, or no Task is written
PermissionsApps → Voice Workflows appears only with the voice-screening permission. Editing the workflow in Studio needs workflow permissions.
The right to call this numberNothing in the platform checks consent to be called. Only consent to record is enforced. Confirm the right to call before you place a call.

Place a call with the ready-made workflow​

The development environment has two ready-made workflows: Post-Discharge Voice Follow-Up and Wearables Wellness Check-In (they are saved pipelines, not part of every organization automatically; the list below shows only the pipelines of your organization that contain a voice-call node).

  1. Open Apps → Voice Workflows.
  2. Under Workflows (Pipelines of your organisation that place a call), choose Post-Discharge Voice Follow-Up. If the list is empty, the page says "No workflow with a voice-call node yet. Build one in Studio and it appears here."
  3. Fill in Call details. There is one field per input of the workflow, and required fields carry *:
FieldExampleNotes
Patient name *Test Patient AUsed in the greeting
Patient id *the FHIR Patient idLinks follow-up tasks to the patient. It is not placed in the prompt sent to the voice vendor
Phone *+34600000000E.164, with country code
Languagees-ESDrives speech recognition and the voice. A wrong value gives a nonsense transcript
Discharge date2026-09-15Optional context
  1. Choose Place call. The button is disabled until the required fields are filled.
Do not use the play button on a Studio workflow card

In the Studio workflow list, the play button on a workflow card runs it with no inputs and dials the built-in demo defaults. Always use the Call details form on this page, or Run with inputs in Studio.

Follow the call​

The centre card is titled Call to <number> and shows a status: Queued, Ringing, In progress, Completed, Transferred to a clinician, No answer, Busy, Rejected, Failed or Canceled. The Transcript tab shows the conversation as Assistant and Patient bubbles. Recent calls (right) lists your organization's calls; a triangle marks a call where the assistant asked for a clinician.

Review the outcome​

Open the Outcome tab. It shows a warning if the assistant asked for a clinician, the answers Captured during the call, and What the workflow did next:

What happened on the callWhat the workflow does
The patient spoke and confirmed their identityAn agent drafts a clinical note from the transcript, shown as Draft clinical note with "Written by the workflow from the transcript. Review before it reaches the record."
An escalation was requested (chest pain, breathing difficulty, a bleeding or opening wound, a medication or "is this normal?" question, distress, a request for a person, contradictory answers)A FHIR Task: priority urgent, code clinician-callback, linked to the patient. The assistant also transfers the call to your clinical team number
Nobody answered (no answer, busy, rejected, voicemail)A FHIR Task: priority routine, code retry-call
Every callAn audit record (clinical_followup_call) with the outcome

Read the tasks from your FHIR server with Task?patient=<patient id>.

Build or adapt your own​

Follow the general method in Build any workflow. The voice-specific parts are below.

The nodes​

Node idTypePurpose
pipeline-inputinputThe form: phone, language, patient_id, patient_name, discharge_date. Required: phone, patient name, patient id
call-patientvoice-callPlaces the call and waits for it to end
should-document then draft-notecondition, agent-runWhen the call is documentable, draft a note
needs-human, build-task, create-taskcondition, transform, fhir-crudWhen escalation_requested, create the urgent Task
unreached, build-retry, create-retrycondition, transform, fhir-crudWhen answered is false, create the retry Task
audit-callauditAlways record the call
followup-resultoutputReturn the audit result and the drafted note

Wire each condition to the node's declared ports (field, context). Keep the audit edge ungated so every call is recorded.

Settings of the voice-call node​

Setting (label)ExampleMeaning
from (Caller ID){{CLINIC_CALLER_ID}}Caller ID. It must belong to your organization
profile (Risk Profile)clinicalApplies the clinical safeguards (an EU engine is required)
agent_id (Agent)voice-clinical-followupThe organization-owned agent that conducts the call
language (Language)es-ESA BCP-47 language code
timezone (Time Zone)Europe/MadridIANA zone of the person called. Decides the {{GREETING}} ("Buenos días", "Buenas tardes", "Buenas noches") in the opening line. Empty falls back to the deployment default, then to the dialled country if it has a single time zone; if the hour cannot be established the greeting names no time of day. Spain and Portugal cannot be resolved from the dial code (Canary Islands, Azores), so set it
transfer_to (Transfer Destination){{CLINICAL_TEAM_NUMBER}}Where an escalated call is transferred
max_duration (Max Duration (seconds))600Seconds
machine_detection (Detect Answering Machine)trueDefault false. Report when the carrier believes voicemail answered, so it is recorded as no answer
wait_for_completion (Wait For Completion)trueHold the workflow until the call ends
record (Record Call)falseRecording is off by default. Turning it on requires a consent_script
first_message (Opening Line)"Hello, this is the automated assistant of {{CLINIC_NAME}}, on behalf of your care team..."The first sentence. The ready-made line says the caller is automated, and the agent's own instructions require that disclosure, so keep it in any line you write
outcome_schema (Outcome Schema)a JSON SchemaThe answers you require

Values in {{...}} such as {{CLINIC_CALLER_ID}}, {{CLINICAL_TEAM_NUMBER}} and {{CLINIC_NAME}} are filled by your deployment, or you can type the real value into the node.

Write the script​

A call has four parts:

  1. The questions. The agent's question set: identity, a good time to talk, pain, wound, fever, medication, anything else. Start with an inline prompt on the node while you iterate and move it to the agent when it is stable.
  2. The required answers. The outcome_schema. Define it first. Each field's description is read by the model, so write it as an instruction. The ready-made version requires identity_confirmed, pain_controlled, wound_concern and taking_medication.
  3. Facts for this call. The context input: short readable text about the patient, not a record dump.
  4. The first sentence. first_message.

To change a base-template agent you ship in voice-clinical-followup.yaml, raise its version: at boot a lower or equal version is skipped.

Choose how it starts​

StartHow
By handApps → Voice Workflows → Place call
By APIRun the workflow with {"pipeline_id": "...", "inputs": {"phone": "...", ...}} (see the API reference)
On a timerA scheduler node
On a FHIR eventAn fhir-webhook node
No ready-made "after discharge" trigger

The ready-made workflow starts from its input form. A timer (a scheduler node, which Schedule in the Run menu adds for you) runs a workflow without inputs, and a run without inputs dials the input node's demo defaults. No shipped workflow fires when a patient is discharged or maps a patient's phone number from a FHIR event into the call. If you build one, test it carefully and keep a person in the loop.

Test it on yourself​

  1. Put your own number in the form, with the right language.
  2. Place the call and answer. Check that the greeting says it is automated and that it asks for your identity first.
  3. Say "I have chest pain" and check that the call escalates and an urgent Task appears.
  4. Place another call and do not answer. Check that a retry-call Task appears.
  5. Do not count on Dry run to avoid dialling: in the Builder it saves and runs exactly like Run (it follows the Live/Test toggle). Test the wiring with your own number.

Safety rules the assistant follows​

  • It collects and escalates only. It does not interpret symptoms, advise or state urgency.
  • Identity first. Nothing clinical is said until the person confirms who they are. A stranger receives no information. A voicemail says only the clinic name and asks for a call back.
  • Anything uncertain escalates: contradictory answers, distress, or anything outside the question list.
  • A person reviews the drafted note and works the Task queue.
  • It reads the transcript, not the audio, so breathlessness, slurring or crying can be missed, and "I'm fine" can mask distress. Broad escalation is the mitigation.

Privacy: the patient id is not placed in the prompt sent to the voice vendor, and tools run inside Tietai with tenant isolation, the PHI guard and audit. Recordings are off by default and expire (30 days unless the deployment sets otherwise). Transcripts are kept indefinitely unless the deployment sets a transcript retention period; both settings belong to the operator.

What is not built​

GapConsequence
No calling windowA call can be placed at any hour, including at night
No automatic re-dialretry-call Tasks accumulate and nothing consumes them. Someone must work the queue
No consent or do-not-call checkYou must verify the right to call each number
No owner on the tasksDecide who monitors clinician-callback and retry-call
No per-organization voice settingsNumbers and engine settings are deployment-wide
No inbound callsThe platform places calls; it does not answer them

When something goes wrong​

SymptomCauseFix
voice call service is not configured on this deploymentTelephony is not enabledAsk your operator to configure the carrier and the public base URL
to (or phone) input is requiredThe workflow ran with no inputsUse the Call details form or Run with inputs
The run stays waiting after the call endedThe carrier's call-end notice did not arrive, or its signature did not matchOpen the run in Monitor and read the recorded error; ask your operator to check the public URL
engine ... processes in us and cannot carry a clinical callThe clinical profile is on a non-EU engineYour operator must configure the EU engine
caller id ... belongs to another organizationThe from number is not yoursUse a number assigned to your organization
A nonsense transcriptWrong languageSet the patient's language code
A gate fails with field 'documentable' not found in inputsA condition is wired to an undeclared portWire it to the declared field or context port

Something unclear? Send documentation feedback by email.