8
n8n 中文网amn8n.com

AI个性化多产品邮件营销

高级

这是一个Sales, AI, Marketing领域的自动化工作流,包含 41 个节点。主要使用 If, Code, Wait, Gmail, Filter 等节点,结合人工智能技术实现智能自动化。 基于SMTP轮换的AI个性化多产品邮件营销(GPT-4o/o3-mini)

前置要求
  • Google 账号和 Gmail API 凭证
  • 可能需要目标 API 的认证凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "4786bf0f18c0e8e92c361de5a158cabf4eb0bb3b9c113091b054ff26e359a029",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "2bbfcb6a-940c-49ee-848a-65516c28b24f",
      "name": "从 Google 搜索中提取 URL",
      "type": "n8n-nodes-base.code",
      "position": [
        1240,
        260
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "2f089fa5-d328-4cad-ba18-b099d0db828e",
      "name": "移除重复 URL",
      "type": "n8n-nodes-base.removeDuplicates",
      "onError": "continueErrorOutput",
      "position": [
        2120,
        180
      ],
      "parameters": {},
      "typeVersion": 1.1,
      "alwaysOutputData": true
    },
    {
      "id": "0c4f7004-a7bd-4233-b20e-bd7a96c20bd8",
      "name": "移除重复电子邮件",
      "type": "n8n-nodes-base.removeDuplicates",
      "onError": "continueErrorOutput",
      "position": [
        2000,
        1180
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "3c7bff6c-28f9-4d95-9e97-68e69c274931",
      "name": "将电子邮件拆分为项目",
      "type": "n8n-nodes-base.splitOut",
      "onError": "continueRegularOutput",
      "position": [
        1380,
        940
      ],
      "parameters": {},
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "77624839-8afe-47c4-ad2d-6f10da785dca",
      "name": "聚合电子邮件列表",
      "type": "n8n-nodes-base.aggregate",
      "onError": "continueErrorOutput",
      "position": [
        1000,
        940
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "0ca87cc7-2112-46c4-9f5e-5229687624e4",
      "name": "搜索 Google Maps",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        880,
        260
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "4f3d81c4-ea82-48c5-9b84-8afc6e458ac3",
      "name": "过滤掉 Google/Schema URL",
      "type": "n8n-nodes-base.filter",
      "onError": "continueRegularOutput",
      "position": [
        1540,
        240
      ],
      "parameters": {},
      "typeVersion": 2.2,
      "alwaysOutputData": false
    },
    {
      "id": "8e23dc4c-a801-4114-8a59-618b85efb6e1",
      "name": "循环遍历唯一 URL",
      "type": "n8n-nodes-base.splitInBatches",
      "onError": "continueRegularOutput",
      "position": [
        2620,
        360
      ],
      "parameters": {},
      "typeVersion": 3,
      "alwaysOutputData": false
    },
    {
      "id": "4b7f2746-aad4-4105-ad42-988ed2d2161d",
      "name": "获取网站内容(通过 URL)",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        3060,
        480
      ],
      "parameters": {},
      "typeVersion": 4.2,
      "alwaysOutputData": false
    },
    {
      "id": "2ac85d70-e59c-4e61-a859-fa56256176ef",
      "name": "循环遍历网站内容批次",
      "type": "n8n-nodes-base.splitInBatches",
      "onError": "continueRegularOutput",
      "position": [
        700,
        940
      ],
      "parameters": {},
      "executeOnce": false,
      "typeVersion": 3,
      "alwaysOutputData": false
    },
    {
      "id": "3e1b74a7-990d-44ac-b5ba-6174096d5347",
      "name": "提取和过滤电子邮件",
      "type": "n8n-nodes-base.code",
      "onError": "continueRegularOutput",
      "position": [
        860,
        1120
      ],
      "parameters": {},
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "aea3cd69-adf5-4694-b331-f7f36a2c1cdd",
      "name": "循环遍历搜索查询",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        260,
        240
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "46c01643-a99b-4d62-85f1-ddeb79c0c781",
      "name": "在 Google 搜索前等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        600,
        260
      ],
      "webhookId": "32ec8dc4-ed5a-40c8-815a-b892fa400908",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "f37d04cc-5829-4b7a-8c00-2e20a5b045ae",
      "name": "处理 AI 生成的查询",
      "type": "n8n-nodes-base.code",
      "position": [
        20,
        180
      ],
      "parameters": {},
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "d9964fd4-ccd2-4cdd-9ab1-6ae585e87e0a",
      "name": "生成 Google Maps 查询(OpenAI)",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -440,
        180
      ],
      "parameters": {},
      "executeOnce": false,
      "typeVersion": 1.4,
      "alwaysOutputData": true
    },
    {
      "id": "de4f2577-7409-4785-a6b1-ba80348dea0e",
      "name": "从电子邮件中提取域名",
      "type": "n8n-nodes-base.code",
      "position": [
        960,
        1840
      ],
      "parameters": {},
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "d4497c99-b6c9-4d69-bc95-2f96869f1b59",
      "name": "循环遍历唯一电子邮件",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        540,
        1840
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "e71ee458-1b74-4f60-b5e4-d54c88bedb61",
      "name": "抓取网站内容(Jina.ai)",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        1240,
        1840
      ],
      "parameters": {},
      "typeVersion": 4.2,
      "alwaysOutputData": true
    },
    {
      "id": "c84a0ae2-9c6b-4013-9e2f-ce2ecd45e064",
      "name": "检查抓取错误",
      "type": "n8n-nodes-base.if",
      "position": [
        1540,
        1840
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "076795cc-c588-4ecf-a614-b5baa991b630",
      "name": "截断网站内容",
      "type": "n8n-nodes-base.code",
      "position": [
        1780,
        1860
      ],
      "parameters": {},
      "typeVersion": 2,
      "alwaysOutputData": true
    },
    {
      "id": "0e3ba69b-dfa2-4a4b-9cc1-f62b8d76076a",
      "name": "检查 URL 是否存在",
      "type": "n8n-nodes-base.if",
      "position": [
        1780,
        300
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "9369fe87-b227-4929-b001-eda425192321",
      "name": "在电子邮件之间等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        3680,
        2500
      ],
      "webhookId": "04b9e877-2ede-45ba-973b-3bd02aa24dcd",
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "5d04cf90-0717-4043-b5e3-045010fa491c",
      "name": "生成随机延迟",
      "type": "n8n-nodes-base.code",
      "position": [
        3500,
        1920
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "224201c5-a994-4a94-9bdf-6ef140466777",
      "name": "便签:抓取部分",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        0
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b6415488-0675-4d9f-ac5e-2726866ffb50",
      "name": "便签:电子邮件提取部分",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -20,
        900
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "a99dfb07-c04e-4b3d-9b9f-2ea972e871af",
      "name": "便签:个性化和发送部分",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        1600
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "cd8da4f0-c732-4bab-ad07-1a71435d505c",
      "name": "生成个性化电子邮件(LLM Chain)",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        2160,
        1860
      ],
      "parameters": {},
      "typeVersion": 1.5
    },
    {
      "id": "cb2cfc94-1381-4bb8-b423-a1c4d8c48b3c",
      "name": "解析 AI 电子邮件输出(JSON)",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        2260,
        2120
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "09094316-4cb8-4879-8a01-fc68eb3c11f8",
      "name": "无操作(如果 URL 无效)",
      "type": "n8n-nodes-base.noOp",
      "position": [
        2020,
        360
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "a889ad50-02fb-4ef0-a56d-34471b3c9de3",
      "name": "手动触发器:启动工作流",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1060,
        220
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f3960d5f-ff1c-4870-a8b2-11ccf239c55e",
      "name": "便签:配置",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1220,
        -20
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "e43371b8-1ddb-40a3-947b-8e10d35d85e5",
      "name": "配置 OpenAI 聊天模型(GPT-4o-mini)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2020,
        2120
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "ba8d2a27-5658-4d52-b25e-09681dd47f4b",
      "name": "便签:工作流描述",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2720,
        900
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "47eda3fc-472d-4ceb-8f15-2b052cd114a2",
      "name": "设置随机索引",
      "type": "n8n-nodes-base.function",
      "position": [
        2680,
        1840
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "7575bee6-9da1-4397-82a3-5399691512e8",
      "name": "切换 SMTP",
      "type": "n8n-nodes-base.switch",
      "position": [
        2920,
        1820
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "a54ea639-2eb4-4cdf-a712-6f1f48453c53",
      "name": "Gmail 1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3240,
        1620
      ],
      "webhookId": "649efc94-e48b-47c7-bdda-f40e021386e7",
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "fa420d07-2e5a-46dd-8226-0bc27738e2a1",
      "name": "Gmail 3",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3240,
        1920
      ],
      "webhookId": "cdb9e899-975e-47c6-846a-ac16cf64c222",
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "cf301d59-2dfd-4f4b-a9e0-966c8e7b44a3",
      "name": "Gmail 4",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3240,
        2060
      ],
      "webhookId": "0ae23504-dc68-4fda-95a1-5dedbb183cb2",
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "68c173d1-de99-4602-8106-9b47c35da110",
      "name": "Gmail 5",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3240,
        2320
      ],
      "webhookId": "0b6da549-ac77-4ad5-b6bb-c442750b84c4",
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "1b89b546-7023-4585-801b-af984af3f00c",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3240,
        1760
      ],
      "webhookId": "cdb9e899-975e-47c6-846a-ac16cf64c222",
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "1314d224-2831-4796-92fc-6869bef9ed9d",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -720,
        140
      ],
      "parameters": {},
      "typeVersion": 3
    }
  ],
  "pinData": {
    "MANUAL TRIGGER: Start Workflow": [
      {
        "product_link": "https://www.example.com/ai-content-pro",
        "product_name": "AI Content Generator Pro",
        "product_description": "A SaaS tool that automatically generates high-quality, SEO-optimized blog posts and marketing copy using advanced AI, saving businesses hours of work and boosting their online visibility."
      },
      {
        "product_link": "https://www.example.com/sales-automator",
        "product_name": "Sales Outreach Automator",
        "product_description": "An AI-driven solution to automate cold email outreach and follow-ups with personalization and scheduling."
      },
      {
        "product_link": "https://www.example.com/seo-boost-toolkit",
        "product_name": "SEO Boost Toolkit",
        "product_description": "A suite that analyzes websites and automatically applies SEO best practices to improve rankings."
      },
      {
        "product_link": "https://www.example.com/social-scheduler",
        "product_name": "Social Media Scheduler",
        "product_description": "An AI platform to plan, auto-post, and optimize social media content for maximum engagement."
      },
      {
        "product_link": "https://www.example.com/customer-insights",
        "product_name": "Customer Insights Dashboard",
        "product_description": "A real-time analytics dashboard powered by AI that surfaces key customer behavior insights."
      }
    ]
  },
  "connections": {
    "Gmail ": {
      "main": [
        [
          {
            "node": "Generate Random Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail 1": {
      "main": [
        [
          {
            "node": "Generate Random Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail 3": {
      "main": [
        [
          {
            "node": "Generate Random Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail 4": {
      "main": [
        [
          {
            "node": "Generate Random Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail 5": {
      "main": [
        [
          {
            "node": "Generate Random Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch SMTP": {
      "main": [
        [
          {
            "node": "Gmail 1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Gmail ",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Gmail 3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Gmail 4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Gmail 5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Generate Google Maps Queries (OpenAI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Random Index": {
      "main": [
        [
          {
            "node": "Switch SMTP",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Google Maps": {
      "main": [
        [
          {
            "node": "Extract URLs from Google Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if URL Exists": {
      "main": [
        [
          {
            "node": "Remove Duplicate URLs",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "NoOp (If URL Invalid)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Between Emails": {
      "main": [
        [
          {
            "node": "Loop Through Unique Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Email Lists": {
      "main": [
        [
          {
            "node": "Split Emails into Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Random Delay": {
      "main": [
        [
          {
            "node": "Wait Between Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicate URLs": {
      "main": [
        [
          {
            "node": "Loop Through Unique URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicate Emails": {
      "main": [
        [
          {
            "node": "Loop Through Unique Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Emails into Items": {
      "main": [
        [
          {
            "node": "Remove Duplicate Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for Scraping Error": {
      "main": [
        [
          {
            "node": "Loop Through Unique Emails",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Truncate Website Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Through Unique URLs": {
      "main": [
        [
          {
            "node": "Loop Through Website Content Batches",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fetch Website Content (via URL)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Truncate Website Content": {
      "main": [
        [
          {
            "node": "Generate Personalized Email (LLM Chain)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Domain from Email": {
      "main": [
        [
          {
            "node": "Scrape Website Content (Jina.ai)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract and Filter Emails": {
      "main": [
        [
          {
            "node": "Loop Through Website Content Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait Before Google Search": {
      "main": [
        [
          {
            "node": "Search Google Maps",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Through Unique Emails": {
      "main": [
        [
          {
            "node": "Loop Through Search Queries",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract Domain from Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Through Search Queries": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait Before Google Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Email Output (JSON)": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Personalized Email (LLM Chain)",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Process AI-Generated Queries": {
      "main": [
        [
          {
            "node": "Loop Through Search Queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Out Google/Schema URLs": {
      "main": [
        [
          {
            "node": "Check if URL Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MANUAL TRIGGER: Start Workflow": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract URLs from Google Search": {
      "main": [
        [
          {
            "node": "Filter Out Google/Schema URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Website Content (via URL)": {
      "main": [
        [
          {
            "node": "Loop Through Unique URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Website Content (Jina.ai)": {
      "main": [
        [
          {
            "node": "Check for Scraping Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Through Website Content Batches": {
      "main": [
        [
          {
            "node": "Aggregate Email Lists",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract and Filter Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Google Maps Queries (OpenAI)": {
      "main": [
        [
          {
            "node": "Process AI-Generated Queries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Personalized Email (LLM Chain)": {
      "main": [
        [
          {
            "node": "Set Random Index",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure OpenAI Chat Model (GPT-4o-mini)": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Personalized Email (LLM Chain)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 销售, 人工智能, 营销

需要付费吗?

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

工作流信息
难度等级
高级
节点数量41
分类3
节点类型19
难度说明

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

外部链接
在 n8n.io 查看

分享此工作流