Agent Studio is the visual builder where you wire together triggers, knowledge bases, AI reasoning steps, and concrete actions to create AI agents that do real work. The fastest way to understand it is to build one. We are going to build a Cancellation Rebooker — an agent that detects a same-day cancellation, finds the patient a new slot that actually fits their preferences, and sends a personalized rescheduling text within a minute of the cancellation hitting your calendar.
This is one of the highest-ROI agents you can build. Most practices lose the cancellation revenue because the slot sits empty and nobody chases the patient. This agent fills the gap automatically.
Before you start
You need three things in place:
- A connected calendar (scheduling provider linked under Settings → Integrations).
- A Knowledge Base that contains your scheduling rules, provider availability windows, and common patient preferences. If you do not have one, see Knowledge Bases.
- An A2P 10DLC-registered phone number for outbound SMS.
If any of those are missing, fix them first. The agent will technically build without them but it will not do anything useful.
Step 1: Create the agent
Open Agent Studio, click New Agent, name it Cancellation Rebooker, and pick the blank canvas template. You will see an empty workspace with a node palette on the left: Triggers, Knowledge, Reasoning, Actions, Conditions, Human Handover.
Drop a Trigger node onto the canvas to start.
Step 2: Configure the trigger
Click the trigger node. From the event type dropdown, pick Appointment Cancelled. Set the filter:
- Time window: Cancelled within 24 hours of the original appointment start.
- Cancellation source: Patient-initiated (we do not want to chase patients the practice cancelled on).
- Appointment status: Was confirmed (we are not chasing no-shows here — different agent).
Save. This trigger now fires every time a patient cancels a same-day or next-day appointment.
Step 3: Add a Knowledge Base lookup
Drop a Knowledge Base node and connect it to the trigger. In the configuration:
- Knowledge Base: Select your
Scheduling RulesKB. - Query template:
Available slots for {{appointment.provider}} in the next 14 days, prioritizing {{patient.preferred_days}} and {{patient.preferred_times}}.
This pulls a filtered list of real openings, not generic ones. The patient’s preferences come from their profile if you have collected them; if not, the query falls back to the next 5 open slots.
Common pitfall: if your KB does not include the provider availability calendar, the agent will hallucinate slots. Always verify the Retrieval Tester in the KB returns real slots before connecting it to an agent.
Step 4: Add the AI Reasoning step
Drop a Reasoning node. This is where the LLM picks the best alternative and drafts the message. Configuration:
Model: Default (the platform’s healthcare-tuned model, BAA-covered).
System prompt:
You are a friendly scheduling assistant for {{practice.name}}.
A patient just cancelled their {{appointment.service}} appointment with
{{appointment.provider}} on {{appointment.date}}.
From the available slots provided, pick the 2 best alternatives based on:
1. Closeness in day-of-week to the cancelled slot
2. Similar time of day
3. Soonest availability
Draft a warm, brief SMS (under 320 characters) that:
- Acknowledges their cancellation without guilt-tripping
- Offers the 2 alternative slots clearly
- Provides a one-tap reschedule link: {{reschedule_link}}
- Ends with an opt-out instruction (Reply STOP to unsubscribe)
Do not include medical advice. Do not reference the reason for cancellation.
Input variables: appointment, patient, available_slots (from the previous node).
Output: draft_message, selected_slots.
Step 5: Add the SMS action
Drop a Send SMS action node. Configuration:
- To:
{{patient.phone}} - From: Your A2P-registered number.
- Message body:
{{draft_message}} - Delay: 60 seconds after trigger fires (gives the patient a moment to breathe — texting them in 3 seconds feels predatory).
Step 6: Add a conditional human handover
Drop a Condition node before the SMS action. Configure:
- If
patient.do_not_textis true → branch to Human Handover node (creates a task for the front desk to call manually). - If
patient.cancellation_count_30d > 3→ branch to Human Handover (this patient may need a real conversation, not another text). - Otherwise → continue to SMS.
This is the boring guardrail that separates an agent that runs in production from one that gets unplugged after a week.
Step 7: Test in the sandbox
Click Test Run in the top-right. Pick a real (or sandbox) cancelled appointment from the last 7 days. The agent runs end-to-end without actually sending the SMS, and you see each node’s input and output in the run log.
Things to verify:
- The Knowledge Base returned real slots, not made-up ones.
- The reasoning node picked sensible alternatives (not 6 weeks out when there is an opening tomorrow).
- The draft message reads like something a human would send.
- The condition branches behaved correctly for edge cases (test a patient with
do_not_text = true).
Iterate on the system prompt until the drafts feel right. This usually takes 10-15 test runs.
Step 8: Enable in production
Flip the agent to Live. Watch the run log daily for the first week. Look for:
- Wrong slot suggestions → tighten the KB query or add filters.
- Tone misses → refine the system prompt with examples.
- Patients replying confused → add a follow-up branch that hands replies to your Conversation AI.
Common pitfalls
- Skipping the KB validation. If your KB is stale, the agent confidently offers slots that do not exist.
- No opt-out language. Carriers will flag your messages and your A2P registration will get suspended. Always include STOP.
- No human escalation path. Agents that have no exit hatch break in the cases they cannot handle.
- Over-engineering on day one. Ship the simple version, watch real runs for a week, then add branches. Do not pre-build 14 edge cases.
Where to go next
Once the Cancellation Rebooker is running, the next two agents to build are usually a Recall Outreach agent (lapsed patients) and a First-Visit Welcome agent (new patient onboarding sequence). Both follow the same pattern: trigger → knowledge → reasoning → action → guardrail.
Explore Agent Studio, connect your Knowledge Bases, or read Build Your Own AI Agent for the full reference.