8
n8n 中文网amn8n.com

使用Gmail、SMTP和Google Sheets的自动批量冷邮件发送器

中级

这是一个Lead Nurturing领域的自动化工作流,包含 12 个节点。主要使用 If, Wait, Gmail, Limit, EmailSend 等节点。 使用Gmail、SMTP和Google Sheets的自动批量冷邮件发送器

前置要求
  • Google 账号和 Gmail API 凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "28099d2544433ae0f39c65315a4d4c531947fcb0f060a94d6047d7be5df31063",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "6afb72ca-c815-4fca-9125-f77d78bc46aa",
      "name": "遍历项目",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -560,
        160
      ],
      "parameters": {
        "options": {},
        "batchSize": "=1"
      },
      "typeVersion": 3
    },
    {
      "id": "c147dbb2-b8fd-4ff5-bd76-7940b1f8ddb2",
      "name": "限制",
      "type": "n8n-nodes-base.limit",
      "position": [
        -760,
        360
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "630c46c1-bf9a-4634-8ce2-a5bd054d1813",
      "name": "条件判断",
      "type": "n8n-nodes-base.if",
      "position": [
        -380,
        260
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "8dc5b028-6f5d-4d76-8852-99180bfb4591",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json['Email Address '] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "f6834735-f169-4ba4-86de-9ed5c7221628",
      "name": "更新记录",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        60,
        260
      ],
      "parameters": {
        "columns": {
          "value": {
            "Sent on": "={{ $now }}",
            "Message Id": "={{ $json.id }}",
            "Email Sent ": "Yes",
            "Email Address ": "={{ $('If').first().json['Email Address '] }}"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email Address ",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email Address ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Sender Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Sender Email",
              "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
            },
            {
              "id": "Email Sent ",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email Sent ",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Sent on",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Sent on",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Message Id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Message Id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Email Address "
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Tq1WP6qf-YHx5odZWHFit1nFvMLSRmxM0-Fkf8mx8zk/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Tq1WP6qf-YHx5odZWHFit1nFvMLSRmxM0-Fkf8mx8zk",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Tq1WP6qf-YHx5odZWHFit1nFvMLSRmxM0-Fkf8mx8zk/edit?usp=drivesdk",
          "cachedResultName": "Bulk Sender Template"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "NdBpgqV7UHdZ3CZc",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "6dd38853-6493-4677-8db2-0df6497aee42",
      "name": "发送邮件",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -140,
        260
      ],
      "webhookId": "2add08f1-0af8-4951-af47-721d2c4302ec",
      "parameters": {
        "sendTo": "={{ $json['Email Address '] }}",
        "message": "={{ $json['Email Body'] }}",
        "options": {},
        "subject": "={{ $json['Email Subject'] }}",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "Fd6oTce3HQiRi3dG",
          "name": "electrabot.info@gmail.com"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "6f4402a7-7519-444f-81a6-fc2600f936cd",
      "name": "获取邮件",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -940,
        360
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "No",
              "lookupColumn": "Email Sent "
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Tq1WP6qf-YHx5odZWHFit1nFvMLSRmxM0-Fkf8mx8zk/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1Tq1WP6qf-YHx5odZWHFit1nFvMLSRmxM0-Fkf8mx8zk",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Tq1WP6qf-YHx5odZWHFit1nFvMLSRmxM0-Fkf8mx8zk/edit?usp=drivesdk",
          "cachedResultName": "Bulk Sender Template"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "NdBpgqV7UHdZ3CZc",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "bdf30635-0665-40cd-bfee-b507c3a67f49",
      "name": "设置定时器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1120,
        360
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 6
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ea3e124e-7a38-4c67-b8a5-e61ec51b3ac6",
      "name": "等待",
      "type": "n8n-nodes-base.wait",
      "position": [
        280,
        340
      ],
      "webhookId": "c4cf719a-d47f-4761-8a16-aff92b8e9a19",
      "parameters": {
        "amount": 10
      },
      "typeVersion": 1.1
    },
    {
      "id": "e69107b7-6e00-4854-81cf-17da9b09b5af",
      "name": "连接",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -1120,
        160
      ],
      "webhookId": "49772db0-f2ab-4f5a-9b20-5b4f097f301c",
      "parameters": {
        "text": "={{ $json['Email body'] }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "={{ $json['Email subject'] }}",
        "toEmail": "={{ $json['Email Address '] }}",
        "fromEmail": "={{ $json['Sender email '] }}",
        "emailFormat": "text"
      },
      "credentials": {
        "smtp": {
          "id": "PnCWFLAx6sFw8ynW",
          "name": "team@electrabot.space"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "960aca19-606e-409b-b187-b1269bfdc907",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1180,
        -40
      ],
      "parameters": {
        "width": 1660,
        "height": 620,
        "content": "# 邮件发送器"
      },
      "typeVersion": 1
    },
    {
      "id": "85ac89d1-f0b8-4899-98d0-495db2f0018c",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1480,
        -40
      ],
      "parameters": {
        "width": 300,
        "height": 620,
        "content": "## 1. 设置指南"
      },
      "typeVersion": 1
    },
    {
      "id": "e6679e6b-cb5f-4b31-a05d-87b31dfe018e",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1160,
        60
      ],
      "parameters": {
        "color": 3,
        "width": 320,
        "height": 260,
        "content": "## 将此节点用于非Google邮件服务。"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Timer": {
      "main": [
        [
          {
            "node": "Get Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Emails": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email": {
      "main": [
        [
          {
            "node": "Update Records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Records": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 客户培育

需要付费吗?

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

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

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

作者
Gain FLow AI

Gain FLow AI

@gain-flow

GainFlow AI is your go-to AI automation agency, specializing in Python and no-code solutions to eliminate repetitive tasks for individuals and businesses. Free up your time and boost efficiency. For inquiries, Fill this form - https://docs.google.com/forms/d/e/1FAIpQLSfIiXdw4HMcI2HM-Obng13j_RFiKv7X-mjOVm_mcy2ucRA8EA/viewform or reach out to us at info.gainflow@gmail.com.

外部链接
在 n8n.io 查看

分享此工作流