8
n8n 中文网amn8n.com

多账户邮件分类器与AI、Gmail、Discord和Google Sheets

高级

这是一个Ticket Management, AI Summarization领域的自动化工作流,包含 28 个节点。主要使用 If, Set, Merge, Discord, Webhook 等节点。 使用AI、Gmail、Discord和Google Sheets的多账户邮件分类器

前置要求
  • Discord Bot Token 或 Webhook
  • HTTP Webhook 端点(n8n 会自动生成)
  • Google 账号和 Gmail API 凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "52254486b159b349334953c1738da94e90477c7604aa8db2062d11afc0120739",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "7fe486a9-4155-46b0-919d-9415294d933b",
      "name": "Gmail 触发器",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -220,
        1560
      ],
      "parameters": {
        "simple": false,
        "filters": {},
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "AQzIuqLFQrHetxAU",
          "name": "Gmail"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2a7c6a45-1f8e-4e24-bc6d-46ae2f615157",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -300,
        1480
      ],
      "parameters": {
        "color": 4,
        "width": 460,
        "height": 280,
        "content": "## account1@gmail.com"
      },
      "typeVersion": 1
    },
    {
      "id": "4029c86a-0a6e-4778-8f18-3938c01bbac3",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -300,
        1780
      ],
      "parameters": {
        "color": 6,
        "width": 460,
        "height": 280,
        "content": "## account2@gmail.com"
      },
      "typeVersion": 1
    },
    {
      "id": "44cab983-4b76-4d2b-85ba-7f2afd2b9751",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -300,
        2340
      ],
      "parameters": {
        "color": 5,
        "width": 460,
        "height": 240,
        "content": "## account4@gmail.com"
      },
      "typeVersion": 1
    },
    {
      "id": "3f6baa23-ade2-47e3-98ab-84495358ffac",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -300,
        2080
      ],
      "parameters": {
        "color": 3,
        "width": 460,
        "height": 240,
        "content": "## account3@gmail.com"
      },
      "typeVersion": 1
    },
    {
      "id": "58d2a3eb-cff8-49cb-9fa7-c8585007fe81",
      "name": "Gmail Trigger1",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -200,
        1860
      ],
      "parameters": {
        "simple": false,
        "filters": {},
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "uBHPq20pQrKQQ392",
          "name": "Gmail - account2@gmail.com"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d04aabfe-27f2-43b7-8248-30c8792a1b9e",
      "name": "Gmail 触发器2",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -200,
        2400
      ],
      "parameters": {
        "simple": false,
        "filters": {},
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "ryt2BPCFeLUoWi5s",
          "name": "Gmail - account3@gmail.com"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e712e083-bad9-43bc-ba5d-a8d4444eb840",
      "name": "Gmail 触发器3",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -200,
        2140
      ],
      "parameters": {
        "simple": false,
        "filters": {},
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "ryt2BPCFeLUoWi5s",
          "name": "Gmail - account3@gmail.com"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "26c242d1-6bdf-4f0b-9beb-96172766260c",
      "name": "合并4",
      "type": "n8n-nodes-base.merge",
      "position": [
        380,
        1600
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.1
    },
    {
      "id": "a507c42c-48cf-4576-b1c9-0358e51ca7e0",
      "name": "medium4",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        2140
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "6d582588-255e-4113-9811-3046c8f9861c",
              "name": "discord_channel",
              "type": "string",
              "value": "=1234567891"
            },
            {
              "id": "f69cbf07-eb5c-4987-bdb1-bc7e851ac68b",
              "name": "email",
              "type": "string",
              "value": "account3@gmail.com"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "ebf4ec42-b490-4fde-9905-b6020383f553",
      "name": "medium5",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        2400
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "6d582588-255e-4113-9811-3046c8f9861c",
              "name": "discord_channel",
              "type": "string",
              "value": "=1234567892"
            },
            {
              "id": "f69cbf07-eb5c-4987-bdb1-bc7e851ac68b",
              "name": "email",
              "type": "string",
              "value": "account4@gmail.com"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2ffcbca0-e8da-412a-bda8-c2f2fe203c6d",
      "name": "medium6",
      "type": "n8n-nodes-base.set",
      "position": [
        -20,
        1860
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "6d582588-255e-4113-9811-3046c8f9861c",
              "name": "discord_channel",
              "type": "string",
              "value": "=1234567893"
            },
            {
              "id": "f69cbf07-eb5c-4987-bdb1-bc7e851ac68b",
              "name": "email",
              "type": "string",
              "value": "account2@gmail.com"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "af0cf074-5659-4436-82b1-2feaf856b132",
      "name": "medium7",
      "type": "n8n-nodes-base.set",
      "position": [
        -20,
        1560
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "6d582588-255e-4113-9811-3046c8f9861c",
              "name": "discord_channel",
              "type": "string",
              "value": "=1234567894"
            },
            {
              "id": "f69cbf07-eb5c-4987-bdb1-bc7e851ac68b",
              "name": "email",
              "type": "string",
              "value": "account1@gmail.com"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d0f33ea4-9c96-49b5-900e-d279ca19763a",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        360,
        2160
      ],
      "webhookId": "347b7767-7df7-4e61-9daf-2edbc04e2d9b",
      "parameters": {
        "path": "email-feedback",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "06487c07-2f5f-47f4-80c2-4dcd3c6ae232",
      "name": "AI Agent1",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        580,
        2160
      ],
      "parameters": {
        "text": "=User Input : {{ $('Webhook').item.json.body.content.text }}\n\nReference discord message: {{ JSON.stringify($json.body.original_message.reference) }}",
        "options": {
          "systemMessage": "You are an AI agent running inside an n8n workflow.\nYou have three tools available:\n• getDiscordMessage(reference) – retrieves a Discord message when given a valid reference object\n• getSpamList() – retrieves the current list of spam emails and domains from Google Sheets\n• updateSpamList(columns) – appends or updates a row in the “Email spam list” sheet with the given columns\n\nBehavior:\n\nIf the user’s input indicates they want to classify an email (e.g. “spam” or “legit”):\na. If a valid reference object is provided, invoke getDiscordMessage(reference).\nb. Invoke getSpamList().\nc. Determine sender_email and domain from the retrieved message.\nd. Compare against the spam list to decide “spam” or “legit.”\ne. Invoke updateSpamList({email: sender_email, domain: domain, Classification: classification }).\nf. Respond with the classification result and if the list has been updated successfully\n\nIf the user’s input does not refer to classifying an email, do not call any tool; respond directly to the user’s inquiry. Remind the user that this tool is most affective when the user refers to a message to classify. "
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "02168687-bbed-4b39-80de-423c2a2a77eb",
      "name": "OpenAI 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        540,
        2400
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "k5QLUV8boAepwce0",
          "name": "OpenAi account - default project"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2237dfc1-ac37-43c8-9e9b-ca5658695b2a",
      "name": "获取垃圾邮件列表",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        820,
        2400
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "list"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iOYH829GJ-ytTlmz0Zsl875Efn1qyrwuv6Rx83N1QJU",
          "cachedResultUrl": "",
          "cachedResultName": "Email spam list"
        },
        "descriptionType": "manual",
        "toolDescription": "Get row(s) in sheet in email spam list Google Sheets. It contains a list of emails that are considered spam and legit."
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "dNmdYyKDCj9rTeSw",
          "name": "Gsheet"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "b5f66a06-791d-414b-b75e-97eb08bb1a41",
      "name": "Discord - 回复1",
      "type": "n8n-nodes-base.discord",
      "position": [
        900,
        2160
      ],
      "webhookId": "d20702a4-64e9-43e3-9259-b53bbf4f617e",
      "parameters": {
        "embeds": {
          "values": [
            {
              "color": "#FFD900",
              "author": "Email Feedback Bot",
              "description": "={{ $json.output }}"
            }
          ]
        },
        "content": "=",
        "guildId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Webhook').item.json.body.guild.id }}"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Webhook').item.json.body.channel.id }}"
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "discordOAuth2Api": {
          "id": "aAorRULaRsUXUcmc",
          "name": "Discord - your_bot"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "46628abc-5662-4ae5-b63a-115c36474722",
      "name": "在 Discord 中获取消息",
      "type": "n8n-nodes-base.discordTool",
      "position": [
        700,
        2400
      ],
      "webhookId": "795479d6-a960-4810-a4e8-96f5583d30a5",
      "parameters": {
        "guildId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $fromAI('guildId', 'guildId of the discord reference message') }}"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $fromAI('channelId', 'channelId of the discord reference message') }}"
        },
        "messageId": "={{ $fromAI('messageId', 'messageId of the discord reference message') }}",
        "operation": "get",
        "authentication": "oAuth2"
      },
      "credentials": {
        "discordOAuth2Api": {
          "id": "aAorRULaRsUXUcmc",
          "name": "Discord - your_bot"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "02cd39ce-397b-4793-a0f8-2987c19fbe3b",
      "name": "更新垃圾邮件列表",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        960,
        2400
      ],
      "parameters": {
        "columns": {
          "value": {
            "email": "={{ $fromAI('sender_email', 'email of the sender that wants to be labelled') }}",
            "domain": "={{ $fromAI('domain', 'domain name of the sender that wants to be labelled') }}",
            "labelled_by": "n8n",
            "labelled_date": "={{ $now.format('dd/MM/yyyy') }}",
            "Classification": "={{ $fromAI('classification', 'classigfication of the email whether spam or legit') }}"
          },
          "schema": [
            {
              "id": "domain",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "domain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Classification",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Classification",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "labelled_by",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "labelled_by",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "labelled_date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "labelled_date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "email"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "list"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iOYH829GJ-ytTlmz0Zsl875Efn1qyrwuv6Rx83N1QJU",
          "cachedResultUrl": "",
          "cachedResultName": "Email spam list"
        },
        "descriptionType": "manual",
        "toolDescription": "Update row(s) in sheet in email spam list Google Sheets. It can update or add a row of email, domain of the sender that is considered spam and legit."
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "dNmdYyKDCj9rTeSw",
          "name": "Gsheet "
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "0e411d2f-bf11-45cb-bc33-3710e60ce266",
      "name": "AI Agent2",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        600,
        1600
      ],
      "parameters": {
        "text": "=sender_email: {{ $json.from.text }}\nrecipient_email: {{ $json.to.text }}\nSubject: {{ $('Merge4').item.json.subject }}\nGmail labels: {{ $json.labelIds }}\nContent: {{ $('Merge4').item.json.text }}",
        "options": {
          "systemMessage": "You are an AI agent in an n8n workflow. You receive raw email objects with the following fields:  \n– `sender_email`  \n– `recipient_email`  \n– `subject`  \n– `content` (plain text)  \n– `labels` (Gmail labels)  \n– Optional: `image_url` (URL to image in email), `action_url` (main link to external content)\n\nYou also have access to a tool called `getSpamList()` which returns a list of sender emails and domains previously labeled as spam or legit.\n\n**Instructions:**\n\n1. **Classify as “Spam”** if any of the following are true:  \n   – The sender_email or its domain matches common spam sources (e.g., \"no-reply@\", \"offers@\", mass mailers, suspicious domains).  \n   – The content contains characteristics of spam: promotional offers, phishing attempts, irrelevant ads, mass marketing, or unsolicited content not relevant to the user or organization.  \n   – The sender_email or domain appears in the retrieved spam list.\n\n   If spam, return only:\n   ```json\n   {\n     \"priority\": \"Spam\"\n   }\nEnd execution.\n\nIf not spam, determine priority:\n– High: Time-sensitive emails from clients, leadership, legal, finance, or regarding contracts, deadlines, critical system issues, urgent decisions, or high-value opportunities.\n– Medium: Informative updates, meeting invites, team announcements, project updates, customer support, or internal collaboration threads that are useful but not urgent.\n– Low: Casual internal communication, newsletters, generic notifications, non-urgent follow-ups, or general FYI content.\n\nSummarize the email within 250 characters, include all key important information and numbers.\n\nPriority color mapping:\n– High: #00FF00\n– Medium: #0000FF\n– Low: #FF00000\n\nAlso include the image_url in the output if you find any relevant or important image url in the content. also include the action_url if you find any important url for the user to click"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "bbae2069-47d3-4f55-a114-a4a9207759ad",
      "name": "OpenAI 聊天模型3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        580,
        1800
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "k5QLUV8boAepwce0",
          "name": "OpenAi account - default project"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cbd46799-3228-4fb2-bdec-05419716c0c8",
      "name": "获取垃圾邮件列表1",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        700,
        1820
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "list"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1iOYH829GJ-ytTlmz0Zsl875Efn1qyrwuv6Rx83N1QJU",
          "cachedResultUrl": "",
          "cachedResultName": "Email spam list"
        },
        "descriptionType": "manual",
        "toolDescription": "Get row(s) in sheet in email spam list Google Sheets. It contains a list of emails that are considered spam and legit."
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "dNmdYyKDCj9rTeSw",
          "name": "Gsheet "
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "e82f45cd-2c46-48c9-abfe-5c10910035ee",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        280,
        2080
      ],
      "parameters": {
        "color": 7,
        "width": 1060,
        "height": 500,
        "content": "## 更新垃圾邮件列表"
      },
      "typeVersion": 1
    },
    {
      "id": "ffe9fa99-a06a-4933-b05d-1fb3405c6966",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        280,
        1480
      ],
      "parameters": {
        "color": 7,
        "width": 1060,
        "height": 580,
        "content": "## 过滤传入消息"
      },
      "typeVersion": 1
    },
    {
      "id": "88c45a39-408c-4afa-ac18-841139f12247",
      "name": "结构化输出解析器1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        820,
        1820
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"from\": \"ceo@partnercompany.com\",\n  \"to\": \"jay@company.com\",\n  \"subject\": \"Urgent: Contract Finalization by Tomorrow\",\n  \"summary\": \"The CEO is requesting immediate action to finalize and sign the strategic partnership contract before tomorrow's deadline.\",\n  \"priority\": \"High\",\n  \"priority_color\": 16711680,\n  \"image_url\" : \"\",\n  \"action_url\" : \"\"\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "fd357e53-3a9e-4ade-8e5a-86f400f32e3a",
      "name": "发送消息",
      "type": "n8n-nodes-base.discord",
      "position": [
        1160,
        1580
      ],
      "webhookId": "9f1031cf-e3a3-4d33-b2cb-fbb7d8240c44",
      "parameters": {
        "embeds": {
          "values": [
            {
              "url": "={{ $json.output.action_url }}",
              "color": "={{ $json.output.priority_color }}",
              "image": "={{ $json.output.image_url }}",
              "title": "={{ $json.output.subject }}",
              "author": "={{ $json.output.from }}",
              "description": "={{ $json.output.summary }}"
            }
          ]
        },
        "guildId": {
          "__rl": true,
          "mode": "list",
          "value": "1363069056558825554"
        },
        "options": {},
        "resource": "message",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Merge4').item.json.discord_channel }}"
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "discordOAuth2Api": {
          "id": "aAorRULaRsUXUcmc",
          "name": "Discord - webhook"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "24d1119c-7982-4e88-a75a-f85b67ba0c6d",
      "name": "如果2",
      "type": "n8n-nodes-base.if",
      "position": [
        900,
        1600
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "d8cf81aa-1b7c-4a54-87f0-2f86655c5875",
              "operator": {
                "type": "object",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{$json.output}}",
              "rightValue": "Spam"
            },
            {
              "id": "81703823-b378-4831-ace1-5242d45e7c41",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{$json.output.priority}}",
              "rightValue": "Spam"
            }
          ]
        }
      },
      "typeVersion": 2.2
    }
  ],
  "pinData": {},
  "connections": {
    "If2": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge4": {
      "main": [
        [
          {
            "node": "AI Agent2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "medium4": {
      "main": [
        [
          {
            "node": "Merge4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "medium5": {
      "main": [
        [
          {
            "node": "Merge4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "medium6": {
      "main": [
        [
          {
            "node": "Merge4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "medium7": {
      "main": [
        [
          {
            "node": "Merge4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "Discord - reply1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent2": {
      "main": [
        [
          {
            "node": "If2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get spam list": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "medium7",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge4",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get spam list1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent2",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger1": {
      "main": [
        [
          {
            "node": "medium6",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge4",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Gmail Trigger2": {
      "main": [
        [
          {
            "node": "medium5",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge4",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Gmail Trigger3": {
      "main": [
        [
          {
            "node": "medium4",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge4",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "update spam list": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent2",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get a message in Discord": {
      "ai_tool": [
        [
          {
            "node": "AI Agent1",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent2",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 工单管理, AI 摘要总结

需要付费吗?

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

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

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

作者
Jay Emp0

Jay Emp0

@jay-emp0

AI and Automation developer. Im implementing n8n and ai tools to automate marketing and sales in companies

外部链接
在 n8n.io 查看

分享此工作流