AutomationFlowsEmail & Gmail › Dual-channel Workflow Error Alerts with Whatsapp & Gmail Reporting

Dual-channel Workflow Error Alerts with Whatsapp & Gmail Reporting

Byrayane @ryan55 on n8n.io

This template provides a robust, two-step system for handling critical errors in your n8n workflows. It ensures that no workflow failure goes unnoticed, immediately notifying your team via a fast, urgent channel and providing a detailed record via a formal channel.

Event trigger★★★★☆ complexity11 nodesError TriggerWhatsAppGmail
Email & Gmail Trigger: Event Nodes: 11 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #9169 — we link there as the canonical source.

This workflow follows the Error Trigger → Gmail recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "kCB3MCZsbPmxhXPU",
  "name": "Error workflow",
  "tags": [],
  "nodes": [
    {
      "id": "5942fb48-d09f-4403-bc95-d9a11f4a58d9",
      "name": "Error Trigger",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        32,
        80
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5dafc2d3-5438-43b0-92e8-236da886f273",
      "name": "Send message",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        592,
        80
      ],
      "parameters": {
        "textBody": "=The workflow \"{{ $('separate items').item.json.workflow.name }}\" encountered an error in the node \"{{ $('separate items').item.json.execution.lastNodeExecuted }}\"",
        "operation": "send",
        "phoneNumberId": "625419790655867",
        "additionalFields": {},
        "recipientPhoneNumber": "={{ $('separate items').item.json.phone_number }}"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ec1a5ea3-4a6c-4ee6-9599-4df44d19f5bc",
      "name": "set_recipient_EMAIL/NUMBER",
      "type": "n8n-nodes-base.set",
      "position": [
        208,
        80
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0be5eb85-afee-4c83-b539-ae5b8e1aa2d2",
              "name": "Email1",
              "type": "string",
              "value": "your_mail_adress"
            },
            {
              "id": "1d396772-cc0c-44a1-8892-16b0cc781a0b",
              "name": "Email2",
              "type": "string",
              "value": "your_mail_adress"
            },
            {
              "id": "5ce4f065-b094-40f7-9255-dd83205f0ff7",
              "name": "phone_number_1",
              "type": "string",
              "value": "your_phone_number"
            },
            {
              "id": "67720331-2a18-4979-b9d5-d7bc2b83bf61",
              "name": "phone_number_2",
              "type": "string",
              "value": "your_phone_number"
            },
            {
              "id": "6fc7fca5-6e41-41c2-a75b-0b8805b47d52",
              "name": "workflow.name",
              "type": "string",
              "value": "={{ $json.workflow.name }}"
            },
            {
              "id": "71a1608b-e841-4f52-a3cf-355bd96255e1",
              "name": "execution.error.message",
              "type": "string",
              "value": "={{ $json.execution.error.message }}"
            },
            {
              "id": "dc94b06f-6b72-4e5c-ba2f-99efcc07f80a",
              "name": "execution.lastNodeExecuted",
              "type": "string",
              "value": "={{ $json.execution.lastNodeExecuted }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "7b95c3be-cdef-45d2-8d41-7ef2f4a221d7",
      "name": "separate items",
      "type": "n8n-nodes-base.code",
      "position": [
        400,
        80
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\n\n// Check if input is a non-empty array\nif (!Array.isArray(items) || items.length === 0) {\n    throw new Error(\"Input must be a non-empty array.\");\n}\n\nconst result = items.reduce((acc, item) => {\n    // Extract relevant properties from each item\n    const { Email1, Email2, phone_number_1, phone_number_2, ...otherProps } = item.json;\n\n    // Create two new items separating the emails and phone numbers\n    const item1 = {\n        Email: Email1,\n        phone_number: phone_number_1,\n        ...otherProps\n    };\n\n    const item2 = {\n        Email: Email2,\n        phone_number: phone_number_2,\n        ...otherProps\n    };\n\n    // Add the newly created items to the result array\n    acc.push({ json: item1 }, { json: item2 });\n\n    return acc;\n}, []);\n\n// Return the transformed array\nreturn result;"
      },
      "typeVersion": 2
    },
    {
      "id": "303dd47b-8706-4587-b5f7-2cbac46f5b17",
      "name": "Send Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        928,
        80
      ],
      "parameters": {
        "sendTo": "={{ $('separate items').item.json.Email }}\n",
        "message": "=The workflow \"{{ $('separate items').item.json.workflow.name }}\" encountered an error in the node \"{{ $('separate items').item.json.execution.lastNodeExecuted }}\"\n\nError message: {{ $('separate items').item.json.execution.error.message }}",
        "options": {},
        "subject": "=\u26a0\ufe0fworkflow error\n",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1,
      "alwaysOutputData": true
    },
    {
      "id": "da6e39b0-e21d-41c1-8e7c-992400aeb2fc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 528,
        "height": 240,
        "content": "## Get informations"
      },
      "typeVersion": 1
    },
    {
      "id": "136a7c06-f581-4efc-933e-687ea6cff618",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        768,
        80
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "4193aaeb-5a50-4d03-b601-a1303209a172",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        0
      ],
      "parameters": {
        "color": 5,
        "width": 592,
        "height": 240,
        "content": "## Send alert"
      },
      "typeVersion": 1
    },
    {
      "id": "8aca9262-f74c-42c1-8d91-ad731b1373a5",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        256
      ],
      "parameters": {
        "color": 5,
        "width": 528,
        "height": 416,
        "content": "## 1. Triggering and Preparation Phase (\"Get informations\")\n\nThis section ensures the reception of data:\n\n-Error Trigger:\nAutomatic triggering of the workflow by the failure or unhandled error of an external workflow. It ingests detailed metadata of the incident (error message, ID, etc.).\n\n-set_recipient_EMAIL/NUMBER:\nA Set-type node configured in manual mode to establish or format destination variables, such as the recipient's email address and phone number for the alert.\n\n-separate items:\nThis node is used to split a list of recipients for individual sending."
      },
      "typeVersion": 1
    },
    {
      "id": "5ed5e06e-1784-4322-bd83-137a1fc9eec7",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        256
      ],
      "parameters": {
        "width": 592,
        "height": 416,
        "content": "## 2. Alert and Communication Phase (\"Send alert\")\n\nThis section manages dual notification to the priority communication channels:\n\n-Send message (WhatsApp):\nSends an immediate notification via WhatsApp. This channel is generally preferred for its speed and urgency, quickly alerting the concerned service.\n\n-Wait:\nIntroduces a deliberate delay between notifications. This pause ensures compliance with API rate limits before sending the email.\n\n-Send Email (Gmail):\nSends a formal and potentially more detailed alert via Gmail. The email serves as a written record and archive of the incident, consolidating complete information about the error."
      },
      "typeVersion": 1
    },
    {
      "id": "da5f8b04-8faa-4d68-b030-b3b5b45f6353",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1152,
        0
      ],
      "parameters": {
        "color": 4,
        "width": 320,
        "height": 672,
        "content": "## How to do it?\n\nOpen the workflow you want to monitor, go to Workflow Settings, and select your error workflow in the Error Workflow field.\n\nSave the changes.\n\nFrom now on, if an error occurs in your main workflow, the error workflow will be automatically triggered and you will receive a notification with the error details.\n\nYou can use the same error workflow for several different workflows."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e21dfb63-7e38-4a7c-ac02-c2a9991562e0",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send message": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Error Trigger": {
      "main": [
        [
          {
            "node": "set_recipient_EMAIL/NUMBER",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "separate items": {
      "main": [
        [
          {
            "node": "Send message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "set_recipient_EMAIL/NUMBER": {
      "main": [
        [
          {
            "node": "separate items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This template provides a robust, two-step system for handling critical errors in your n8n workflows. It ensures that no workflow failure goes unnoticed, immediately notifying your team via a fast, urgent channel and providing a detailed record via a formal channel.

Source: https://n8n.io/workflows/9169/ — original creator credit. Request a take-down →

More Email & Gmail workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Email & Gmail

This error handling workflow emails detailed notifications on workflow execution and trigger errors.

Error Trigger, Gmail
Email & Gmail

This automated n8n workflow securely backs up Gmail attachments to Google Drive by triggering on new emails, retrieving the attachments, and uploading them to a designated Drive folder. The process in

Gmail Trigger, Gmail, Google Drive +1
Email & Gmail

Send an email via Gmail when a workflow error occurs.

Error Trigger, Gmail
Email & Gmail

This workflow runs every Monday at 8 AM and automatically monitors your Jira project, measures progress against the active sprint, and delivers a structured report to stakeholders — with zero manual e

Postgres, Jira, N8N Nodes Htmlcsstopdf +1
Email & Gmail

2025-12-03 fix JS code in node

Gmail, Home Assistant, Gmail Trigger +1