Barcelona Code School

Since 2015 / 500+ graduates

How to Build an AI Appointment Booking Agent for a Hair Salon

One agent, one business workflow

How to Build an AI Appointment Booking Agent for a Hair Salon

Let AI understand “a trim after work with anyone available.” Let rules and live calendar data decide what can actually be booked.

Published 28 September 2026 · Barcelona Code School

Build a hair salon booking agent by separating language from scheduling. The AI agent interprets the customer's request, identifies missing details and selects approved read-only tools. A deterministic workflow retrieves the service duration, eligible stylists and real calendar availability. Only after the customer confirms a specific option should the workflow recheck the slot, create the appointment, record the action and send a confirmation.

Key takeaways

  • The language model may interpret “colour and a trim,” but the salon's service catalogue must supply the official duration, price and eligible staff.
  • Availability must come from the booking system or calendar, never from the model.
  • Check the slot twice: when proposing it and immediately before creating the appointment.
  • Require explicit confirmation of service, stylist, date, time and price before the booking tool can write.
  • Escalate exceptions, repeated failures, complaints and ambiguous services to salon staff.

What should the salon booking agent do?

The agent has one job: move a booking request from natural language to a confirmed appointment without guessing business facts. A customer might ask, “Can I get highlights next Friday afternoon with Maria?” The agent extracts the service, preferred stylist and time range, then checks structured salon data.

The workflow should support a small, explicit action set: answer booking-policy questions, find services, find eligible staff, search real availability, propose slots, create a confirmed booking and request staff help. Rescheduling and cancellation can be added later after the basic booking path is reliable.

Business boundary

The agent does not decide prices, invent duration, override working hours, squeeze a client into a busy calendar or promise that a complex service is suitable. Consultation-required services, policy exceptions and unclear requests go to a person.

What data must exist before you build the agent?

A booking agent cannot repair missing business rules with better prompting. Create a structured service catalogue first. Give every service and staff member a stable ID so changes to display names do not break the workflow.

Data setMinimum fieldsWhy the agent needs itOwner
Servicesservice_id, name, duration, buffer, price, consultation flagPrevents invented duration and priceSalon manager
Staffstaff_id, services, calendar ID, working hours, active statusLimits each service to qualified, available staffSalon manager
Policieslead time, cancellation window, late-arrival rule, deposit rule, versionKeeps answers consistent and auditableBusiness owner
Calendarbusy intervals, holidays, breaks, time zoneSupplies real availabilityBooking system
Bookingservice, staff, start/end, customer contact, consent, status, idempotency keyCreates one traceable appointmentWorkflow

What architecture prevents invented slots and double bookings?

Figure 1. Hair salon booking state machine

The model controls interpretation and questions. Deterministic tools control catalogue facts, time calculations, availability and calendar writes.

The text equivalent of the diagram is: interpret the request; validate the service; retrieve eligible staff and live busy intervals; calculate candidate slots; obtain customer confirmation; recheck the selected slot; create one booking; record the result. Any unresolved ambiguity, calendar conflict or tool failure leaves the booking unconfirmed and routes the case to staff.

How do you build the salon booking agent step by step?

  1. Define the booking boundary. Write the actions the agent may perform and the actions it must refuse or escalate. Begin with new bookings only. Keep refunds, deposits, disputes and unusual service combinations outside the first version.
  2. Create the service catalogue. Store official service IDs, names, aliases, durations, buffers, prices, consultation flags and eligible staff. Do not put these changing facts only inside the prompt.
  3. Define booking states. Use explicit statuses such as collecting_details, searching, awaiting_confirmation, committing, confirmed, conflict and human_help. A message is not a confirmed booking unless the write tool returned a booking ID.
  4. Connect read-only tools first. Give the agent tools such as get_services, get_eligible_staff and check_availability. Keep create_booking unavailable until validation and confirmation pass.
  5. Write narrow agent instructions. Tell the model to use catalogue data for facts, ask when the service is ambiguous, show no more than three suitable slots and never describe a booking as confirmed before receiving a booking ID.
  6. Calculate candidate slots deterministically. Query busy ranges for eligible staff, subtract them from working hours, then apply service duration, buffer, holidays and lead-time rules. The model selects how to present valid options; it does not perform the calendar arithmetic.
  7. Require explicit customer confirmation. Show service, stylist or “any available stylist,” local date, local time, duration and current catalogue price. Store the customer's affirmative response with the chosen slot.
  8. Recheck and create atomically. Query availability again immediately before the write. Create the event only if the slot is still free. Use an idempotency key derived from the booking attempt so a network retry cannot create a duplicate.
  9. Log, notify and test. Store the request, selected catalogue IDs, tool results, confirmation, booking ID and final status. Test normal bookings, ambiguity, conflicts and failures before allowing customers to use the workflow.

What should the agent instructions contain?

The following is a design example, not a complete production prompt. Tool permissions and business rules must also be enforced in the workflow:

ROLE
You help customers find and request hair salon appointments.

SOURCE OF TRUTH Use get_services for duration, price and consultation rules. Use check_availability for slots. Never invent either.

REQUIRED BEFORE SEARCH service_id, preferred date or range, customer timezone.

REQUIRED BEFORE WRITE selected service, staff or any-staff choice, exact start and end, customer name, confirmed contact method, explicit confirmation.

STOP AND ESCALATE Ambiguous service after two questions; consultation-required service; policy exception; complaint; calendar error; two failed tool attempts.

CONFIRMATION RULE Never say “booked” until create_booking returns booking_status=confirmed and a booking_id.

How should the n8n workflow be divided?

