A customer types one sentence. The bot turns it into a confirmed Google Calendar appointment: it asks for a name, works out the date in code, shows the full date and year, and writes nothing until the customer says “yes”. An LLM reads the message; deterministic rules make every decision.
Live since 1 November 2026 — anyone can book on the real engine.Real n8n, real Postgres, real Claude calls, real events on the demo’s own Google Calendar and real owner alerts. Only the salon, its prices and its customers are fictional.
A config-driven booking and lead-capture chatbot for a salon, built as a resellable template: one isolated deployment per client, where a new client means a new config file and new credentials — not new code. Its architecture was approved on 29 June 2026; the public demo went live on 1 November 2026.
It is a demo / learning build: no paying client and no real customers. The salon — “Demo Barber Co.”, its services, prices and hours — is mock config. The engine behind the chat is the real one.
I directed it end to end — every phase plan, every ruling, every live test. The code was written by AI coding agents under that direction: Claude Code implemented, Codex audited independently, and a separate AI workspace drafted briefs and reviews and ran some of the live tests at my request. “How this was built” below says exactly who did what.
Stated limits, not hidden ones: the WhatsApp lane is built but closed and not tested end to end on the current store; the booking race is bounded, not locked; a widget customer is identified by a browser session, not a verified identity; dates are English-only within a 30-day horizon; a second client has only been rendered offline.
Most chatbot demos let the model talk. This one treats the model as a translator and puts every decision that touches a calendar behind code.
The LLM returns one JSON object: one of eight allow-listed intents plus slots. It never writes the customer-facing reply, never chooses an action and holds no write permission. Prices come from config — so the bot cannot quote a wrong price.
“4 November”, “Wednesday 4 November”, “4.11”, “this Wednesday” — the engine works out the day in the shop’s timezone. The model’s own date has no authority. A weekday that doesn’t match is named back, never guessed.
The confirm shows service, full date with year, time and name. A “yes” only counts for the confirm it answers: ask a question in between and the confirm is shown again — nothing is booked on a stale yes.
Google Calendar is the source of truth. The bot writes the event, re-reads the slot, and on a lost race withdraws its own event; if that re-read fails, the owner is alerted. A message delivered twice is claimed once and answered once.
Every external call has an error branch with its own flag and a Telegram alert to the owner. If the spend meter cannot be read, the bot fails closed: it hands off instead of calling the model.
Business hours, services, prices, message templates and limits live in one config. A second client is rendered from config offline, and tests hold that render to the committed workflow — a demonstrated render, not yet a second deployment.
The customer sees a chat. Behind it, the engine decides, the calendar changes and the owner’s phone buzzes. Tap a message to send it. Every turn shows what the model returned, what the code then decided, and what got written.
This board is connected to the conversation above. Hand a chat to a person up there and it lands here; release it here and the bot answers again up there — the release itself is announced on the owner’s Telegram. A booking made above shows up under “Coming up”. The real dashboard sits behind Cloudflare Access, listens on 127.0.0.1 only and reads the database through a SELECT-only role.
No bookings today.
Masking happens on the server before anything reaches the browser: “Anna Maria Schmidt” → “Anna M. S.”, “+43 660 0000067” → “+43…67”, a widget session id → its first six characters.
The repository carries two client configs. Send both shops the same five messages. The logic is the same; everything that differs — name, services, prices, hours, wording — comes from config, which a renderer writes into ten marked slots of the workflow.
Why this matters: a new client is a config file and new credentials, not new code. The renderer may only touch its ten marked slots (config literals, alert chat ids, the bot-check secret, few-shot examples); a test fails if anything else in the rendered workflow differs from the one the tests and audits checked.
No customers to point to. What there is: a log of 240 dated decisions. Here are the six I’d defend in an interview, each with the road not taken.
The model may only return intent JSON from an allow-list; routing is IF/Switch, replies are config templates or code-built from config data, the date is computed in code. Rejected: an advisory resolver the model could bypass — an early audit found four HIGH findings with that one root cause — and asking the model for prices.
Google Calendar holds availability. The bot inserts the event, re-reads the slot, and only a won slot is mirrored to Postgres; on a lost race it withdraws its own event and hands off. Rejected: assuming a lock exists where none does.
Every inbound message is claimed with INSERT … ON CONFLICT (message_id) DO NOTHING before any work. A duplicate delivery cannot double-book. Rejected: record-before-respond (slower, still racy) and simply documenting the risk.
The free Airtable quota could not carry even the system’s own idle consumption: it ran out on 6 October 2026 and the bot had no data layer for about twelve days. Migrated to self-hosted Postgres with a nightly backup that is restored and compared before it counts. Rejected: staying on Airtable — waiting for the quota reset or changing plan.
After four audit rounds found new ways a model can drop part of a date, a rule set in advance kicked in: no fourth adjustment — the rule is frozen and the design changes. The defence became structural — the full date and year in the confirm, a 30-day horizon, no write without “yes”. Rejected: full text-side coverage that re-asks harmless messages.
The privacy page names a controller and a contact, the legal basis (GDPR Art. 6(1)(f)), every retention period and every processor. The README keeps a table of what is real and what is demo, and a list of what is not built. Rejected: a polished page that implies customers.
The demo is public and every message can cost money. Every way it could run away is capped, measured or switchable.
Cloudflare Turnstile in Managed mode, interaction-only: the box appears only when Cloudflare asks. The engine verifies every widget token; a fake one gets 403.
30 requests per 10 seconds per IP and data centre on the webhook path. Measured: 40 requests in 2.4 s — requests 31 to 40 were blocked with 429.
A monthly LLM budget ($10 in the demo config) is checked before every call. If the meter cannot be read, the bot hands off instead of calling the model.
A config kill switch and a 12-turn limit per conversation run in the guard block, before any paid call. A tripped guard costs nothing.
Low confidence twice, a refusal to give a name twice, or a date that can’t be resolved twice → a person takes over. Until the owner releases it, the bot only says “A team member is already helping you here — they'll reply shortly.”
Message text in conversations is erased after 30 days; callback requests too, behind a safety limit that refuses to delete a suspicious share at once. Bookings and owner alerts are deleted on request. Backups expire after 14 days.
From Phase 7 on, every audit target went to Codex in a sandbox, with the prompt and the raw answer committed. Findings were fixed, or ruled as a bound in writing — never silently dropped.
| Round | Date | Scope | Findings | Outcome |
|---|---|---|---|---|
| Phase 7 · round 1 | 25 Oct | Nine critical-review targets | 12 HIGH · 15 MED · 4 LOW | Fixed across two rechecks, then shipped live |
| Phase 8 | 28 Oct | Rendering a new client from config | 4 MED · 2 LOW | Five fixed, one ruled a bound |
| Public demo | 29 Oct | Spend brake and retention | 2 MED | Fixed with tests and mutants |
| Name capture · 3 rounds | 1 Nov | The name across turns, the sanitiser, the privacy wording | 2 MED · 2 LOW | All fixed |
| Date phrasing · R1–R3 | 1–2 Nov | The calendar-date resolver | 8 HIGH · 8 MED | Fixed; stop threshold declared |
| Date phrasing · R4–R6 | 2 Nov | Same class, then the structural defence | 6 HIGH | Stopped by the rule; structure + recorded bounds |
| “no” at the confirm · 2 passes | 3 Nov | The decline path | 1 MED · 3 LOW | Fixed; last LOW recorded under the two-pass cap |
| Close-out · 2 passes | 3 Nov | Confirm freshness, alerts, dashboard | 1 HIGH · 2 MED · 3 LOW | The HIGH ruled a bound and pinned by a test |
Eighteen recorded rounds, 41 verbatim answer files under docs/codex/. Counts are each row’s own passes; the two Phase 7 rechecks are folded into the outcome.
Self-hosted where the data lives, managed where it doesn’t need to be.
No recreations in this section. Every frame below is a capture of the running system — only cropped and resized. Click to enlarge.

The real board, captured on 127.0.0.1 with one synthetic conversation in the queue. The sender is masked to its first six characters; “notification NOT confirmed” because no alert was ever sent for a seeded row.

The customer wrote “Wednesday 12 November”. The engine names the conflict and asks — then asks for the name.

“Haircut, Thursday 12 Nov 2026 11:00 for Kim Moss — shall I book it?” A “no” books nothing and asks what to change.
Chats: the public demo, 5 November 2026 · synthetic name · shop time (Europe/Vienna). Dashboard: the real board, seeded with synthetic rows for the capture and cleaned afterwards.
Building with AI agents is the skill this project demonstrates — so the roles are written down, and nothing counted as done until something other than its author had checked it.
Goals, scope and every ruling; approved each phase plan; ran live tests myself and ordered the rest; created every credential by hand.
A separate AI workspace that drafted the architecture and each round’s brief, verified results against the committed code, and — at my request — ran two live test scripts and changed some Cloudflare and Vercel settings.
Wrote the workflows, frontends, guards, tests and docs; ran a security auditor before every push.
A second model that did not write the code, run in a sandbox; from Phase 7 on its prompts and raw answers are committed.