8
n8n 中文网amn8n.com

通过Telegram和Google Calendar的AI预约安排器

中级

这是一个AI领域的自动化工作流,包含 11 个节点。主要使用 Telegram, Agent, TelegramTrigger, GoogleCalendarTool, LmChatOpenAi 等节点,结合人工智能技术实现智能自动化。 通过 Telegram 使用 GPT-4o 和 Google Calendar 安排预约

前置要求
  • Telegram Bot Token
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "REDACTED",
  "meta": {
    "instanceId": "REDACTED",
    "templateCredsSetupCompleted": true
  },
  "name": "通过Telegram和Google Calendar的AI预约安排器",
  "tags": [],
  "nodes": [
    {
      "id": "d1451463-041d-4a8a-86b9-5084197aa58b",
      "name": "AI 代理",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        220,
        0
      ],
      "parameters": {
        "text": "={{ $json.message.text }}",
        "options": {
          "systemMessage": "=You are a helpful appointment scheduling assistant. You will receive requests from user to set up appointments. Your job is to use the Calendar tool to create an event.\n\n#Rule\n1. When exact date or time is specified e.g \"create an event for next Tuesday\" always refer to the current time reference, which is: {{ $now }}\n2. Always assume time is ing GMT+08 (SGT).\n3. Unless specified, assume event duration will be 1 hour."
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "228e4c9c-7b0f-4204-9faa-965ca90dc939",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        220,
        200
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "REDACTED",
          "name": "REDACTED"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "40e58cd2-ff6a-4747-9d98-71ddcd162473",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        380,
        200
      ],
      "parameters": {
        "sessionKey": "={{ $json.message.chat.id }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "6f9cea9d-f8a0-4694-ba88-912580937e95",
      "name": "Google Calendar1",
      "type": "n8n-nodes-base.googleCalendarTool",
      "position": [
        640,
        200
      ],
      "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": "your_calendar@example.com",
          "cachedResultName": "your_calendar@example.com"
        },
        "additionalFields": {
          "summary": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Summary', ``, 'string') }}",
          "attendees": [
            "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('attendees0_Attendees', ``, 'string') }}"
          ]
        },
        "useDefaultReminders": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Use_Default_Reminders', ``, 'boolean') }}"
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "id": "REDACTED",
          "name": "REDACTED"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "d54d3061-1645-4d87-9b0a-afbbf5be38f4",
      "name": "Telegram 触发器",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -60,
        0
      ],
      "webhookId": "REDACTED",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "REDACTED",
          "name": "REDACTED"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "628eb6da-2f55-42bc-af24-3d5102d39c08",
      "name": "Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        640,
        -100
      ],
      "webhookId": "REDACTED",
      "parameters": {
        "text": "={{ $json.output }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "REDACTED",
          "name": "REDACTED"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "06fa63b4-929f-4eda-95d8-33d64d01c404",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -60
      ],
      "parameters": {
        "width": 300,
        "height": 260,
        "content": "Telegram消息接收触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "1df632ea-a2aa-4b5a-a145-35d92c0d47be",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        -160
      ],
      "parameters": {
        "color": 3,
        "width": 400,
        "height": 540,
        "content": "Telegram消息接收触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "1b60fdf1-425d-4b42-96b7-bef114660e46",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        -160
      ],
      "parameters": {
        "color": 4,
        "height": 260,
        "content": "Telegram 响应"
      },
      "typeVersion": 1
    },
    {
      "id": "8ffa2de3-cdbf-44d4-8416-3754eb7b6810",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        120
      ],
      "parameters": {
        "color": 6,
        "height": 260,
        "content": "日历工具"
      },
      "typeVersion": 1
    },
    {
      "id": "099f1140-1744-4ff7-bd12-00b441b861e1",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -320
      ],
      "parameters": {
        "width": 440,
        "height": 880,
        "content": "🔧 工作原理"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "REDACTED",
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Google Calendar1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 人工智能

需要付费吗?

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

工作流信息
难度等级
中级
节点数量11
分类1
节点类型7
难度说明

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

作者
Automate With Marc

Automate With Marc

@marconi

Automating Start-Up and Business processes. Helping non-techies understand and leverage Agentic AI with easy to understand step-by-step tutorials. Check out my educational content: https://www.youtube.com/@Automatewithmarc

外部链接
在 n8n.io 查看

分享此工作流