8
n8n 中文网amn8n.com

我的工作流

中级

这是一个Personal Productivity, AI Summarization领域的自动化工作流,包含 7 个节点。主要使用 If, Telegram, GmailTrigger, Agent, LmChatOpenAi 等节点。 监控Gmail并使用GPT-4o-mini和关键词向Telegram发送AI摘要

前置要求
  • Telegram Bot Token
  • Google 账号和 Gmail API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "gXutAybKcZqblZjF",
  "meta": {
    "instanceId": "f339fb4cdac358dcfebe03c578dc787158fe3660e2856c0a125861bc0c95ef5c",
    "templateCredsSetupCompleted": true
  },
  "name": "我的工作流",
  "tags": [],
  "nodes": [
    {
      "id": "a47db6e0-7861-4c0e-9628-1cab45cce413",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        160,
        540
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "AOdaculhRTVLfI7K",
          "name": "n8n free OpenAI API credits"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5b19646e-e002-4ad0-9422-70d95fa09f79",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        -100
      ],
      "parameters": {
        "width": 2020,
        "height": 1140,
        "content": "## 📌 发送邮件摘要到 Telegram\\n\\n## 🔄 此工作流的功能\\n此自动化每分钟检查您的 Gmail 收件箱,基于关键词过滤器检测重要邮件,并使用 GPT-4o-mini 发送简短的、Telegram 风格的摘要。\\n\\n---\\n\\n#### 🧩 逐节点分解\\n\\n1. **📥 收到邮件**\\n   - Gmail 触发器节点\\n   - 每分钟轮询收件箱以查找新邮件(主题 + 正文)\\n\\n2. **🧪 是否重要**\\n   - 使用关键词过滤器检查邮件是否重要。\\n   - 如果邮件主题或正文**包含关键词**如 `\"销售\"`,则继续。\\n   - 否则停止。\\n\\n   **💡 您可以使用的关键词示例:**\\n   - `\"发票\"`\\n   - `\"付款到期\"`\\n   - `\"安全警报\"`\\n   - `\"工作邀请\"`\\n   - `\"配送\"`\\n   👉 在条件列表中添加任何**对您重要**的内容。\\n\\n3. **🧠 AI Agent**\\n   - 使用预写的系统提示将邮件内容发送到 OpenAI。\\n   - 返回一个简短的、人性化的摘要(最多 300 个字符),使用表情符号和通俗语言。\\n\\n4. **📤 发送文本消息**\\n   - 将 AI 生成的摘要发送到您的 Telegram 聊天。\\n\\n---\\n\\n#### ✅ Telegram 消息示例\\n> 📦 您的 Flipkart 订单“蓝牙音箱”今天已送达。请享用!\\n\\n---\\n\\n#### 🛠 注意事项\\n- 您可以在**是否重要**节点中修改关键词过滤器。\\n- 确保您的**Telegram 聊天 ID 和机器人**设置正确。\\n- 此工作流适用于:\\n  - 账单提醒 💰\\n  - 配送更新 📦\\n  - 工作或人力资源邮件 🧑‍💼\\n  - OTP/安全消息 🔐\\n\\n---"
      },
      "typeVersion": 1
    },
    {
      "id": "38ec8af8-000a-4c81-ac84-3f57b13653ff",
      "name": "检查新邮件",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -300,
        570
      ],
      "parameters": {
        "simple": false,
        "filters": {},
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "BjLuqt1WNTbWNBM1",
          "name": "Gmail account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e9ca1183-73c2-40ae-8911-dc293c76d3af",
      "name": "重要邮件过滤器",
      "type": "n8n-nodes-base.if",
      "position": [
        -80,
        570
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "f300ae2b-5de4-4efc-88ae-130a957588cb",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.subject }}",
              "rightValue": "sales"
            },
            {
              "id": "30e5cc92-886b-4a5b-bc36-6cefc443c66b",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.text }}",
              "rightValue": "jobs"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d646dfa9-28f3-4466-9bbe-154397d1c7af",
      "name": "忽略不重要邮件",
      "type": "n8n-nodes-base.noOp",
      "position": [
        210,
        720
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c5b0111c-f1ee-4d9c-94bc-e64e83c5ba6f",
      "name": "使用 GPT-4o 总结邮件",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        140,
        340
      ],
      "parameters": {
        "text": "=Email Subject:  {{ $json.subject }}\nEmail Body:  {{ $json.text }}",
        "options": {
          "systemMessage": "=# 🧠 Multi-Purpose Email Summarizer\n\nYou are an intelligent assistant that reads all kinds of emails — work-related, personal, financial, promotional, alerts, and more.\n\nYour job is to:\n- Understand the core message and intent of the email\n- Write a short, clear **summary (max 300 characters)** as if you're notifying the user on Telegram\n- Use **plain English** with light emojis where helpful (📌, ⚠️, ✅, 💰, 🔔, etc.)\n- Highlight any important info: payment due, meeting, offer, delivery, confirmation, alert, etc.\n- Make sure it sounds natural and relevant — like a smart assistant updating someone quickly\n\n## ✍️ Output Format:\nOnly give the **summary text**. No intro, no explanation, no formatting tags.\n\n---\n\n### 📨 Examples:\n\n**Email about invoice:**  \n📌 Invoice from AWS for $23.50 is due by July 20. Check your billing portal to avoid service disruption.\n\n**Email from HR:**  \n✅ HR shared your July payslip. No action needed unless there's an error.\n\n**Amazon delivery email:**  \n📦 Your Amazon order \"AirPods Pro\" has been delivered today. Enjoy!\n\n**Newsletter:**  \n📰 New issue of \"FinTech Weekly\" is out — AI trends, market insights & more.\n\n\n---\n\nOnly return a short, smart Telegram-style summary like above — no headers, no extra context.\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.8
    },
    {
      "id": "7937a159-cb46-445b-87fc-3751297e269c",
      "name": "发送摘要到 Telegram",
      "type": "n8n-nodes-base.telegram",
      "position": [
        500,
        340
      ],
      "webhookId": "00abd92f-264e-401b-a032-a8e9e90962c1",
      "parameters": {
        "text": "={{ $json.output }}",
        "chatId": "7917193308",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "x5kGTW8ojjPJjQtB",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "30db915b-a020-48cf-9b69-b43c0e3b9fbe",
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Summarize Email with GPT-4o",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check for New Emails": {
      "main": [
        [
          {
            "node": "Important Email Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Important Email Filter": {
      "main": [
        [
          {
            "node": "Summarize Email with GPT-4o",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": " Ignore Unimportant Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Email with GPT-4o": {
      "main": [
        [
          {
            "node": "Send Summary to Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 个人效率, AI 摘要总结

需要付费吗?

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

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

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

作者
Roshan Ramani

Roshan Ramani

@rawsun007

I love building smart n8n automations that actually work reliably. My focus is on making everyday tasks like email, social media, and CRM workflows simpler using AI. I've shared templates in the n8n community, including a WhatsApp Expense Tracker that people really enjoy. What keeps me excited is constantly trying new things - testing fresh nodes, playing with AI tools like LangChain, and discovering creative ways to connect systems!

外部链接
在 n8n.io 查看

分享此工作流