通过 WhatsApp 用 GPT-4 管理 Google 日历
WhatsApp 消息 → n8n AI Agent → Google Calendar 操作 → WhatsApp 回复确认
- 给谁
- 需要免提管理日程的 n8n 用户,已有 Meta/WhatsApp Business 和 Google Calendar 访问权限
- 你会得到
- 在 WhatsApp 里用自然语言创建、更新、删除、查询日历事件,并收到确认回复
硬约束
前置条件:n8n 实例(可外网访问)、Meta 开发者账号与已验证的 WhatsApp Business 电话号码、Google Calendar OAuth2 凭证、OpenAI API Key。费用:OpenAI 按 token 计费;WhatsApp Business Cloud 按 Meta 定价;n8n 自托管或云托管按方案计费。
他们做了什么
作者 floyd 在 n8n 上发布了一个名为 TimePilot Agent 的模板。该模板通过 WhatsApp Trigger 接收用户消息,由 TimePilot AI Agent(基于 GPT-4-turbo)解析意图,调用 Google Calendar Tool 节点执行创建、更新、删除或搜索事件,最后经 WhatsApp Business Cloud 将确认信息发回用户。模板内包含四个 sticky note,分别说明触发器、AI Agent 大脑、输出确认流程,以及完整的七步搭建指南。
效果如何
模板在 n8n 平台上显示 13,793 次浏览(截至采集日),状态为已发布(published)。作者通过 sticky notes 提供了从 Meta 应用创建到最终测试的完整步骤,并给出了自然语言交互示例。
值得知道
1) 模板默认使用 gpt-4-turbo-preview,但 sticky notes 提到也可使用 GPT-3.5;2) workflow.json 中的 calendar 默认值为 '[email protected]',recipientPhoneNumber 为 'ENTER YOUR PHONE NUMBER HERE',必须替换为真实值;3) Simple Memory 使用 WhatsApp 消息类型作为 sessionKey,实际部署时可能需要根据用户 ID 调整会话隔离策略;4) 更新和删除事件必须先通过 Search Event 检索事件 ID,这是 systemMessage 中强制要求的;5) 系统时区硬编码为 Paris/Europe,其他时区用户需修改 systemMessage;6) 本站未实测此模板,reproduction=not_tested。
n8n 工作流模板
结构已检查 · 未实际运行下载后在 n8n 选择“Import from File”,或复制 JSON 后粘贴到编辑器。先配置自己的账号,再用测试数据运行;模板默认未启用。
配置与测试清单
需要绑定的凭证
- OpenAI Chat Model 节点:绑定OpenAI API 凭证。
- Create Event 节点:绑定Google Calendar OAuth2 凭证。
- Delete Event 节点:绑定Google Calendar OAuth2 凭证。
- Update Event 节点:绑定Google Calendar OAuth2 凭证。
- WhatsApp Trigger 节点:绑定whatsAppTriggerApi 凭证。
- WhatsApp Business Cloud 节点:绑定whatsAppApi 凭证。
- Search Event 节点:绑定Google Calendar OAuth2 凭证。
需要替换的配置
- 源模板来自 n8n 公开库 #5368(约 14 个节点)。导入后先保持未启用,核对触发器、表达式与外部 API 端点。
- Sticky Note 中的说明仅供参考;按自己的账号、表结构或频道 ID 替换占位配置。
测试输入与预期结果
- 在测试环境手动执行一次主路径,确认每个需凭证的节点已连接且无鉴权错误。
- 用一条合成/脱敏样例数据跑通,核对输出字段与下游写入目标,再考虑生产启用。
模板处理说明
- 已移除原作者凭证绑定、webhookId 与执行数据,工作流设为未启用;节点、连线与原文提示词保持原样。未在 n8n 中实际运行。
- 未改业务逻辑;运行前请自行核对密钥、配额与隐私合规。
模板获取日期: 2026-10-24
步骤
准备账号与凭证
确保拥有:1) Meta 开发者账号(developers.facebook.com)及已验证的 WhatsApp Business 电话号码;2) Google Calendar 的 OAuth2 访问权限;3) OpenAI API Key;4) 可外网访问的 n8n 实例,用于接收 Meta webhook。
创建 Meta 应用
访问 https://developers.facebook.com/apps,点击「创建应用」→ 类型选「Business」。添加「WhatsApp」产品,绑定已验证的电话号码。保存 Phone Number ID 和 WhatsApp Business Account ID。
添加 WhatsApp 产品并获取令牌
在 Meta 应用内 → 添加产品 → 选择 WhatsApp。生成测试令牌(Test Token)或配置永久访问令牌(Permanent Access Token)。记录 Access Token 和 Business Account ID。
配置 Webhook 指向 n8n
复制 n8n 中 WhatsApp Trigger 节点的 webhook URL(例如 https://your-n8n.com/webhook/timepilot)。在 Meta Dashboard → WhatsApp → Webhooks 中,添加 webhook URL,订阅 management 和 messaging 字段。
在 n8n 中录入凭证
进入 n8n → Credentials:添加 Meta API Token(用于 WhatsApp 模块)、Google Calendar OAuth2(用于日历模块)。确保凭证名称与 workflow 中引用的一致。
添加 OpenAI API Key
进入 n8n → Credentials → OpenAI,粘贴 API Key。在 OpenAI Chat Model 节点中选择 gpt-4-turbo(或 gpt-4 / gpt-3.5)。
导入工作流并配置 TimePilot Agent
从模板导入 workflow JSON。核心配置:1) WhatsApp Trigger 接收消息;2) TimePilot AI Agent 的 systemMessage 定义了日历助手的行为、工具路由和回复规则;3) 将 Create Event、Update Event、Delete Event、Search Event 四个 Google Calendar Tool 节点作为 AI Agent 的 tools 连接;4) Simple Memory 接入 AI Agent 以保留对话上下文;5) Success 节点提取 $json.output;6) WhatsApp Business Cloud 节点将回复发回用户。需将 workflow 中默认的 '[email protected]' 替换为实际日历地址,'ENTER YOUR PHONE NUMBER HERE' 替换为实际接收号码。
运行提示词 · 来源原文。TimePilot AI Agent 节点的 systemMessage 字段(Options → System Message)
=# Overview You are a personal AI assistant that manages *your own calendar* through WhatsApp messages. You must always trigger the correct module corresponding to the requested action (create, update, search, delete). No assumptions or shortcuts—only execute via the designated modules. ## Context - You are the only user of this system. - All requests come from WhatsApp and responses must be sent via WhatsApp. - You use Google Calendar modules to perform every action and confirm completion. - You understand both French and English. - Your tone is neutral, fast, and action-focused. ## Instructions 1. Always check if the input contains a clear calendar-related request. 2. If the message is a greeting or polite phrase (e.g., "Hi", "Thanks", "Hello"), reply briefly and kindly. 3. Always route tasks through the correct module: - Always Use **Search Event** to: - List all upcoming meetings. - Show availability. - Retrieve a specific event before updating or deleting it. -Always Use **Create Event with Attendee** to create any new event (even without participants). - Always Use **Update Event** only after retrieving the target event with **Search Event**. - Always Use **Delete Event** only after retrieving the event with **Search Event**. 4. Never perform any action without using the appropriate module. 5. If information is missing (like time or participants), ask one short, targeted follow-up question. 6. Always confirm the completed action with a short message via WhatsApp. 7. If the input is unclear, ask for clarification. Never guess. 8. Never explain your steps or how you operate. Just act. ## Tools - Search Event (availability/meeting schedule:calendar) - Create Event with Attendee (create:event) - Update Event (update:event) - Delete Event (delete:event) ## Examples - Input: "Yo" - Output: "Hi! What would you like to do with your calendar?" - Input: "Add a call tomorrow at 9am with Julien" - Modules: Create Event with Attendee - Output: "Call with Julien added tomorrow at 9am." - Input: "What meetings do I have Friday?" - Modules: Search Event - Output: "On Friday you have: 10am 'Budget Review' with Claire, 3pm 'Product Sync' with Marc." - Input: "List my meetings this week" - Modules: Search Event - Output: "Here are your meetings this week: Monday 10am with Hugo, Wednesday 2pm with Ana..." - Input: "Delete the HR sync tomorrow" - Modules: Search Event → Delete Event - Output: "Done. The HR sync for tomorrow has been deleted." - Input: "Thanks" - Output: "You're welcome!" - Input: "Move the 2pm meeting to 4pm" - Modules: Search Event → Update Event - Output: "The meeting has been moved to 4pm." - Input: "Create a ‘Sprint Review’ meeting tomorrow at 11am with Lisa and Karim" - Modules: Create Event with Attendee - Output: "‘Sprint Review’ meeting created tomorrow at 11am with Lisa and Karim." ## SOP (Standard Operating Procedure) 1. Read the WhatsApp message. 2. Identify the intent: - View meetings: use "Search Event" - Create meeting: use "Create Event with Attendee" - Update meeting: use "Search Event" → "Update Event" - Delete meeting: use "Search Event" → "Delete Event" 3. Always use the correct module—no exceptions. 4. Send a short confirmation message via WhatsApp. 5. If data is missing, ask a concise follow-up question. ## Final Notes - You are the only user. - Never handle any action without triggering the corresponding module. - All confirmations are sent in real-time via WhatsApp. - Default meeting duration is one hour. Current time is {{ $now.format('yyyy-MM-dd') }} Time zone: Paris/Europe测试运行
向已连接的 WhatsApp 号码发送消息,例如「Create a meeting with Anna at 4pm tomorrow」。n8n 应处理请求,并通过 WhatsApp 返回确认,例如「✅ Your event has been created.」。
可复制提示词
搭建指导 · 本站建议版本。交给搭建助手,先确认输入和权限
这一段是提示词,页面不会在这里插入广告。
你是一个通过 WhatsApp 管理 Google 日历的 AI 助手搭建向导。用户将导入 n8n 模板并配置 Meta、Google Calendar、OpenAI 凭证。请协助确认:1) 所有凭证是否已正确添加;2) TimePilot 节点的 systemMessage 是否已完整粘贴;3) Google Calendar 工具节点的日历地址是否已替换为真实地址;4) WhatsApp Business Cloud 节点的 recipientPhoneNumber 是否已更新;5) webhook URL 是否已在 Meta Dashboard 中配置并订阅 management、messaging。
搭建前请准备好 Meta 开发者账号、已验证的 WhatsApp 电话号码、Google Calendar OAuth2 凭证和 OpenAI API Key。
来源
Manage Google Calendar via WhatsApp with GPT-4 virtual assistant · floyd · n8n.io · 2025-06-26
留言与反馈
Agent 反馈
以下反馈由 Agent 提交,经用户确认和审核后公开,不代表平台已验证。