Booking Manager
An AI assistant layer that sits on top of any booking system, turning your phone into a
full booking management interface via Telegram, WhatsApp, or any supported channel.
How It Works
CODEBLOCK0
Setup
0. First-Run Onboarding
On any booking-related request, check if TOOLS.md contains a ## Business section
AND a ## Services section. If either is missing, this is a first-run — begin
onboarding before doing anything else.
Primary flow (form paste):
- 1. Greet the customer:
CODEBLOCK1
- 2. When the customer pastes the form, parse it for these fields:
| Field | Required | TOOLS.md Section |
|---|
| Business name | ✅ | INLINECODE2 |
| Business address |
Optional |
## Business |
| Phone number | Optional |
## Business |
| Website | Optional |
## Business |
| Timezone | ✅ |
## Business |
| Services (name, duration, price) | ✅ |
## Services |
| Operating hours per day | ✅ |
## Operating Hours |
| Confirmation email (name + address) | ✅ |
## Email |
| Booking/cancellation policy | Optional |
## Booking Policy |
| Existing booking system | Optional |
## Booking Data Source |
| Notification preference | Optional |
## Notifications |
| Mobile number | Optional |
## Notifications |
| Additional notes | Optional |
## Notes |
- 3. Write the parsed config to TOOLS.md:
CODEBLOCK2
- 4. Show a summary for confirmation:
CODEBLOCK3
- 5. Note about data source: "I'll need your booking system connected before I can
see bookings — your admin will set that up for you."
Security: The onboarding flow collects business information only (name, services,
hours, policy). It must NEVER ask for or accept credentials (passwords, tokens, API
keys) through chat. Credentials are configured by the admin directly in openclaw.json
under env. If a customer pastes credentials in chat, do NOT store them — instruct
them to contact their admin instead.
Fallback flow (step-by-step):
If the customer says they don't have a form, collect info conversationally:
- 1. "What's your business called?"
- "What services do you offer? For each one, I'll need the name, how long it takes, and the price."
- "What days and hours are you open?"
- "What timezone are you in?"
- "What email address should booking confirmations come from?"
- "Do you have any booking or cancellation policies?"
- "Anything else I should know about how you run bookings?"
Write to TOOLS.md using the same format and show the same summary.
Validation:
- - Missing required fields → ask specifically: "I noticed [field] is blank — could you fill that in?"
- Ambiguous services (no duration/price) → ask: "How long does [service] take, and what do you charge?"
- Timezone → accept common formats (AEST, Australia/Melbourne, GMT+10), normalise to IANA
- Hours → accept 9am-5pm, 0900-1700, 9:00 AM - 5:00 PM, normalise consistently
Edge cases:
- - Partial form pasted → parse what's there, ask for the rest
- Unrelated text pasted → "That doesn't look like the onboarding form. Try pasting it again, or I'll walk you through setup."
- Customer wants to change after setup → "Sure! Just tell me what to change."
- TOOLS.md already has config → skip onboarding, booking-manager handles normally
The onboarding form template is in references/onboarding-form.md.
1. Identify the data source
Determine how the business stores bookings. Read references/data-sources.md for
connection patterns for each supported platform.
2. Configure credentials
Store connection details as environment variables in openclaw.json under env,
never in plaintext in TOOLS.md or any workspace file. Reference them in TOOLS.md by
name only:
CODEBLOCK4
Never store credentials in plaintext in TOOLS.md, SOUL.md, or any workspace file.
See references/data-sources.md for which environment variables each data source expects.
3. Set up heartbeat polling
Add to HEARTBEAT.md to check for new bookings every 15-30 minutes:
CODEBLOCK5
4. Configure the agent identity
Set SOUL.md with the business context:
CODEBLOCK6
Core Workflows
New booking notification
When a new booking is detected, notify the owner:
CODEBLOCK7
Send an acknowledgement email to the customer. See references/email-templates.md.
Confirm booking
- 1. Mark booking as confirmed in data source
- Remove any booking lock for the customer's email
- Send confirmation email with .ics calendar invite attached
- Notify owner: "✅ Booking #[id] confirmed. Email sent to [name]."
Reschedule booking
- 1. Update date/time in data source
- Remove booking lock
- Delete existing reminder record (so a new reminder sends for the updated time)
- Send updated confirmation email with new .ics
- Notify owner: "✅ Booking #[id] rescheduled to [new date/time]. Email sent."
Delete booking
- 1. Record the customer email before deleting
- Delete the booking from data source
- Remove booking lock
- Optionally send cancellation email
- Notify owner: "🗑️ Booking #[id] deleted."
Schedule queries
Respond naturally to:
- - "What bookings do I have today?"
- "Show this week's schedule"
- "How many bookings this month?"
- "Any new bookings?"
Calendar Invites
Generate .ics files when confirming. See references/ics-format.md for the template
and timezone/DST conversion logic.
Email Sending
Send via Gmail SMTP using environment variables for credentials (never inline).
See references/email-templates.md for HTML templates and the secure sending pattern.
Booking Locks
Many booking systems use a lock/hold mechanism to prevent duplicate pending enquiries
from the same customer. Always release locks when confirming or deleting a booking,
otherwise the customer cannot book again.
Automated Reminder Emails
Send reminder emails to customers 24 hours before their appointment. This feature is
added to the heartbeat/cron polling cycle alongside new booking checks.
Setup
Add a booking_reminders table to the data source to track sent reminders and prevent
duplicates. See references/data-sources.md for the schema.
Add reminder configuration to TOOLS.md:
CODEBLOCK8
The cancel/reschedule option and footer text are entirely business-specific. Some
businesses allow changes up until the appointment; others enforce strict late-cancellation
penalties. Configure per client.
Heartbeat integration
Add to HEARTBEAT.md alongside the new-booking check:
CODEBLOCK9
Workflow
- 1. Query confirmed bookings where appointment time is 23–25 hours from now
- Left-join against
booking_reminders to exclude already-sent reminders - For each unsent reminder:
a. Send reminder email (see
references/email-templates.md)
b. Insert a record into
booking_reminders with the booking ID and timestamp
- 4. Notify the owner with a summary (if any were sent)
Reminder query (Turso/SQLite example)
CODEBLOCK10
Edge cases
- - Polling gaps: The ±1 hour window ensures reminders aren't missed if a heartbeat
runs slightly late or early. The
booking_reminders table prevents duplicates even
if the same booking falls in the window across multiple polls.
- - Already passed: If the agent was offline and missed the 24h window, do NOT send
a late reminder — it's confusing. Only send if the appointment is still >22h away.
- - Deleted/rescheduled bookings: If a booking is rescheduled, the old reminder record
stays (harmless). The new appointment time will trigger a fresh reminder since the
booking ID changes or the UTC time no longer matches. If using the same booking ID
after reschedule, delete the old reminder record when rescheduling so a new one sends.
Adapting to Different Businesses
Customise these per client:
- - Business name and branding in email templates
- Services list with durations (for calendar invite end times)
- Operating hours and timezone
- Booking policy text
- Reminder settings (lead time, cancel/reschedule option, policy footer)
- Data source connection method
预订管理器
一个位于任何预订系统之上的AI助手层,通过Telegram、WhatsApp或任何支持的渠道将您的手机转变为完整的预订管理界面。
工作原理
客户预订 → 数据保存(数据库/API/表格) → 代理轮询新预订
↓
通过手机通知所有者(Telegram/WhatsApp)
↓
所有者回复:确认 / 改期 / 删除
↓
代理更新数据 + 发送邮件给客户
设置
0. 首次运行引导
在任何与预订相关的请求中,检查TOOLS.md是否包含## Business部分和## Services部分。如果缺少任一内容,则为首次运行——在执行任何其他操作前开始引导。
主要流程(表单粘贴):
- 1. 问候客户:
您好!我是您的新预订助手。👋
要开始使用,请粘贴您收到的已完成引导表单,
我将据此进行所有设置。
如果您没有表单,请告诉我,我将逐步引导您完成设置。
- 2. 当客户粘贴表单时,解析以下字段:
| 字段 | 必需 | TOOLS.md部分 |
|---|
| 企业名称 | ✅ | ## Business |
| 企业地址 |
可选 | ## Business |
| 电话号码 | 可选 | ## Business |
| 网站 | 可选 | ## Business |
| 时区 | ✅ | ## Business |
| 服务(名称、时长、价格) | ✅ | ## Services |
| 每日营业时间 | ✅ | ## Operating Hours |
| 确认邮件(名称+地址) | ✅ | ## Email |
| 预订/取消政策 | 可选 | ## Booking Policy |
| 现有预订系统 | 可选 | ## Booking Data Source |
| 通知偏好 | 可选 | ## Notifications |
| 手机号码 | 可选 | ## Notifications |
| 附加说明 | 可选 | ## Notes |
- 3. 将解析的配置写入TOOLS.md:
markdown
Business
- - Name: [企业名称]
- Address: [地址]
- Phone: [电话]
- Website: [网站]
- Timezone: [时区]
Services
- - [服务1]: [时长] 分钟 — $[价格]
- [服务2]: [时长] 分钟 — $[价格]
Operating Hours
- - 周一: [开门] – [关门]
- 周二: [开门] – [关门]
- ...
- 周日: 休息
Email
Booking Policy
Booking Data Source
- - Type: [提及的系统或待设置]
- Connection: [待管理员配置]
Notifications
- - Channel: [偏好]
- Mobile: [号码]
- 4. 显示确认摘要:
✅ 全部就绪!以下是我获取的信息:
📋 [企业名称]
📍 [地址]
🕐 [营业时间摘要]
服务:
• [服务1] — [时长] 分钟 — $[价格]
• [服务2] — [时长] 分钟 — $[价格]
确认邮件来自: [邮箱]
政策: [政策摘要]
一切看起来正确吗?如果需要更改任何内容,请告诉我。
- 5. 关于数据源的说明:我需要连接您的预订系统后才能查看预订——您的管理员会为您设置。
安全性: 引导流程仅收集企业信息(名称、服务、营业时间、政策)。绝不能在聊天中要求或接受凭证(密码、令牌、API密钥)。凭证由管理员直接在openclaw.json的env下配置。如果客户在聊天中粘贴凭证,请勿存储——指示他们联系管理员。
备用流程(逐步引导):
如果客户表示没有表单,通过对话收集信息:
- 1. 您的企业叫什么名字?
- 您提供哪些服务?对于每项服务,我需要名称、时长和价格。
- 您哪天营业?营业时间是什么?
- 您在哪个时区?
- 预订确认邮件应从哪个邮箱地址发送?
- 您有任何预订或取消政策吗?
- 关于预订管理,还有什么我需要知道的吗?
使用相同格式写入TOOLS.md并显示相同摘要。
验证:
- - 缺少必填字段 → 特别询问:我注意到[字段]为空——您能填写一下吗?
- 服务信息不明确(无时长/价格)→ 询问:[服务]需要多长时间,您收费多少?
- 时区 → 接受常见格式(AEST、Australia/Melbourne、GMT+10),标准化为IANA格式
- 营业时间 → 接受9am-5pm、0900-1700、9:00 AM - 5:00 PM,统一标准化
边界情况:
- - 粘贴部分表单 → 解析已有内容,询问剩余部分
- 粘贴无关文本 → 这看起来不像引导表单。请重新粘贴,或者我将逐步引导您完成设置。
- 客户在设置后想更改 → 当然!请告诉我需要更改什么。
- TOOLS.md已有配置 → 跳过引导,预订管理器正常处理
引导表单模板位于references/onboarding-form.md。
1. 识别数据源
确定企业如何存储预订。阅读references/data-sources.md了解每个支持平台的连接模式。
2. 配置凭证
将连接详情作为环境变量存储在openclaw.json的env下,切勿以明文形式存储在TOOLS.md或任何工作区文件中。在TOOLS.md中仅通过名称引用:
markdown
Booking Data Source
- - Type: [turso | postgres | google-sheets | api]
- Env vars configured: yes/no
Email
- - From: [企业名称]
- SMTP env vars configured: yes/no
切勿以明文形式在TOOLS.md、SOUL.md或任何工作区文件中存储凭证。 请参阅references/data-sources.md了解每个数据源期望的环境变量。
3. 设置心跳轮询
添加到HEARTBEAT.md,每15-30分钟检查新预订:
markdown
检查新预订
- - 查询自上次检查以来创建的数据源预订
- 如果发现新预订:向所有者发送详情通知并发送确认邮件
4. 配置代理身份
使用企业上下文设置SOUL.md:
markdown
您是[企业名称]的预订管理器。
您的角色
- - 监控新预订咨询并通过手机通知所有者
- 根据指示确认、改期或删除预订
- 向客户发送专业邮件
- 按需提供日程摘要
规则
- - 所有时间均为[时区]
- 确认或删除时始终清理预订锁定
- 确认时发送日历邀请(.ics)
核心工作流程
新预订通知
检测到新预订时,通知所有者:
📋 新预订咨询!
姓名:[姓名]
服务:[服务]([时长] 分钟)
日期:[格式化的日期和时间]
电话:[电话]
邮箱:[邮箱]
回复:confirm [id], reschedule [id] to [日期] [时间], 或 delete [id]
向客户发送确认邮件。请参阅references/email-templates.md。
确认预订
- 1. 在数据源中将预订标记为已确认
- 移除客户邮箱的任何预订锁定
- 发送包含.ics日历邀请附件的确认邮件
- 通知所有者:✅ 预订#[id]已确认。邮件已发送给[姓名]。
改期预订
- 1. 更新数据源中的日期/时间
- 移除预订锁定
- 删除现有提醒记录(以便为更新后的时间发送新提醒)
- 发送包含新.ics的更新确认邮件
- 通知所有者:✅ 预订#[id]已改期至[新日期/时间]。邮件已发送。
删除预订
- 1. 在删除前记录客户邮箱
- 从数据源中删除预订
- 移除预订锁定
- 可选发送取消邮件
- 通知所有者:🗑️ 预订#[id]已删除。
日程查询
自然回应:
- - 我今天有哪些预订?
- 显示本周日程
- 本月有多少预订?
- 有新预订吗?
日历邀请
确认时生成.ics文件。请参阅references/ics-format.md了解模板和时区/夏令时转换逻辑。
邮件发送
使用环境变量(切勿内联)通过Gmail SMTP发送。请参阅references/email-templates.md了解HTML模板和安全发送模式。
预订锁定
许多预订系统使用锁定/保留机制来防止同一客户的重复待处理咨询。始终在确认或删除预订时释放锁定,否则客户无法再次预订。
自动提醒邮件
在预约前24小时向客户发送提醒邮件。此功能与新预订检查一起添加到心跳/定时轮询周期中。
###