8
n8n 中文网amn8n.com

使用艾森豪威尔矩阵和GPT-4.1-mini自动化Gmail邮件分诊

高级

这是一个AI Summarization, Multimodal AI领域的自动化工作流,包含 18 个节点。主要使用 Gmail, Filter, GmailTrigger, ManualTrigger, LmChatOpenAi 等节点。 使用艾森豪威尔矩阵和GPT-4.1-mini自动化Gmail邮件分诊

前置要求
  • Google 账号和 Gmail API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "d97a35efa9230ba825e389dcf8247ce5a77a88f4113df9825ba41d6ce9398085"
  },
  "nodes": [
    {
      "id": "cd71d5f3-b50b-426d-840d-da6eea33a217",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        448
      ],
      "parameters": {
        "color": 2,
        "width": 336,
        "height": 956,
        "content": "# ⚙️ 初始设置指南"
      },
      "typeVersion": 1
    },
    {
      "id": "5a5a84e6-bf32-4ef0-bc87-160d5fb5a610",
      "name": "Gmail 触发器",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        816,
        608
      ],
      "parameters": {
        "simple": false,
        "filters": {},
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "sRvASHepRFHWjDk4",
          "name": "IAM"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "6da49556-8b27-49bc-ac4a-7bd31dd371c7",
      "name": "AI 邮件分类器",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "position": [
        1088,
        736
      ],
      "parameters": {
        "options": {
          "systemPromptTemplate": "You are an expert email prioritization assistant. Classify the email based on the Eisenhower Matrix principles. Consider sender importance, content urgency, business impact, and deadline implications. Output only the category in JSON format without explanation."
        },
        "inputText": "={{ $json.text }}",
        "categories": {
          "categories": [
            {
              "category": "Urgent + Important",
              "description": "Emails requiring immediate action due to high impact. Not addressing them could have serious consequences. Includes legal matters, critical financial issues, investor communications, regulatory compliance, or user problems blocking service usage."
            },
            {
              "category": "Not Urgent + Important",
              "description": "Messages with high strategic value but no immediate deadline. Includes partnership opportunities, negotiations, relevant invitations, and key coordination that can be scheduled thoughtfully."
            },
            {
              "category": "Urgent + Not Important",
              "description": "Emails needing quick attention but not requiring your direct involvement. Operational or technical matters that can be delegated to another person or team without affecting strategic objectives."
            },
            {
              "category": "Not Urgent + Not Important",
              "description": "Emails with no immediate or strategic value. Includes promotions, spam, and generic messages that distract and can be ignored, deleted, or batch-reviewed later."
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "cc962116-3299-428f-9a88-06cfff08501b",
      "name": "OpenAI GPT-4",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1160,
        1024
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "gaxCelkF84KGUr4n",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "034c4031-95dc-4593-89f1-9cf0903591d7",
      "name": "标签:不紧急 + 重要",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1440,
        640
      ],
      "webhookId": "1004a7e9-b2fb-41f6-abbb-3d0f7989b12c",
      "parameters": {
        "labelIds": [
          "Label_108825101456559558"
        ],
        "messageId": "={{ $json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "sRvASHepRFHWjDk4",
          "name": "IAM"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "683a55c5-8738-4503-b721-42c5ba6fcbb2",
      "name": "标签:紧急 + 重要",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1440,
        448
      ],
      "webhookId": "226c3439-cf11-406d-9369-cbdc5d56bd69",
      "parameters": {
        "labelIds": [
          "Label_4335697733647997523"
        ],
        "messageId": "={{ $json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "sRvASHepRFHWjDk4",
          "name": "IAM"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "17983317-e9ca-4d3f-bf7c-b8cf07955972",
      "name": "标签:紧急 + 不重要",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1440,
        832
      ],
      "webhookId": "7dcbf4d7-d400-4535-a867-a581fde2595c",
      "parameters": {
        "labelIds": [
          "Label_3686091807609025659"
        ],
        "messageId": "={{ $json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "sRvASHepRFHWjDk4",
          "name": "IAM"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "90f85ac6-a960-443c-9b26-9da29fde9a59",
      "name": "标签:不紧急 + 不重要",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1440,
        1024
      ],
      "webhookId": "f04eabdf-4db0-4de9-ae25-b22f78b229fe",
      "parameters": {
        "labelIds": [
          "Label_4004303968176711355"
        ],
        "messageId": "={{ $json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "sRvASHepRFHWjDk4",
          "name": "IAM"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "2ce3c21f-59ed-45bc-9606-72f74f792dc0",
      "name": "归档邮件",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1664,
        1024
      ],
      "webhookId": "ab56d3b1-f368-47f0-bbe1-7171ab7de394",
      "parameters": {
        "labelIds": [
          "INBOX",
          "CATEGORY_PERSONAL",
          "CATEGORY_FORUMS",
          "CATEGORY_PROMOTIONS",
          "CATEGORY_SOCIAL",
          "CATEGORY_UPDATES"
        ],
        "messageId": "={{ $json.id }}",
        "operation": "removeLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "sRvASHepRFHWjDk4",
          "name": "IAM"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "0ba5af91-5501-4146-b43e-d9ac4c681a66",
      "name": "手动测试触发器",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        256,
        1488
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b57271f1-5747-4547-96f1-1a4cc13fddde",
      "name": "批量处理邮件",
      "type": "n8n-nodes-base.gmail",
      "position": [
        448,
        1488
      ],
      "webhookId": "29d04f95-7070-4786-8f36-d2a5cca8706b",
      "parameters": {
        "limit": 5,
        "simple": false,
        "filters": {
          "labelIds": [
            "INBOX"
          ],
          "readStatus": "unread"
        },
        "options": {},
        "operation": "getAll"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "sRvASHepRFHWjDk4",
          "name": "IAM"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "6737dc62-1849-4fdf-8ad7-03002c81312b",
      "name": "过滤有效邮件",
      "type": "n8n-nodes-base.filter",
      "position": [
        640,
        1488
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "af426b69-affb-4fe6-a375-f5a711f553d3",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.text }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "fb3982b8-2085-43a0-a281-661b520eb3ca",
      "name": "便签 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        592
      ],
      "parameters": {
        "width": 352,
        "height": 480,
        "content": "# 📥 自动邮件检测"
      },
      "typeVersion": 1
    },
    {
      "id": "d3e65c11-555b-435d-b4f3-2aa83c2cabc6",
      "name": "便签 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -64
      ],
      "parameters": {
        "width": 880,
        "height": 592,
        "content": "# 📧 艾森豪威尔矩阵邮件自动化"
      },
      "typeVersion": 1
    },
    {
      "id": "1e5e4e33-579f-4cd1-8aff-f1cf46db7269",
      "name": "便签 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        1184
      ],
      "parameters": {
        "width": 416,
        "height": 944,
        "content": "# 🤖 AI 分类引擎"
      },
      "typeVersion": 1
    },
    {
      "id": "428158f8-3354-49a2-a558-dc95f529e330",
      "name": "便签 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        208
      ],
      "parameters": {
        "width": 624,
        "height": 752,
        "content": "# 🏷️ GMAIL 标签系统"
      },
      "typeVersion": 1
    },
    {
      "id": "53971ed2-e8f7-45a5-a708-b07d663daf4f",
      "name": "便签 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1648,
        1200
      ],
      "parameters": {
        "width": 560,
        "height": 496,
        "content": "# 🗄️ 自动归档功能"
      },
      "typeVersion": 1
    },
    {
      "id": "9ccd31b9-f706-443e-8074-ab86ee691ebc",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        1664
      ],
      "parameters": {
        "width": 512,
        "height": 720,
        "content": "# 🧪 手动批量处理"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "OpenAI GPT-4": {
      "ai_languageModel": [
        [
          {
            "node": "AI Email Classifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "AI Email Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Email Classifier": {
      "main": [
        [
          {
            "node": "Label: Urgent + Important",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Label: Not Urgent + Important",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Label: Urgent + Not Important",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Label: Not Urgent + Not Important",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Valid Emails": {
      "main": [
        [
          {
            "node": "AI Email Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Test Trigger": {
      "main": [
        [
          {
            "node": "Batch Process Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Batch Process Emails": {
      "main": [
        [
          {
            "node": "Filter Valid Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Label: Not Urgent + Not Important": {
      "main": [
        [
          {
            "node": "Archive Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - AI 摘要总结, 多模态 AI

需要付费吗?

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

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

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

作者
外部链接
在 n8n.io 查看

分享此工作流