# 客服在聊天中改期时更新预约

客户经常在会话中途请人工客服改期或取消预约。两个自动化操作能让日历与客服达成的约定保持一致，无需任何人手动修正 Schedule：

* **Reschedule appointment to attribute** 会把客户当前的预约移到某个日期类型自定义属性中保存的日期和时间。
* **Cancel appointment** 会释放客户当前的预约。

两者都作用于已关联到该联系人的预约 —— 也就是你的 AI 智能体在聊天中预约的，或客户通过你的预约页面自行预约的那一个。

## 开始之前

* 一个已有预约的[日历](/calendar/setting-up-a-calendar)。
* 在 **Settings → Integrations → AI Providers** 中已连接 AI 提供方，这样 AI 才能从会话中读出新时间。
* 改期流程适用于你的 AI 智能体处理过的会话 —— 预约在那里完成，AI 也从那里读取确认内容。

## 第 1 步：为新时间添加一个日期属性

改期操作从一个自定义属性中读取新时间，而 AI 会根据会话内容填写这个属性。

1. 进入 **Settings → Custom Attributes**，点击 **Add Custom Attribute**。
2. 将 **Applies to** 设为 **Conversation**，**Type** 设为 **Date**。
3. 填写一个 **Display Name**，例如 *Reschedule to*。
4. 在 **Description** 中告诉 AI 要查找什么 —— 这就是它遵循的指令。例如：*The most recently confirmed appointment date and time in this conversation, as a full date and time including the +08:00 time zone offset, e.g. 2026-09-04T17:00:00+08:00. Later messages override earlier ones. Leave empty if none.* 请改用你自己的时区偏移。
5. 勾选 **Enable AI extraction**，然后点击 **Create**。

![已启用 AI 提取的日期属性的 Add Custom Attribute 对话框](../../.gitbook/assets/guides/custom-attribute-reschedule-to.jpg)

如果你在该智能体的 **Configure Columns** 中挑选了特定的 **AI Columns**，也请把这个新属性加进去，这样它才会和其他属性一起刷新。

## 第 2 步：创建自动化规则

1. 进入 **Settings → Automation**，点击 **Create Automation**。
2. 选择 **Message Created** 事件。
3. 添加与客服确认语句匹配的条件 —— 例如 **Message Type** 等于 **Outgoing Message**，以及 **Message Contains** *Reschedule Appointment on*。请团队在确认新时间时统一使用这个短语，例如 *Reschedule Appointment on Friday 4/9, 5pm*。
4. 将第一个操作设为 **Regenerate AI Attributes**。它会把新时间从会话中读入你的日期属性。
5. 点击 **Add Action**，选择 **Reschedule appointment to attribute**，再选中你的日期属性。请把它放在 **Regenerate AI Attributes** 之下 —— 操作按从上到下的顺序执行。
6. 点击 **Create**。

![先重新生成 AI 属性、再为预约改期的自动化规则](../../.gitbook/assets/guides/automation-reschedule-appointment.jpg)

## 规则运行时会发生什么

* 预约移到新时间。旧时段被释放，[message sequences](/campaigns/message-sequences) 中的预约提醒会跟随新时间，客户的管理链接也继续有效。
* 这次更改会记在会话中最后一位回复的客服名下，因此 Schedule 会显示是谁移动了预约。
* 会话中会出现一条活动记录，例如 *Appointment moved to Friday, 4 September 2026, 5:00 PM (was Thursday, 3 September 2026, 3:00 PM) by Rebecca*。活动记录只对你的团队可见 —— 客户不会收到。

## 预约保持不变的情况

规则从不重复预约，也不猜测。在以下任一情况中，当前预约都会保持原样，并由活动记录告知团队原因：

* 新时间已被占用，或不在日历的营业时间内。
* 属性为空，或 AI 无法从会话中辨认出日期和时间。
* 新时间已经过去。
* 该联系人没有有效预约 —— 从未预约过，或已经取消。

如果新时间与当前预约相同，则不做任何更改，也不会添加记录。

## 取消预约

用同样的方式把 **Cancel appointment** 加入规则 —— 例如在 **Message Created** 事件下，当外发消息包含 *Cancel Appointment confirmed* 时触发。它会释放客户当前的预约、空出该时段，并记录是谁取消的：*Appointment on Thursday, 3 September 2026, 3:00 PM cancelled by Rebecca*。

## 相关文章

* [设置日历](/calendar/setting-up-a-calendar)
* [预约页面与 Schedule 视图](/calendar/booking-pages-and-the-schedule-view)
* [标签、属性与自动化](/settings/labels-attributes-and-automation)
* [Message Sequences](/campaigns/message-sequences)

---
Source: https://help.mampuai.com/zh/calendar/agent-rescheduled-appointments
