Book a government service appointment through AI chat
Workflow purpose
This guide demonstrates how to use Proto's AI agent to let citizens book an in-person appointment for a government service – a national ID card, a passport, a driving licence, a business registration – at the office that suits them.
The workflow shows the services that need an appointment, tells the person exactly which documents to bring for that service, lets them choose an office and a time from your booking system's live availability, and confirms the booking with a reference. People can come back to reschedule or cancel, and when an office has no free slots they're added to a waitlist instead of being turned away.
Many wasted trips to government offices come from a missing document or a queue with no end. Checking requirements before the booking, and giving each visitor a fixed time, means fewer people are sent home and fewer queues form at the door.
Who can benefit from this guide:
- National identity, passport and civil registration agencies
- Licensing and vehicle registration offices
- One-stop government service centres
- Local and municipal governments with walk-in service counters
- Digital government teams moving services onto messaging channels
Book a government service appointment
This workflow checks requirements, books a slot at the chosen office and manages changes 24/7. See how to build a government appointment workflow.
1. Create a trigger
Start the flow when a citizen asks to book a visit to a government office.
- Navigate to the Workflows tab in the AI agent settings.
- Click New workflow and select Message received as the Workflow type.
- Name the trigger (e.g. “Book Appointment”) and add a short description (e.g. “Triggers if user wants to book an appointment or visit an office for a government service such as an ID card, passport, licence or registration.”).
- Add training phrases (e.g. “Book an appointment”, “I need to renew my passport”, “When can I go for my ID card”, “Book a slot at the licensing office”).
Create a second trigger, “Manage Appointment”, for people who already have a booking – it’s set up in Step 8.
2. Show the services that need an appointment
Let the person pick a service from cards instead of typing its official name.
Add a Show carousel action with one card per service, up to 10 cards. For each card:
- Image: an icon or photo for the service
- Title: e.g. “National ID card”
- Description: e.g. “New card, renewal or replacement”
- Button: type Send Message, text “Book this”, message Book National ID card
Under each card, add a Message received sub-trigger with the card’s message and similar phrases (e.g. Book National ID card, ID card, identity card), so a person who types the service still reaches it. If you offer more than 10 services, show a first carousel of categories – Identity and travel, Vehicles and licences, Business – and a second carousel of services under each.
Some services don’t need a visit. If a service can be completed online, send a Send message with the link to your e-services portal under its sub-trigger instead of continuing to a booking.
3. Show what to bring
Make sure people arrive with every document the service needs – the most common reason a visit is wasted.
Under each service sub-trigger, add a Set variable action to store service_name and service_code, the code your booking system uses for that service. Then add a Send message with the checklist for that service, for example:
“For a National ID card renewal, please bring: – your current ID card – your birth certificate (original) – 2 passport-size photos – proof of address dated within the last 3 months The fee is paid at the office.”
If you publish a printable checklist, add a Send attachment action with the PDF.
Add quick reply options: I have everything | I’m missing a document | Ask a question.
- Under I’m missing a document, add a Send message explaining where to get the most common missing documents, then ask whether to book anyway with quick replies Book anyway | Not now.
- Under Ask a question, the AI agent answers from your Knowledge base – add each service’s requirements, fees and eligibility rules there as a File or URL, so questions such as “Can I bring a copy of my birth certificate?” are answered from your official guidance.
4. Choose an office
Show only the offices that provide the chosen service.
Add an Ask survey action. Action title: Office
| Field | Variable | Type | Invalid reply |
|---|---|---|---|
| Which district or town are you in? | district |
Text | Please enter your district or town |
Then add a Send API action:
- HTTP method: GET
- URL endpoint: your booking system’s offices endpoint, passing
service_codeanddistrict - Headers: the authorisation key your system requires
- Resulting variable:
offices
Under Success, add a second Ask survey field – “Which office would you like to visit?” (office, Text) – with quick replies {offices[0]["name"]}, {offices[1]["name"]} and {offices[2]["name"]}. Quick replies that come back empty are left out, so a district with only one office shows one button.
Under Error and Timed out, send a Send message apologising that booking is unavailable and offering a Live agent handoff (Step 9).
5. Show available times
Offer real, bookable slots from the booking system – never a time the office can’t honour.
Add a Send API action:
- HTTP method: GET
- URL endpoint: your booking system’s availability endpoint, passing
service_codeandoffice - Resulting variable:
slots
Add a Branch action:
- If
_.len(slots) > 0: add an Ask survey field – “Which time suits you?” (slot, Text) – with quick replies{slots[0]["label"]}to{slots[4]["label"]}and a final quick reply None of these, wherelabelis a readable date and time such as Tue 2 Dec, 09:30. Under a sub-trigger for None of these, call the availability endpoint again for the following week. - Else: continue to Step 9 to add the person to a waitlist.
6. Collect the applicant’s details
Ask only for what the office needs to find the booking on the day.
Add an Ask survey action. Action title: Applicant details
| Field | Variable | Type | Invalid reply |
|---|---|---|---|
| Full name, as it appears on your documents | full_name |
Text | Please enter your full name |
| National ID or application number | id_number |
Text | Please enter your ID or application number |
| Phone number | phone |
Phone | Please provide a valid phone number |
| Email (for your confirmation) | email |
Please provide a valid email address |
Turn Enable skip on for email, as many people don’t have one. For first-time applicants with no ID number yet, accept a birth certificate number instead.
7. Confirm and book
Let the person check everything, then hold the slot.
Add a Send message that plays the booking back:
“Please check your booking: {service_name} at {office}, {slot}, for {full_name}. Shall I confirm it?”
Add quick replies: Confirm | Change the time. Under Change the time, add a Jump action back to Step 5.
Under Confirm, add a Send API action (HTTP method: POST) to your booking system’s bookings endpoint, sending service_code, office, slot, full_name, id_number, phone and email. Resulting variable: booking.
- Success: send a Send message – “You’re booked. Your reference is {booking[“reference”]}. Please arrive 10 minutes early at {booking[“office_address”]} with the documents on your checklist.“ Then repeat the checklist from Step 3.
- Error: if the slot was taken while the person was deciding, say so and Jump back to Step 5 to show fresh times.
- Timed out: add a Create ticket action so staff can complete the booking by hand, and tell the person they’ll be contacted.
Ask people to keep their reference. If you’d like to send a reminder before the visit, do it from your booking system by email – the AI agent only messages people first on Webchat.
8. Reschedule or cancel
Let people change a booking themselves, so cancelled slots go back to someone else.
Under the “Manage Appointment” trigger (training phrases e.g. “Change my appointment”, “Cancel my booking”, “I can’t make my appointment”), add an Ask survey action. Action title: Find booking
| Field | Variable | Type | Invalid reply |
|---|---|---|---|
| Booking reference | booking_ref |
Text | Please enter the reference from your confirmation |
| National ID or application number | id_number |
Text | Please enter the number you booked with |
Add a Send API action (HTTP method: GET) to look the booking up, with resulting variable booking. If it’s found, add a Send message – “Your {booking[“service_name”]} appointment is at {booking[“office”]} on {booking[“slot”]}. What would you like to do?“ – with quick replies Reschedule | Cancel | Keep it.
- Reschedule: add a Set variable action to set
service_codeandofficefrombooking, then a Jump action to Step 5. When the new slot is confirmed, your booking system releases the old one. - Cancel: ask “Are you sure?” with quick replies Yes, cancel | No. On Yes, cancel, add a Send API action to your cancellation endpoint, then confirm: “Your appointment {booking_ref} is cancelled.”
If the reference and ID number don’t match a booking, say so and offer to try again once before handing over to a live agent.
9. Add people to a waitlist when no slots are free
Don’t leave people with nowhere to go when an office is fully booked.
Under the Else branch from Step 5, add a Send message:
“There are no free appointments at {office} for {service_name} right now. I can add you to the waitlist, and the office will contact you when a slot opens.”
Add quick replies: Join the waitlist | Try another office. Under Try another office, Jump back to Step 4. Under Join the waitlist, collect the details in Step 6, then add a Create ticket action:
- Assignee: the bookings team for that office
- Subject: Waitlist – {service_name} – {office}
- Description: name, ID number, phone, email and district
- Full name, Email and Phone number: the applicant’s details
- Auto-apply tags: waitlist, plus the service (e.g. id-card), so you can see where demand outstrips capacity
- Email template: a confirmation to the person with their waitlist reference
Then send: “You’re on the waitlist. Your reference is {_new_ticket.short_id}.” Staff reply from the ticket in the Inbox when a slot opens. To stop waitlist tickets being forgotten, check the teamspace’s overdue rule in Settings › Tickets › Overdue rules – it applies to every ticket. With Apply overdue status after set to 5 days and Exclude weekends on, a waitlist ticket still open after a working week is marked overdue.
For anything the AI agent can’t resolve – a lost reference, an urgent travel date – add a Live agent handoff action assigned to the bookings team, with Live agent availability check turned on.
10. Test the flow
Validate every path before going live using the AI agent tester side panel.
- Book each service and check the right document checklist appears and the booking reaches your system with the right service code.
- Choose a district with one office and one with several, and confirm the office buttons match.
- Take a slot in your booking system while a test booking is open, and confirm the person is shown fresh times.
- Reschedule and cancel a test booking, and check the old slot is released.
- Book an office with no availability and confirm a waitlist ticket is created with the right tags.
- Build and test in an undeployed version – Duplicate the live version first – then Deploy it once every path passes.
Finalise the AI agent deployment by configuring your preferred channels and languages.
.png)