8
n8n 中文网amn8n.com

使用Google表格、Telegram和Gmail的错误处理警报

中级

这是一个DevOps领域的自动化工作流,包含 6 个节点。主要使用 Set, Gmail, Telegram, ErrorTrigger, GoogleSheets 等节点。 n8n工作流错误警报(Google表格、Telegram和Gmail)

前置要求
  • Google 账号和 Gmail API 凭证
  • Telegram Bot Token
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "Yb92Z9P4HSj7JLuW",
  "meta": {
    "instanceId": "9219ebc7795bea866f70aa3d977d54417fdf06c41944be95e20cfb60f992db19",
    "templateCredsSetupCompleted": true
  },
  "name": "使用Google表格、Telegram和Gmail的错误处理警报",
  "tags": [],
  "nodes": [
    {
      "id": "ad41781c-30ed-4408-b3a4-7bfa592c3dd0",
      "name": "错误触发器",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        -80,
        -100
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "98d27f8f-baec-404f-a960-9068e66a9586",
      "name": "记录错误",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        140,
        -200
      ],
      "parameters": {
        "columns": {
          "value": {
            "URL": "={{ $json.execution.url }}",
            "Node": "={{ $json.execution.error.node.name }}",
            "STATUS": "NEW",
            "Workflow": "={{ $json.workflow.name }}",
            "Timestamp": "={{ $now.format('D hh:mm a') }}",
            "Error Message": "={{ $json.execution.error.message }}"
          },
          "schema": [
            {
              "id": "Timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Workflow",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Workflow",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Node",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Node",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Error Message",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Error Message",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "STATUS",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "STATUS",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Notes",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Notes",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KKolzBcFWGI_RtFUvT1bdufFpMdA0WfM9quvgg_cKlU/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1KKolzBcFWGI_RtFUvT1bdufFpMdA0WfM9quvgg_cKlU",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KKolzBcFWGI_RtFUvT1bdufFpMdA0WfM9quvgg_cKlU/edit?usp=drivesdk",
          "cachedResultName": "Error Logs"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "twZdLFsI3kTnqtpG",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "c62ec787-76eb-400d-852f-6df07eba72b9",
      "name": "编辑字段",
      "type": "n8n-nodes-base.set",
      "position": [
        140,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0e3ef75e-b4d9-489a-b45b-ca0b994756a7",
              "name": "telegramChatID",
              "type": "string",
              "value": "chatID"
            },
            {
              "id": "6e354af6-dd5e-4200-99ef-7856129d782e",
              "name": "toEmail",
              "type": "string",
              "value": "toEmail"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "12396bb3-7143-466c-a9e0-b7a567425706",
      "name": "在频道中通知",
      "type": "n8n-nodes-base.telegram",
      "position": [
        360,
        0
      ],
      "webhookId": "41264c12-622c-45c1-badd-1e0834773b7f",
      "parameters": {
        "text": "=⚠️🐛 New bug in n8n\n\nWorkflow: {{ $('Error Trigger').item.json.workflow.name }}\nExecution URL: {{ $('Error Trigger').item.json.execution.url }}\nNode name: {{ $('Error Trigger').item.json.execution.error.node.name }}\nError message: {{ $('Error Trigger').item.json.execution.error.message }}",
        "chatId": "={{ $json.telegramChatID }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "id": "IgrntTxsoDphh19z",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cf154995-a319-4c24-8244-3a1a6d75cc81",
      "name": "发送邮件",
      "type": "n8n-nodes-base.gmail",
      "position": [
        580,
        0
      ],
      "webhookId": "38f55ad5-84b6-4232-927f-fa0c24e23bd7",
      "parameters": {
        "sendTo": "={{ $('Edit Fields').item.json.toEmail }}",
        "message": "={{ $json.result.text }}",
        "options": {
          "senderName": "n8n Error Tracker",
          "appendAttribution": false
        },
        "subject": "=🐛New n8n bug in \"{{ $('Error Trigger').item.json.workflow.name }}\""
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "q3P6IybvNdDiPZ52",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "25a14f2b-710d-4a07-a484-bea302232fe8",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -20
      ],
      "parameters": {
        "height": 320,
        "content": "## 更新字段"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "timezone": "Europe/Madrid",
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1"
  },
  "versionId": "5cb21186-8ab7-4dcc-9489-1ba8e7e36f61",
  "connections": {
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Notify in channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Trigger": {
      "main": [
        [
          {
            "node": "Log error",
            "type": "main",
            "index": 0
          },
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify in channel": {
      "main": [
        [
          {
            "node": "Send email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 开发运维

需要付费吗?

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

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

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

作者
Aitor | 1node.ai

Aitor | 1node.ai

@aitoralonso

Hi, I’m Aitor. At 1 Node we help businesses integrate full-scale AI solutions that save time, cut costs, and increase revenue. Guaranteed. Need help implementing AI infrastructures?

外部链接
在 n8n.io 查看

分享此工作流