8
n8n 中文网amn8n.com

使用Google Sheets和Gmail发送一次性紧急任务邮件提醒

中级

这是一个自动化工作流,包含 9 个节点。主要使用 If, Gmail, GoogleSheets, GoogleSheetsTrigger 等节点。 使用Google Sheets和Gmail发送一次性紧急任务邮件提醒

前置要求
  • Google 账号和 Gmail API 凭证
  • Google Sheets API 凭证

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "HWh5vnYnX9penlWW",
  "meta": {
    "instanceId": "0430772da25f7bca29bf5ef2b251086a85fb4096503a6f781526d32befd038d6",
    "templateCredsSetupCompleted": true
  },
  "name": "使用 Google Sheets 和 Gmail 发送一次性紧急任务邮件提醒",
  "tags": [
    {
      "id": "7zEwLFClveXBEcdb",
      "name": "google sheet",
      "createdAt": "2025-08-18T07:16:22.756Z",
      "updatedAt": "2025-08-18T07:16:22.756Z"
    },
    {
      "id": "eAzNESqLUWwWMrE9",
      "name": "gmail",
      "createdAt": "2025-08-18T07:16:22.709Z",
      "updatedAt": "2025-08-18T07:16:22.709Z"
    }
  ],
  "nodes": [
    {
      "id": "3df564ee-8eb5-42f6-876f-331fe9dc7994",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        -608
      ],
      "parameters": {
        "color": 3,
        "width": 304,
        "height": 176,
        "content": "## 必需条件"
      },
      "typeVersion": 1
    },
    {
      "id": "39c453ac-1335-4dac-a61b-e8f9753b3f80",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        -608
      ],
      "parameters": {
        "width": 560,
        "height": 800,
        "content": "## 1) 触发器、过滤器和行信息"
      },
      "typeVersion": 1
    },
    {
      "id": "5959b1f3-b7d5-4e32-b5ae-031eb81a89d3",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        -608
      ],
      "parameters": {
        "color": 5,
        "width": 208,
        "height": 800,
        "content": "## 2) 发送邮件"
      },
      "typeVersion": 1
    },
    {
      "id": "39c9bcce-68db-4c16-ba91-532f0d453a11",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        -608
      ],
      "parameters": {
        "color": 4,
        "width": 304,
        "height": 800,
        "content": "## 3) 更新 Google 表格"
      },
      "typeVersion": 1
    },
    {
      "id": "66e98b88-3ec6-4209-a857-3abf6f457631",
      "name": "紧急状态时触发",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        208,
        0
      ],
      "parameters": {
        "options": {
          "columnsToWatch": [
            "Priority"
          ]
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1a4_uY_GzzCkLRdF2yy9mT0TQj5bXsrxOBEWnGO68M9U/edit#gid=0",
          "cachedResultName": "Feuille 1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1a4_uY_GzzCkLRdF2yy9mT0TQj5bXsrxOBEWnGO68M9U",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1a4_uY_GzzCkLRdF2yy9mT0TQj5bXsrxOBEWnGO68M9U/edit?usp=drivesdk",
          "cachedResultName": "Reporting"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "id": "VMOoYKsdrAkV2QOY",
          "name": "Google Sheets Trigger account 4"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a4c3475f-63d3-49a0-b37f-34ba65c46c46",
      "name": "获取行号",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        416,
        0
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1a4_uY_GzzCkLRdF2yy9mT0TQj5bXsrxOBEWnGO68M9U/edit#gid=0",
          "cachedResultName": "Feuille 1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1a4_uY_GzzCkLRdF2yy9mT0TQj5bXsrxOBEWnGO68M9U",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1a4_uY_GzzCkLRdF2yy9mT0TQj5bXsrxOBEWnGO68M9U/edit?usp=drivesdk",
          "cachedResultName": "Reporting"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "957POclGdSYNVDfj",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "aef49d06-bd28-4073-a69c-a4ab005919e6",
      "name": "发送邮件的条件",
      "type": "n8n-nodes-base.if",
      "position": [
        624,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "bd3dbdbd-84b2-4a29-bc65-a0475de280bf",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{$json[\"Priority\"]}}",
              "rightValue": "Urgent"
            },
            {
              "id": "f3335fe7-b942-4489-b9d0-1df7e44ed103",
              "operator": {
                "type": "number",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.row_number }}",
              "rightValue": ""
            },
            {
              "id": "ffc346a2-3d88-47af-8215-b4c2f0e8e42e",
              "operator": {
                "type": "string",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json.Notified }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "23712547-0846-477d-b318-c6ef38f3decf",
      "name": "邮件提醒",
      "type": "n8n-nodes-base.gmail",
      "position": [
        832,
        -144
      ],
      "webhookId": "7e046604-db0a-4d26-8b5f-dfdf204c44b5",
      "parameters": {
        "sendTo": "your.email@example.com",
        "message": "=Hi,<br><br>\nA task has been marked as <b>Urgent</b> in the project tracking sheet.<br><br>\n📌 <b>Task:</b> {{$json[\"Task\"]}}<br>\n👤 <b>Owner:</b> {{$json[\"Owner\"]}}<br>\n📅 <b>Deadline:</b> {{$json[\"Deadline\"]}}<br>\n📋 <b>Status:</b> {{$json[\"Status\"]}}<br>\n🧭 <b>Next Step:</b> {{$json[\"Next step\"]}}<br><br>\nPlease review this task as soon as possible.<br><br>\n—<br>",
        "options": {},
        "subject": "A critical task has been flagged in the project sheet"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "M9FwThxXdSZG2WNo",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "c950b5b0-50e5-426d-8b3e-c84eb53d46a6",
      "name": "更新行避免垃圾邮件",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1040,
        -144
      ],
      "parameters": {
        "columns": {
          "value": {
            "Notified": "Yes",
            "row_number": "={{ $('Get the row number').item.json.row_number }}"
          },
          "schema": [
            {
              "id": "Task",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Task",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Owner",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Owner",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Deadline",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Deadline",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Next step",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Next step",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Priority",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Priority",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Notified",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Notified",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "threadId",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "threadId",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "labelIds",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "labelIds",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1a4_uY_GzzCkLRdF2yy9mT0TQj5bXsrxOBEWnGO68M9U/edit#gid=0",
          "cachedResultName": "Feuille 1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1a4_uY_GzzCkLRdF2yy9mT0TQj5bXsrxOBEWnGO68M9U",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1a4_uY_GzzCkLRdF2yy9mT0TQj5bXsrxOBEWnGO68M9U/edit?usp=drivesdk",
          "cachedResultName": "Reporting"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "957POclGdSYNVDfj",
          "name": "Google Sheets account 3"
        }
      },
      "typeVersion": 4.7
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "76e92de7-a1b6-4147-9087-de7b18d2467c",
  "connections": {
    "Email alert": {
      "main": [
        [
          {
            "node": "Update row avoiding spam",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the row number": {
      "main": [
        [
          {
            "node": "Condition to send the email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger when Urgent status": {
      "main": [
        [
          {
            "node": "Get the row number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Condition to send the email": {
      "main": [
        [
          {
            "node": "Email alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级

需要付费吗?

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

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

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

作者
Yassin Zehar

Yassin Zehar

@yassinzehar

Digital & IT Project Manager | Data-oriented | Agile certified (PSM I, PSPO I) | Paris

外部链接
在 n8n.io 查看

分享此工作流