8
n8n 中文网amn8n.com

通过Telegram处理Notion任务的语音助手

高级

这是一个自动化工作流,包含 25 个节点。主要使用 If, Set, Notion, Switch, Telegram 等节点。 使用Gemini AI和语音支持从Telegram提取并审批任务到Notion

前置要求
  • Notion API Key
  • Telegram Bot Token
  • Google Gemini API Key

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "UMVskHQcryGFC3sW",
  "meta": {
    "instanceId": "733e9abfd67f4f2666a76557fe5d7598ae7705aa1e6ff21081cb972137b3c8b4",
    "templateCredsSetupCompleted": true
  },
  "name": "通过 Telegram 处理 Notion 任务的语音助手",
  "tags": [
    {
      "id": "JUK6Xu1Fz0PWwGzI",
      "name": "active",
      "createdAt": "2025-10-04T12:29:09.131Z",
      "updatedAt": "2025-10-04T12:29:09.131Z"
    }
  ],
  "nodes": [
    {
      "id": "34b3273c-721e-488b-9bce-14ee704185ab",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -64,
        128
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.5-flash-lite"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "leqZBEL1m8HX7yLq",
          "name": "skcet (Mooku) - Gemini"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e7d20742-834e-496f-9dda-9789035e7355",
      "name": "批准检查(是否批准?)",
      "type": "n8n-nodes-base.if",
      "position": [
        1232,
        -48
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "9d302e0c-44e2-4b9e-a3ed-8d21e67945ed",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.approved }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e8a10ffe-b0ca-4fac-b995-b81675799620",
      "name": "Telegram:接收消息",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1472,
        -32
      ],
      "webhookId": "3d067e88-c55e-46c7-b4cf-5d0cc9c3d540",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "s9JmQ5AGImJ32oBQ",
          "name": "abhiman1bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a396c59a-f7b1-43aa-a8d8-572761967c2a",
      "name": "Switch:文本或语音",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1168,
        -32
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "text",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "3fb72ce4-35b2-4997-a369-6a7fd723b36c",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "voice",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "667e13a9-4518-4abb-983d-3b6171f35e4f",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "=",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.3
    },
    {
      "id": "a2dde0cd-d68b-4545-820d-6d2c410ebd40",
      "name": "Set:准备文本",
      "type": "n8n-nodes-base.set",
      "position": [
        -608,
        -176
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "db72eea6-0517-4e77-a8db-dfe433d65fc8",
              "name": "text",
              "type": "string",
              "value": "={{ $json.message.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "17e32a68-39e4-406a-8a98-0e57d8a06ca4",
      "name": "Telegram:下载语音文件",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -832,
        224
      ],
      "webhookId": "c0f4fc71-53b9-4118-a868-0bb40db89a54",
      "parameters": {
        "fileId": "={{ $json.message.voice.file_id }}",
        "resource": "file",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "s9JmQ5AGImJ32oBQ",
          "name": "abhiman1bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7225d6e4-e632-4957-96b3-17ee4a7008c3",
      "name": "Gemini:转录语音",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        -576,
        224
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "models/gemini-2.5-flash",
          "cachedResultName": "models/gemini-2.5-flash"
        },
        "options": {},
        "resource": "audio",
        "inputType": "binary"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "leqZBEL1m8HX7yLq",
          "name": "skcet (Mooku) - Gemini"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "54ee3516-9e72-4b28-9cbe-e82b0c37547a",
      "name": "Set:将转录文本放入文本",
      "type": "n8n-nodes-base.set",
      "position": [
        -336,
        224
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "db72eea6-0517-4e77-a8db-dfe433d65fc8",
              "name": "text",
              "type": "string",
              "value": "={{ $json.content.parts[0].text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bf58028e-5018-4105-86c9-5d7495fd22b4",
      "name": "AI 提取器:任务名称和任务截止日期",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        -64,
        -32
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {},
        "attributes": {
          "attributes": [
            {
              "name": "TaskName",
              "description": "The title of the task. Only return a value if it clearly exists; otherwise, leave empty."
            },
            {
              "name": "TaskDue",
              "type": "date",
              "description": "The due date of the task. Only return a value if clearly present; otherwise, leave empty."
            }
          ]
        }
      },
      "notesInFlow": false,
      "typeVersion": 1.2
    },
    {
      "id": "95ed4be7-aa98-4f72-bd87-dd96ed105f2e",
      "name": "If:提取有效?",
      "type": "n8n-nodes-base.if",
      "position": [
        416,
        -32
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "54e99978-984e-479b-a8cd-678ac9dee81f",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.output.TaskName }}",
              "rightValue": ""
            },
            {
              "id": "f50a2ef0-990d-4740-a0eb-3c2452f8e0d5",
              "operator": {
                "type": "dateTime",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.output.TaskDue }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "1e2f1750-1704-42fe-82c6-7c25a47dd39a",
      "name": "Telegram:请求批准/拒绝",
      "type": "n8n-nodes-base.telegram",
      "position": [
        832,
        -48
      ],
      "webhookId": "d3b32ce4-957d-4d3f-b4f0-4d944edbcbcd",
      "parameters": {
        "chatId": "={{ $('Telegram: Receive Message').item.json.message.chat.id }}",
        "message": "=Task Name: {{ $json.output.TaskName }}\nDue Date: {{ new Date($json.output.TaskDue).toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' }) }}",
        "options": {
          "appendAttribution": false
        },
        "operation": "sendAndWait",
        "approvalOptions": {
          "values": {
            "approvalType": "double",
            "approveLabel": "Approve",
            "disapproveLabel": "Decline"
          }
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "s9JmQ5AGImJ32oBQ",
          "name": "abhiman1bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "fe396f08-c258-462d-bf61-1f50c3922510",
      "name": "Notion:创建任务页面",
      "type": "n8n-nodes-base.notion",
      "position": [
        1616,
        -64
      ],
      "parameters": {
        "title": "={{ $('AI Extractor: TaskName & TaskDue').item.json.output.TaskName }}",
        "options": {},
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "mode": "id",
          "value": "YOUR_DATABASE_ID_HERE",
          "__regex": "^([0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12})"
        },
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Date|date",
              "date": "={{ $('AI Extractor: TaskName & TaskDue').item.json.output.TaskDue }}",
              "includeTime": false
            }
          ]
        }
      },
      "credentials": {
        "notionApi": {
          "id": "lrP3yNJ79AutF43p",
          "name": "ABHIMAN HQ - Notion"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "273da7c6-1dfe-4b70-a9ba-0f66d238d6c6",
      "name": "Telegram:通知 - 任务已创建",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1824,
        -64
      ],
      "webhookId": "96ffe0c6-2a63-4e49-b1eb-93b6be4056fc",
      "parameters": {
        "text": "=✅ Task created in Notion.",
        "chatId": "={{ $('Telegram: Receive Message').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "s9JmQ5AGImJ32oBQ",
          "name": "abhiman1bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f8d85ba2-217b-4d76-8954-c539ed472b9a",
      "name": "Telegram:通知 - 任务未创建",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1248,
        208
      ],
      "webhookId": "97700570-d6ac-4566-a047-751b3a1b5835",
      "parameters": {
        "text": "=❌ Task not created in Notion.",
        "chatId": "={{ $('Telegram: Receive Message').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "s9JmQ5AGImJ32oBQ",
          "name": "abhiman1bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5a32830d-f766-45d3-a330-d058d8ff0d2b",
      "name": "Telegram:通知 - 提取失败",
      "type": "n8n-nodes-base.telegram",
      "position": [
        416,
        224
      ],
      "webhookId": "97700570-d6ac-4566-a047-751b3a1b5835",
      "parameters": {
        "text": "=Title or due date cannot be extracted. Please try again.",
        "chatId": "={{ $('Telegram: Receive Message').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "s9JmQ5AGImJ32oBQ",
          "name": "abhiman1bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "772bab86-fb65-490e-a369-0e6c621fb7d0",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1536,
        -208
      ],
      "parameters": {
        "color": 5,
        "height": 352,
        "content": "## 💬 Telegram:接收消息"
      },
      "typeVersion": 1
    },
    {
      "id": "515140eb-2d20-44e3-9350-5c8fd044b02f",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        -208
      ],
      "parameters": {
        "color": 5,
        "height": 352,
        "content": "## 🔀 Switch:文本或语音"
      },
      "typeVersion": 1
    },
    {
      "id": "1d535e73-7312-4a03-b186-d92642568b3b",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        -304
      ],
      "parameters": {
        "color": 5,
        "width": 256,
        "height": 288,
        "content": "## ✏️ Set:准备文本"
      },
      "typeVersion": 1
    },
    {
      "id": "89c4d4ca-548c-4708-93f9-dc24cbb5cb5a",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -896,
        32
      ],
      "parameters": {
        "color": 5,
        "width": 720,
        "height": 368,
        "content": "## 🎙️ 语音处理链"
      },
      "typeVersion": 1
    },
    {
      "id": "5592afdf-aa6b-4cca-86aa-ad53c15ce6bd",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -128,
        -288
      ],
      "parameters": {
        "color": 5,
        "width": 352,
        "height": 560,
        "content": "## 🧠 任务信息提取"
      },
      "typeVersion": 1
    },
    {
      "id": "30861b16-0e27-40a2-9273-cf4ca47de3b4",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -288
      ],
      "parameters": {
        "color": 5,
        "width": 352,
        "height": 720,
        "content": "## ✅ 验证任务提取"
      },
      "typeVersion": 1
    },
    {
      "id": "de731a57-c922-4e9b-bf3a-eb797f71180d",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        -288
      ],
      "parameters": {
        "color": 5,
        "width": 352,
        "height": 448,
        "content": "## 📩 请求任务批准"
      },
      "typeVersion": 1
    },
    {
      "id": "b1332d50-95e4-4dc7-9923-078ecd4e7ad2",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        -208
      ],
      "parameters": {
        "color": 5,
        "width": 352,
        "height": 608,
        "content": "## ✅ 检查任务批准"
      },
      "typeVersion": 1
    },
    {
      "id": "67ff91ca-9c5f-4cff-a253-cebafa5d0cdf",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1536,
        -208
      ],
      "parameters": {
        "color": 5,
        "width": 496,
        "height": 336,
        "content": "## 📝 在 Notion 中创建任务"
      },
      "typeVersion": 1
    },
    {
      "id": "b990b59b-76c1-44e8-95e5-a9daf9e08f8e",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2528,
        -608
      ],
      "parameters": {
        "color": 3,
        "width": 896,
        "height": 1312,
        "content": "# 快速设置清单 — Telegram → 转录 → 提取 → Notion"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "bc34a6fe-47fe-4146-a529-6b7ad32b9ac2",
  "connections": {
    "Set: Prepare Text": {
      "main": [
        [
          {
            "node": "AI Extractor: TaskName & TaskDue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If: Extraction Valid?": {
      "main": [
        [
          {
            "node": "Telegram: Ask Approve / Decline",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram: Notify - Extraction Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch: Text or Voice": {
      "main": [
        [
          {
            "node": "Set: Prepare Text",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram: Download Voice File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini: Transcribe Voice": {
      "main": [
        [
          {
            "node": "Set: Put Transcript into Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Extractor: TaskName & TaskDue",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Notion: Create Task Page": {
      "main": [
        [
          {
            "node": "Telegram: Notify - Task Created",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram: Receive Message": {
      "main": [
        [
          {
            "node": "Switch: Text or Voice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approval Check (If Approved?)": {
      "main": [
        [
          {
            "node": "Notion: Create Task Page",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Telegram: Notify - Task Not Created",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set: Put Transcript into Text": {
      "main": [
        [
          {
            "node": "AI Extractor: TaskName & TaskDue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram: Download Voice File": {
      "main": [
        [
          {
            "node": "Gemini: Transcribe Voice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram: Ask Approve / Decline": {
      "main": [
        [
          {
            "node": "Approval Check (If Approved?)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Extractor: TaskName & TaskDue": {
      "main": [
        [
          {
            "node": "If: Extraction Valid?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级

需要付费吗?

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

工作流信息
难度等级
高级
节点数量25
分类-
节点类型10
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Abhiman G S

Abhiman G S

@abhimangs

Automation consultant helping creators and small teams streamline their workflows using Notion and n8n. I build systems that save time, boost productivity, and keep everything running smoothly. Check my LinkedIn to connect or collaborate on custom automations.

外部链接
在 n8n.io 查看

分享此工作流