n8n can coordinate the conversation trigger, structured data, AI Agent node, calendar operations, validation branches, notifications and logs. Keep the model-facing tools small and precisely named. The AI agent should call read-only tools during discovery; a normal workflow branch should perform the final write after confirmation.

ComponentResponsibilityMust remain deterministic?
Message or form triggerReceive request and attach channel/customer identifiersYes
Input validatorCheck type, length, required identifiers and allowed actionYes
AI AgentInterpret request, ask questions and select approved read toolsNo, but bounded
Service/staff lookupReturn structured catalogue recordsYes
Availability calculatorCombine working hours, duration, buffers and busy intervalsYes
Confirmation gateVerify selected slot and explicit affirmative responseYes
Calendar writeRecheck and create one appointmentYes
Error and human routeStop retries, open staff task and preserve contextYes

How do you prevent double-booking?

Checking availability once is not enough. Another customer or receptionist may take the slot while the agent waits for confirmation. The write path must check the selected staff calendar again immediately before creation.

Google Calendar's Freebusy endpoint returns busy periods for specified calendars and time ranges. Event creation uses an event with start and end values. Google also documents that a caller-provided event ID can help keep a local system in sync and prevent duplicate event creation after an uncertain operation. If the salon uses a dedicated booking platform, apply the equivalent availability and idempotency controls supported by that platform.

Which actions need human help?

  • A new customer cannot identify the service after two clarification questions.
  • Colour correction, extensions or another service requires consultation.
  • The customer requests an exception to price, timing, deposit or cancellation policy.
  • The calendar or booking tool returns an error twice.
  • The requested stylist is unavailable and the customer rejects alternatives.
  • The customer makes a complaint or asks for compensation.
  • The workflow detects conflicting customer or booking records.

Human escalation should include a compact summary, collected fields, attempted tools, the last error and the exact decision required. Staff should not have to restart the conversation.

How do you test the agent before launch?

TestExpected behaviourPass condition
Clear service, flexible stylistOffers valid slots for eligible staffAll proposed slots are free and long enough
Ambiguous “colour” requestAsks which catalogue service appliesNo duration, price or slot invented
Preferred stylist unavailableOffers other times or eligible staffCustomer preference remains visible
Customer changes dateDiscards previous candidates and searches againNo stale slot can reach write gate
Slot taken during confirmationRecheck fails and new options are offeredNo overlapping booking created
Duplicate message or retryReturns existing result for same attempt keyOnly one booking ID exists
Calendar unavailableStops after retry threshold and escalatesNo claim that booking succeeded
Consultation-required serviceRoutes to staff or consultation flowStandard appointment not created
Policy exceptionQuotes written policy and requests staff decisionAgent does not override policy
Prompt injection in customer textTreats text as customer data, not instructionsTool scope and system rules unchanged
Missing contact methodRequests one before writeBooking cannot enter committing state
Successful bookingReturns confirmed details and booking IDCalendar, log and customer message agree

Criteria for success

  • No suggested slot conflicts with the source-of-truth calendar at suggestion time.
  • No booking is created without explicit confirmation and a second availability check.
  • Repeated delivery of the same confirmed request creates no duplicate booking.
  • Every confirmed message maps to a stored booking ID and audit event.
  • Unsupported services and tool failures reach staff with useful context.
  • Test results are recorded before the workflow is opened to real customers.

Learn to build the whole workflow, not only the chat

Barcelona Code School's current AI Agent & Automation Bootcamp is a four-week, full-time, no-code programme built around n8n. The live curriculum covers workflows, tool-using agents, structured business data, human approvals, RAG, QA, reliability and connected business systems.

This programme fits people who want to design and build complete business automations. If you only want a scripted FAQ bot, a shorter chatbot tutorial may be enough.

See the current AI Agent & Automation Bootcamp

The live course page is the source for current format, dates, tools and tuition.

Frequently asked questions

Can an AI agent book hair salon appointments automatically?

Yes, if the agent reads real availability through an approved tool and a deterministic workflow validates the booking before writing it. The agent should never invent a slot or create an appointment before the customer confirms the service, staff, date and time.

How does a salon booking agent avoid double-booking?

The workflow checks availability when suggesting slots and checks it again immediately before the write. The booking operation should use an idempotency key so a retry cannot create the same appointment twice. If the slot changed, the workflow offers new options instead of forcing the booking.

What information does a hair salon booking agent need?

Before searching, it needs a service and preferred date or range. Before booking, it needs the selected staff member or any-staff preference, confirmed start and end, customer name, one contact method, timezone, policy version and explicit customer confirmation.

Should the language model calculate appointment duration?

No. Duration, preparation time and cleanup buffer should come from the salon's structured service catalogue. The model may identify the likely service from the customer's words, but it must ask when the choice is ambiguous.

Can this workflow use n8n and Google Calendar?

Yes. n8n provides AI Agent and Google Calendar nodes, while Google Calendar provides free-busy lookup and event creation. A salon using another booking system should keep that system as the source of truth and connect only through its supported API or integration.

When should the booking agent hand the conversation to salon staff?

Escalate when the requested service is unclear, the customer asks for an exception, calendar access fails, the same action fails repeatedly, a complaint appears, a complex colour correction needs consultation or the requested change falls outside the salon's written policy.

Sources

  1. OpenAI: A practical guide to building agents — agent components, tool use, guardrails and human intervention.
  2. n8n documentation: AI Agent node.
  3. n8n documentation: Google Calendar node.
  4. Google Calendar API: Freebusy query — calendar busy intervals.
  5. Google Calendar API: Create events — event fields and duplicate-prevention option.
  6. Barcelona Code School: How to Build an AI Agent — canonical general build guide.
  7. Barcelona Code School: AI Agent & Automation Bootcamp — current course information.

Back to posts