8
n8n 中文网amn8n.com

Telegram到Notion任务自动化

中级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 15 个节点。主要使用 If, Notion, Telegram, TelegramTrigger, LmChatGoogleGemini 等节点。 使用Gemini AI和审批从Telegram消息中提取任务至Notion

前置要求
  • Notion API Key
  • Telegram Bot Token
  • Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "fzx7RMobAxKnsbUd",
  "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": "2abd8dfa-9a30-40e9-a6f6-00dfebfb0a8c",
      "name": "Google Gemini聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        -192,
        128
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.5-flash-lite"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "leqZBEL1m8HX7yLq",
          "name": "skcet (Mooku) - Gemini"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b628bda1-d9d4-4a08-8daf-92df2068b20b",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        -176
      ],
      "parameters": {
        "color": 5,
        "width": 304,
        "height": 336,
        "content": "## ⚡ 在新Telegram消息时启动"
      },
      "typeVersion": 1
    },
    {
      "id": "5fc725da-6bed-4db6-a366-48cd5c0a0c4e",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -256,
        -240
      ],
      "parameters": {
        "color": 5,
        "width": 352,
        "height": 512,
        "content": "## 🧠 使用AI(Gemini)返回任务名称和截止日期"
      },
      "typeVersion": 1
    },
    {
      "id": "cb518f25-0918-4c19-b56e-c5d3f4d0f459",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        144,
        -256
      ],
      "parameters": {
        "color": 5,
        "width": 304,
        "height": 448,
        "content": "## 📩 发送提取的任务;等待批准或拒绝"
      },
      "typeVersion": 1
    },
    {
      "id": "0395e170-03d3-44a2-86a2-2486587a60c4",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        -224
      ],
      "parameters": {
        "color": 5,
        "width": 320,
        "height": 384,
        "content": "## ⚖️ 如果批准 → 创建任务。如果拒绝 → 通知"
      },
      "typeVersion": 1
    },
    {
      "id": "63aa0097-e2ad-40d5-abf0-103f132305d3",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        48
      ],
      "parameters": {
        "color": 5,
        "height": 368,
        "content": "## 📩 拒绝通知"
      },
      "typeVersion": 1
    },
    {
      "id": "6ccb7215-746b-4449-b8ba-a535566bb04f",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        -304
      ],
      "parameters": {
        "color": 5,
        "width": 512,
        "height": 320,
        "content": "## 📝 创建Notion任务"
      },
      "typeVersion": 1
    },
    {
      "id": "c1411a5a-f2a1-42cd-8c4a-708f2040a982",
      "name": "Telegram新消息触发器",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -544,
        -32
      ],
      "webhookId": "eb1fee94-6a07-46f5-baae-0a3753e4a8be",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {
          "chatIds": "YOUR_TELEGRAM_CHAT_ID"
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "n0Vw3Lfnk23X3KQN",
          "name": "n8n_active_bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1214ca68-7ced-4a27-b4b5-30caad364092",
      "name": "AI提取:任务名称和截止日期",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        -192,
        -32
      ],
      "parameters": {
        "text": "={{ $json.message.text }}",
        "options": {},
        "attributes": {
          "attributes": [
            {
              "name": "TaskName",
              "required": true,
              "description": "This is the name of the task. The task name should be in the title case."
            },
            {
              "name": "TaskDue",
              "type": "date",
              "description": "This is the due date of the task."
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "093e6dab-b137-4d80-8bff-09ff03f1018b",
      "name": "发送消息并等待响应(批准/拒绝)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        240,
        -32
      ],
      "webhookId": "e8b05b82-08e2-4462-95b1-9d46a3c327c3",
      "parameters": {
        "chatId": "={{ $('Telegram New Message Trigger').item.json.message.from.id }}",
        "message": "=Task Name: {{ $json.output.TaskName }}\nDue Date: {{ $json.output.TaskDue }}",
        "options": {
          "appendAttribution": false
        },
        "operation": "sendAndWait",
        "approvalOptions": {
          "values": {
            "approvalType": "double",
            "approveLabel": "Approve",
            "disapproveLabel": "Decline"
          }
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "n0Vw3Lfnk23X3KQN",
          "name": "n8n_active_bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a5b24cc6-1ba0-400f-a218-c5ddcbff2574",
      "name": "批准检查(是否批准?)",
      "type": "n8n-nodes-base.if",
      "position": [
        592,
        -32
      ],
      "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": "80e06ae0-4eb1-43fa-8215-828500e1a7df",
      "name": "Notion:创建任务(页面)",
      "type": "n8n-nodes-base.notion",
      "position": [
        976,
        -160
      ],
      "parameters": {
        "title": "={{ $('AI Extract: TaskName & TaskDue').item.json.output.TaskName }}",
        "options": {},
        "resource": "databasePage",
        "databaseId": {
          "__rl": true,
          "mode": "list",
          "value": "282c6fb7-beaa-80b5-9051-ce57efc79002",
          "cachedResultUrl": "https://www.notion.so/YOUR_NOTION_DATABASE_ID",
          "cachedResultName": "Tasks Testing"
        },
        "propertiesUi": {
          "propertyValues": [
            {
              "key": "Date|date",
              "date": "={{ $('AI Extract: TaskName & TaskDue').item.json.output.TaskDue }}",
              "includeTime": false
            }
          ]
        }
      },
      "credentials": {
        "notionApi": {
          "id": "lrP3yNJ79AutF43p",
          "name": "ABHIMAN HQ - Notion"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8c629f2a-04bf-4ffe-960f-6ca107f6f13d",
      "name": "通知:任务已创建(Telegram)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1184,
        -160
      ],
      "webhookId": "1c5bee4c-59bd-4bc5-9091-7db21831d653",
      "parameters": {
        "text": "=✅ Task created in Notion.",
        "chatId": "={{ $('Telegram New Message Trigger').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "n0Vw3Lfnk23X3KQN",
          "name": "n8n_active_bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a5ff4f45-4ef8-4474-992b-a73b5983b462",
      "name": "通知:已拒绝 - 无任务(Telegram)",
      "type": "n8n-nodes-base.telegram",
      "position": [
        960,
        224
      ],
      "webhookId": "1c5bee4c-59bd-4bc5-9091-7db21831d653",
      "parameters": {
        "text": "=❌ Task not created in Notion.",
        "chatId": "={{ $('Telegram New Message Trigger').item.json.message.from.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "n0Vw3Lfnk23X3KQN",
          "name": "n8n_active_bot - Telegram"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5f21dcbb-1d6d-4b16-8395-84a884a5e4fb",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        -336
      ],
      "parameters": {
        "color": 7,
        "width": 544,
        "height": 688,
        "content": "## 🔧 设置与要求"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "5463694c-b820-446b-be0d-e4f088e4b2eb",
  "connections": {
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Extract: TaskName & TaskDue",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Notion: Create Task (Page)": {
      "main": [
        [
          {
            "node": "Notify: Task Created (Telegram)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram New Message Trigger": {
      "main": [
        [
          {
            "node": "AI Extract: TaskName & TaskDue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Approval Check (If Approved?)": {
      "main": [
        [
          {
            "node": "Notion: Create Task (Page)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify: Declined - No Task (Telegram)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Extract: TaskName & TaskDue": {
      "main": [
        [
          {
            "node": "Send message and wait for response (Approve/Decline)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send message and wait for response (Approve/Decline)": {
      "main": [
        [
          {
            "node": "Approval Check (If Approved?)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 内容创作, 多模态 AI

需要付费吗?

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

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

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

作者
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 查看

分享此工作流