8
n8n 中文网amn8n.com

TimePilot代理

中级

这是一个Personal Productivity, AI Chatbot领域的自动化工作流,包含 14 个节点。主要使用 Set, WhatsApp, Agent, WhatsAppTrigger, GoogleCalendarTool 等节点。 通过WhatsApp和GPT-4虚拟助手管理Google日历

前置要求
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "fHwbWAf8GLSPdLMe",
  "meta": {
    "instanceId": "0113e6e8f0b87d10de7bde5508e446a6ee60d5da9eac8c7eea34b85efc06e886",
    "templateCredsSetupCompleted": true
  },
  "name": "TimePilot代理",
  "tags": [],
  "nodes": [
    {
      "id": "62514198-2f29-4a99-8747-7e88054649bb",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -740,
        560
      ],
      "parameters": {
        "model": "gpt-4-turbo-preview",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "0drnlAHYRUGeZtLD",
          "name": "OpenAi Emails Key"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0a57b879-0e26-4221-a637-5496dc2e879f",
      "name": "成功",
      "type": "n8n-nodes-base.set",
      "position": [
        60,
        340
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "39c2f302-03be-4464-a17a-d7cc481d6d44",
              "name": "=response",
              "type": "string",
              "value": "={{$json.output}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "be536969-ceb6-479a-9090-f2af61e51788",
      "name": "创建事件",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        -500,
        560
      ],
      "parameters": {
        "end": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('End', ``, 'string') }}",
        "start": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Start', ``, 'string') }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "floyd.mahou@blockachainintegration.com",
          "cachedResultName": "floyd.mahou@blockachainintegration.com"
        },
        "descriptionType": "manual",
        "toolDescription": "=Consume Google Calendar API",
        "additionalFields": {
          "summary": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Summary', ``, 'string') }}",
          "attendees": []
        }
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "t9wYhPm1k7dsXYfU",
          "name": "Google Calendar account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "79bb24fa-7432-4099-8b4e-a4245b0994b7",
      "name": "删除活动",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        -380,
        560
      ],
      "parameters": {
        "eventId": "={{ $fromAI(\"eventID\") }}",
        "options": {
          "sendUpdates": "all"
        },
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "floyd.mahou@blockachainintegration.com",
          "cachedResultName": "floyd.mahou@blockachainintegration.com"
        },
        "operation": "delete",
        "descriptionType": "manual"
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "t9wYhPm1k7dsXYfU",
          "name": "Google Calendar account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "b48b62cd-0664-4be9-97ad-0894076b222b",
      "name": "更新活动",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        -260,
        560
      ],
      "parameters": {
        "eventId": "={{ $fromAI(\"eventID\") }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "floyd.mahou@blockachainintegration.com",
          "cachedResultName": "floyd.mahou@blockachainintegration.com"
        },
        "operation": "update",
        "updateFields": {
          "end": "={{ $fromAI(\"endTime\") }}",
          "start": "={{ $fromAI(\"startTime\") }}"
        },
        "descriptionType": "manual"
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "t9wYhPm1k7dsXYfU",
          "name": "Google Calendar account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "2503b217-d803-48e4-bcab-35326ad6fbcd",
      "name": "WhatsApp 触发器",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -960,
        340
      ],
      "webhookId": "d214a512-4e47-4795-94e7-8fe22d728e53",
      "parameters": {
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "id": "alfTM3LXYS7LSYrX",
          "name": "WhatsApp OAuth "
        }
      },
      "typeVersion": 1
    },
    {
      "id": "75ca98bd-87cd-4d33-ae93-0ce24fee9128",
      "name": "WhatsApp Business Cloud",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        280,
        340
      ],
      "webhookId": "313cb932-f2a1-413c-82be-9992dd6f7fb2",
      "parameters": {
        "textBody": "={{ $json.response }}",
        "operation": "send",
        "phoneNumberId": "={{ $('WhatsApp Trigger').item.json.metadata.phone_number_id }}",
        "additionalFields": {},
        "recipientPhoneNumber": "ENTER YOUR PHONE NUMBER HERE"
      },
      "credentials": {
        "whatsAppApi": {
          "id": "aABgdezjiM28thx9",
          "name": "WhatsApp account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a07c2c51-ceed-4243-85c4-5f027dc01692",
      "name": "搜索事件",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        -140,
        560
      ],
      "parameters": {
        "limit": "={{ $fromAI('Limit', ``, 'number') }}",
        "options": {},
        "timeMax": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Before', ``, 'string') }}",
        "timeMin": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('After', ``, 'string') }}",
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "floyd.mahou@blockachainintegration.com",
          "cachedResultName": "floyd.mahou@blockachainintegration.com"
        },
        "operation": "getAll",
        "descriptionType": "manual"
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "t9wYhPm1k7dsXYfU",
          "name": "Google Calendar account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "c38e2b8f-eb9f-49c7-87db-81dc322ab90b",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -620,
        560
      ],
      "parameters": {
        "sessionKey": "={{ $('WhatsApp Trigger').item.json.messages[0].type }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "43bfc3ce-e5b0-407d-b556-e1bbdc78a178",
      "name": "TimePilot",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -528,
        340
      ],
      "parameters": {
        "text": "={{ $json.messages[0].text.body }}",
        "options": {
          "systemMessage": "=# Overview  \nYou 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.\n\n## Context  \n- You are the only user of this system.  \n- All requests come from WhatsApp and responses must be sent via WhatsApp.  \n- You use Google Calendar modules to perform every action and confirm completion.  \n- You understand both French and English.  \n- Your tone is neutral, fast, and action-focused.  \n\n## Instructions  \n1. Always check if the input contains a clear calendar-related request.  \n2. If the message is a greeting or polite phrase (e.g., \"Hi\", \"Thanks\", \"Hello\"), reply briefly and kindly.  \n3. Always route tasks through the correct module:\n   - Always Use **Search Event** to:\n     - List all upcoming meetings.\n     - Show availability.\n     - Retrieve a specific event before updating or deleting it.\n   -Always Use **Create Event with Attendee** to create any new event (even without participants).\n   - Always Use **Update Event** only after retrieving the target event with **Search Event**.\n   - Always Use **Delete Event** only after retrieving the event with **Search Event**.\n4. Never perform any action without using the appropriate module.  \n5. If information is missing (like time or participants), ask one short, targeted follow-up question.  \n6. Always confirm the completed action with a short message via WhatsApp.  \n7. If the input is unclear, ask for clarification. Never guess.  \n8. Never explain your steps or how you operate. Just act.  \n\n## Tools  \n- Search Event (availability/meeting schedule:calendar)  \n- Create Event with Attendee (create:event)  \n- Update Event (update:event)  \n- Delete Event (delete:event)  \n\n## Examples  \n- Input: \"Yo\"  \n  - Output: \"Hi! What would you like to do with your calendar?\"  \n- Input: \"Add a call tomorrow at 9am with Julien\"  \n  - Modules: Create Event with Attendee  \n  - Output: \"Call with Julien added tomorrow at 9am.\"  \n- Input: \"What meetings do I have Friday?\"  \n  - Modules: Search Event  \n  - Output: \"On Friday you have: 10am 'Budget Review' with Claire, 3pm 'Product Sync' with Marc.\"  \n- Input: \"List my meetings this week\"  \n  - Modules: Search Event  \n  - Output: \"Here are your meetings this week: Monday 10am with Hugo, Wednesday 2pm with Ana...\"  \n- Input: \"Delete the HR sync tomorrow\"  \n  - Modules: Search Event → Delete Event  \n  - Output: \"Done. The HR sync for tomorrow has been deleted.\"  \n- Input: \"Thanks\"  \n  - Output: \"You're welcome!\"  \n- Input: \"Move the 2pm meeting to 4pm\"  \n  - Modules: Search Event → Update Event  \n  - Output: \"The meeting has been moved to 4pm.\"  \n- Input: \"Create a ‘Sprint Review’ meeting tomorrow at 11am with Lisa and Karim\"  \n  - Modules: Create Event with Attendee  \n  - Output: \"‘Sprint Review’ meeting created tomorrow at 11am with Lisa and Karim.\"  \n\n## SOP (Standard Operating Procedure)  \n1. Read the WhatsApp message.  \n2. Identify the intent:\n   - View meetings: use \"Search Event\"\n   - Create meeting: use \"Create Event with Attendee\"\n   - Update meeting: use \"Search Event\" → \"Update Event\"\n   - Delete meeting: use \"Search Event\" → \"Delete Event\"\n3. Always use the correct module—no exceptions.  \n4. Send a short confirmation message via WhatsApp.  \n5. If data is missing, ask a concise follow-up question.  \n\n## Final Notes  \n- You are the only user.  \n- Never handle any action without triggering the corresponding module.  \n- All confirmations are sent in real-time via WhatsApp.  \n- Default meeting duration is one hour.  \n\nCurrent time is {{ $now.format('yyyy-MM-dd') }}  \nTime zone: Paris/Europe  "
        },
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "c9ff64ad-d3ec-40f8-af60-9ae1f739148d",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1020,
        20
      ],
      "parameters": {
        "color": 4,
        "width": 220,
        "height": 700,
        "content": "## 🟩 区块1 – WhatsApp触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "c4a4972c-bf6f-4c7e-b4c3-ef44479989de",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -780,
        20
      ],
      "parameters": {
        "color": 5,
        "width": 800,
        "height": 700,
        "content": "## 🟦 区块2 – TimePilot(工具代理)"
      },
      "typeVersion": 1
    },
    {
      "id": "34cc21ed-6dbb-4625-b5df-126def225d18",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        20
      ],
      "parameters": {
        "color": 6,
        "width": 440,
        "height": 700,
        "content": "## 🟪 部分3 – 输出和确认"
      },
      "typeVersion": 1
    },
    {
      "id": "d725e087-45d0-48eb-bbbe-3d7bed5bd9a3",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        520,
        20
      ],
      "parameters": {
        "width": 540,
        "height": 1360,
        "content": "## 🛠️ 如何使用TimePilot代理(WhatsApp日历助手)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "bcfa59a6-adca-467a-b6db-0e522f36e2b1",
  "connections": {
    "Success": {
      "main": [
        [
          {
            "node": "WhatsApp Business Cloud",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "TimePilot": {
      "main": [
        [
          {
            "node": "Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Event": {
      "ai_tool": [
        [
          {
            "node": "TimePilot",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Delete Event": {
      "ai_tool": [
        [
          {
            "node": "TimePilot",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Search Event": {
      "ai_tool": [
        [
          {
            "node": "TimePilot",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Update Event": {
      "ai_tool": [
        [
          {
            "node": "TimePilot",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "TimePilot",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "TimePilot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "TimePilot",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 个人效率, AI 聊天机器人

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量14
分类2
节点类型8
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Floyd Mahou

Floyd Mahou

@floyd

Ex-finance professional turned AI Automation & Business Architecture Strategist.

外部链接
在 n8n.io 查看

分享此工作流