8
n8n 中文网amn8n.com

冷线索重新参与邮件生成器:GPT-4o-mini、Outlook和Sheets

中级

这是一个Lead Nurturing, Multimodal AI领域的自动化工作流,包含 15 个节点。主要使用 Code, Aggregate, GoogleSheets, ManualTrigger, Agent 等节点。 冷线索重新参与邮件生成器:GPT-4o-mini、Outlook和Sheets

前置要求
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "ad0113c344ee237399e44e9f11798b05baeb83a6196d514a9ae9d2ad71c3b5c9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "1a7a6e6d-94e9-4c5d-bdaf-bba303afba79",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        760,
        560
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "4l6TDfLZVFS24g3X",
          "name": "OpenAi account 4"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ea89f057-8d27-4458-bf2c-9e9491c684c2",
      "name": "多表:您可以连接多个表以实现有组织的数据结构",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        880,
        560
      ],
      "parameters": {
        "jsonSchemaExample": "{\n\t\"summary\": \"summary\",\n\t\"how to re-engage\": \"how to re-engage\", \n   \"email subject\": \"email subject\", \n  \"email body\": \"Email Body\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "099926bf-2203-440a-bdc2-24f0e37d9384",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        -40
      ],
      "parameters": {
        "color": 5,
        "width": 440,
        "height": 760,
        "content": "### 📥 步骤 1 — 从 Google Sheets 拉取邮箱列表"
      },
      "typeVersion": 1
    },
    {
      "id": "5115756e-826f-46c9-ab01-94c67a18b914",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        -40
      ],
      "parameters": {
        "color": 4,
        "width": 600,
        "height": 760,
        "content": "### 📬 步骤 2 — 在 Outlook 中搜索历史对话记录"
      },
      "typeVersion": 1
    },
    {
      "id": "75834341-74f5-4722-b106-f3b5ff80a1e3",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        660,
        -40
      ],
      "parameters": {
        "color": 6,
        "width": 380,
        "height": 760,
        "content": "### 🧠 步骤 4 — 使用 OpenAI 总结并建议重新互动策略"
      },
      "typeVersion": 1
    },
    {
      "id": "2c7676d8-650d-46e9-8fe9-152f5afebc7b",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1060,
        -40
      ],
      "parameters": {
        "color": 3,
        "width": 380,
        "height": 760,
        "content": "### 📨 步骤 6 — 在 Outlook 中创建草稿邮件"
      },
      "typeVersion": 1
    },
    {
      "id": "2355df82-9e1c-4777-bf90-4e7caa77cf9b",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -420,
        -200
      ],
      "parameters": {
        "width": 1860,
        "height": 140,
        "content": "# 🤖 基于 Google Sheets、Outlook 和 OpenAI 的 AI 驱动潜在客户重新互动"
      },
      "typeVersion": 1
    },
    {
      "id": "f56ec71b-15bd-4288-96cd-5726b79a36a2",
      "name": "启动工作流",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -400,
        300
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "1f053b63-9915-4cfd-b70d-ac922a58f0d2",
      "name": "获取沉寂线索",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -200,
        480
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rQD493GNtTWms6GF0Wracu9Yrm0AR0jxwaWdv8eJbUM/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1rQD493GNtTWms6GF0Wracu9Yrm0AR0jxwaWdv8eJbUM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rQD493GNtTWms6GF0Wracu9Yrm0AR0jxwaWdv8eJbUM/edit?usp=drivesdk",
          "cachedResultName": "Lead ReEngagement"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "HlBW2puZbuCCq8jJ",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "2d3d468f-6d2e-4c13-a477-01c4f41bc3d1",
      "name": "获取该线索的所有邮件",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        80,
        560
      ],
      "webhookId": "48751adc-6119-4d5e-9934-d84cecb1594c",
      "parameters": {
        "output": "raw",
        "options": {},
        "filtersUI": {
          "values": {
            "filters": {
              "custom": "receivedDateTime ge 2025-01-01T00:00:00Z",
              "sender": "={{ $json.Email }}"
            }
          }
        },
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "microsoftOutlookOAuth2Api": {
          "id": "v6aLYotT4QswHVsA",
          "name": "Microsoft Outlook account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "fb0efd84-b82b-44e9-bb74-59b4fd6e9e3a",
      "name": "合并到单一字段",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        280,
        560
      ],
      "parameters": {
        "include": "specifiedFields",
        "options": {},
        "aggregate": "aggregateAllItemData",
        "fieldsToInclude": "subject,  body, createdDateTime"
      },
      "typeVersion": 1
    },
    {
      "id": "306c8218-4f43-4a77-accf-19d3c64fd5cb",
      "name": "将对象字段转换为文本",
      "type": "n8n-nodes-base.code",
      "position": [
        460,
        560
      ],
      "parameters": {
        "jsCode": "return [\n  {\n    json: {\n      text: items.map(item => JSON.stringify(item.json)).join('\\n'),\n    },\n  },\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "311c5ecd-fa2b-4259-a0ba-cb9f0e8d81f2",
      "name": "AI Agent - 重新互动线索",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        720,
        360
      ],
      "parameters": {
        "text": "=Recent Emails from lead: {{ $json.text }}",
        "options": {
          "systemMessage": "You are a helpful assistant trained to analyze prior email conversations for lead re-engagement.\n\nGiven a list of recent emails from a contact, perform the following:\n\n1. Summarize what the person has communicated in the past. Focus on the main topics, interests, concerns, or any open threads.\n2. Suggest 2–3 strategic ideas for how I can re-engage this lead. Format your suggestions as bullet points.\n3. Write a professional, friendly re-engagement email I can send them. Make the tone approachable but business-relevant.\n\nReturn your output in the following JSON structure:\n\n{\n  \"summary\": \"Concise summary of their past emails\",\n  \"how to re-engage\": \"• First suggestion\\n• Second suggestion\\n• Third suggestion\",\n  \"email subject\": \"Suggested subject line\",\n  \"email body\": \"Complete draft email body\"\n}\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 2
    },
    {
      "id": "070dd56f-5d64-4132-a93c-1344185d985a",
      "name": "将数据保存到 Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1180,
        460
      ],
      "parameters": {
        "columns": {
          "value": {
            "Email": "={{ $('Get Stale Leads').item.json.Email }}",
            "Summary": "={{ $json.output.summary }}",
            "Email Body": "={{ $json.output['email body'] }}",
            "Email Subject": "={{ $json.output['email subject'] }}",
            "How Can I Re-Engage": "={{ $json.output['how to re-engage'] }}"
          },
          "schema": [
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Summary",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Summary",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "How Can I Re-Engage",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "How Can I Re-Engage",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email Subject",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email Subject",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email Body",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email Body",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Email"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rQD493GNtTWms6GF0Wracu9Yrm0AR0jxwaWdv8eJbUM/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1rQD493GNtTWms6GF0Wracu9Yrm0AR0jxwaWdv8eJbUM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rQD493GNtTWms6GF0Wracu9Yrm0AR0jxwaWdv8eJbUM/edit?usp=drivesdk",
          "cachedResultName": "Lead ReEngagement"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "HlBW2puZbuCCq8jJ",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "fc7a0147-ac51-4500-aaf5-f233f1af8c7a",
      "name": "创建草稿邮件",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        1320,
        580
      ],
      "webhookId": "ad54610a-00fe-4f41-92a5-2c8031dddf5b",
      "parameters": {
        "subject": "={{ $json.output['email subject'] }}",
        "resource": "draft",
        "bodyContent": "={{ $json.output['email body'] }}",
        "additionalFields": {
          "toRecipients": "={{ $('Get Stale Leads').item.json.Email }}"
        }
      },
      "credentials": {
        "microsoftOutlookOAuth2Api": {
          "id": "v6aLYotT4QswHVsA",
          "name": "Microsoft Outlook account"
        }
      },
      "typeVersion": 2
    }
  ],
  "pinData": {},
  "connections": {
    "Start Workflow": {
      "main": [
        [
          {
            "node": "Get Stale Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Stale Leads": {
      "main": [
        [
          {
            "node": "Get all emails from the lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent - Re-Engage Lead",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Combine into one field": {
      "main": [
        [
          {
            "node": "Convert object fields to text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent - Re-Engage Lead",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent - Re-Engage Lead": {
      "main": [
        [
          {
            "node": "Create draft email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Save data to Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all emails from the lead": {
      "main": [
        [
          {
            "node": "Combine into one field",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert object fields to text": {
      "main": [
        [
          {
            "node": "AI Agent - Re-Engage Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 客户培育, 多模态 AI

需要付费吗?

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

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

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

作者
Robert Breen

Robert Breen

@rbreen

Professional services consultant with over 10 years of experience solving complex business problems across industries. I specialize in n8n and process automation—designing custom workflows that integrate tools like Google Calendar, Airtable, GPT, and internal systems. Whether you need to automate scheduling, sync data, or streamline operations, I build solutions that save time and drive results.

外部链接
在 n8n.io 查看

分享此工作流