
Workflow Error Logging and Alerts with Google Sheets and Gmail
Description
Categories
π DevOpsπ€ AI & Machine Learning
Nodes Used
n8n-nodes-base.gmailn8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.errorTriggern8n-nodes-base.googleSheets
PriceFree
Views0
Last Updated11/28/2025
workflow.json
{
"meta": {
"instanceId": "d1786ab0d745a7498abf13a9c2cdabb1374c006e889b79eef64ce0386b8f8a41",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "d1657692-c5ab-4402-a0e7-3341303c3e36",
"name": "Error Trigger",
"type": "n8n-nodes-base.errorTrigger",
"position": [
740,
780
],
"parameters": {},
"typeVersion": 1
},
{
"id": "058c8a03-8d6c-4da6-9319-8615432a7c4b",
"name": "Google Sheets - Create Error Log",
"type": "n8n-nodes-base.googleSheets",
"position": [
1000,
680
],
"parameters": {
"columns": {
"value": {
"Log": "={{ $json.execution.error.stack }}",
"Node ID": "={{ $json.execution.id }}",
"Node Name": "={{ $json.execution.lastNodeExecuted }}",
"Timestamp": "={{ new Date($json.execution.error.timestamp).toISOString() }}\n",
"Workflow ID": "={{ $json.workflow.id }}",
"Execution Url": "={{ $json.execution.url }}",
"Workflow Name": "={{ $json.workflow.name }}"
},
"schema": [
{
"id": "Workflow ID",
"type": "string",
"display": true,
"required": false,
"displayName": "Workflow ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Workflow Name",
"type": "string",
"display": true,
"required": false,
"displayName": "Workflow Name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Node Name",
"type": "string",
"display": true,
"required": false,
"displayName": "Node Name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Node ID",
"type": "string",
"display": true,
"required": false,
"displayName": "Node ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Timestamp",
"type": "string",
"display": true,
"required": false,
"displayName": "Timestamp",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Execution Url",
"type": "string",
"display": true,
"required": false,
"displayName": "Execution Url",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Log",
"type": "string",
"display": true,
"required": false,
"displayName": "Log",
"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/1JprCxz5IRZzuiYs-NNkYLffQIkeTiC0sd-3CyrcOKV4/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1JprCxz5IRZzuiYs-NNkYLffQIkeTiC0sd-3CyrcOKV4",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1JprCxz5IRZzuiYs-NNkYLffQIkeTiC0sd-3CyrcOKV4/edit?usp=drivesdk",
"cachedResultName": "n8n Logs"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "ypmzFxQFfAacuVVC",
"name": "Google Sheets account"
}
},
"typeVersion": 4.5
},
{
"id": "084b673e-350e-4d11-b64b-3b370a30ee1b",
"name": "Gmail - Send Notification",
"type": "n8n-nodes-base.gmail",
"position": [
1000,
900
],
"webhookId": "65520aeb-1e34-46cc-8b09-637061212c81",
"parameters": {
"sendTo": "[email protected]",
"message": "=π¨ n8n Workflow Error Alert\n\nβ’ Workflow Name: {{ $json.workflow.name }}\nβ’ Node: {{ $json.execution.error.context.nodeCause }}\nβ’ Error Type: {{ $json.execution.error.name }}\nβ’ Message: {{ $json.execution.error.description }}\nβ’ Execution ID: {{ $json.execution.id }}\nβ’ View Execution: {{ $json.execution.url }}",
"options": {},
"subject": "=π¨ n8n Error in Workflow \"{{ $json.workflow.name }}\" (Node: {{ $json.execution.error.context.nodeCause }})",
"emailType": "text"
},
"credentials": {
"gmailOAuth2": {
"id": "CeBpTZBQSAMKVKJY",
"name": "Gmail account (Billy Email 2)"
}
},
"typeVersion": 2.1
},
{
"id": "4c00fa5d-b7c0-40b0-80b9-4818af5d353c",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1060,
1160
],
"parameters": {
"color": 4,
"width": 380,
"height": 760,
"content": "# π Hi, Iβm Billy\n\nI help businesses build **n8n workflows** & **AI automation projects**. \nNeed help with n8n or AI Automation projects? \nContact me and letβs build your automation together.\n\nπ© **Email:** [email protected] \nπ€ **n8n Creator:** [n8n.io/creators/billy](https://n8n.io/creators/billy/)\nπ **My n8n Projects:** [billychristi.com/n8n](https://www.billychristi.com/n8n) \n\n\n\n---\nπ‘ Feel free to get in touch if youβd like help on your next automation project or if you have any feedback or thoughts to share.\n"
},
"typeVersion": 1
},
{
"id": "af4f6dfc-fe05-478b-85c4-a1739c5cc7dc",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
240,
660
],
"parameters": {
"color": 4,
"width": 440,
"height": 420,
"content": "## SETUP REQUIRED\n\nWorkflow Configurations:\n- **Copy the Google Sheets structure: [Google Sheets template](https://docs.google.com/spreadsheets/d/11-vLBAKolEvaL0qQDjckHmvC1S6_hxHbgSP8CLyngSs/edit?gid=0#gid=0)**(https://docs.google.com/spreadsheets/d/11-vLBAKolEvaL0qQDjckHmvC1S6_hxHbgSP8CLyngSs/edit?gid=0#gid=0)\n- Update the Google Sheets document ID to point to your own error logging spreadsheet\n- Adjust the Gmail notification recipient email address from \"[email protected]\" to your preferred address\n- Customize the email subject and message format according to your notification preferences\n\nRequired Credentials:\n- Google Sheets OAuth2 API Credential\n- Gmail OAuth2 Credential"
},
"typeVersion": 1
},
{
"id": "b27f0f44-ad40-468d-bacc-ac134162fb6c",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
240,
1160
],
"parameters": {
"color": 4,
"width": 780,
"height": 300,
"content": "## π¨ n8n Error Logging to Google Sheets with Gmail Alerts\n\nWhat This Template Does:\n\n- Automatically triggers whenever any workflow in your n8n instance encounters an error\n- Captures comprehensive error details including workflow information, node details, and execution context\n- Logs all error information to a centralized Google Sheets document for tracking and analysis\n- Sends immediate email notifications to alert you of workflow failures\n- Provides direct links to failed executions for quick troubleshooting and resolution\n- Maintains a persistent error history for pattern analysis and system monitoring"
},
"typeVersion": 1
},
{
"id": "e4f15d86-4fb8-4b1e-b2eb-7112d0e9cd74",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
240,
1500
],
"parameters": {
"color": 4,
"width": 780,
"height": 380,
"content": "## π WORKFLOW PROCESS OVERVIEW\n\nStep 1: π΄ Error Trigger automatically activates when any workflow in the n8n instance fails or encounters an error\nStep 2: π Google Sheets - Create Error Log captures and stores error details in a spreadsheet with columns for:\n - Workflow ID and Name\n - Failed Node Name and ID \n - Error Timestamp\n - Execution URL for direct access\n - Full error stack trace for debugging\nStep 3: π§ Gmail - Send Notification dispatches an immediate email alert containing:\n - Workflow name and failed node information\n - Error type and description\n - Execution ID and direct link to view the failed execution\n - Formatted for quick identification and response"
},
"typeVersion": 1
}
],
"pinData": {
"Error Trigger": [
{
"workflow": {
"id": "Kgf1bwD0lN39RQDk",
"name": "My workflow 115"
},
"execution": {
"id": "142",
"url": "https://n8n.nodemationhub.com/workflow/Kgf1bwD0lN39RQDk/executions/142",
"mode": "trigger",
"error": {
"name": "ExpressionError",
"tags": {},
"level": "warning",
"stack": "ExpressionError: Invalid input for 'Specialty' [item 0]\n at validateValueAgainstSchema (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/utils/validate-value-against-schema.js:120:15)\n at ExecuteContext._getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/node-execution-context.js:235:85)\n at ExecuteContext.getNodeParameter (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/execute-context.js:39:93)\n at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Airtable/v2/actions/record/create.operation.js:77:29)\n at ExecuteContext.router (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Airtable/v2/actions/router.js:57:71)\n at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Airtable/v2/AirtableV2.node.js:41:39)\n at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:687:50)\n at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:921:62\n at processTicksAndRejections (node:internal/process/task_queues:95:5)\n at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1257:20",
"context": {
"runIndex": 0,
"itemIndex": 0,
"nodeCause": "Airtable1"
},
"message": "Invalid input for 'Specialty' [item 0]",
"timestamp": 1750416545020,
"description": "'Specialty' expects one of the following values: [General, Billing, Technical, Account] but we got '12'",
"functionality": "regular"
},
"lastNodeExecuted": "Airtable1"
}
}
]
},
"connections": {
"Error Trigger": {
"main": [
[
{
"node": "Gmail - Send Notification",
"type": "main",
"index": 0
},
{
"node": "Google Sheets - Create Error Log",
"type": "main",
"index": 0
}
]
]
}
}
}