Hello n8n Community,
My name is Max, and I’m fairly new to n8n and automation in general, really enjoying diving into the platform! I’m currently working through n8n Course Level 2 and have hit a roadblock trying to get the last workflow of the course (the Error Workflow) fully working.
I’m currently working through and encountering a persistent issue with the Error Workflow (Workflow 3) setup. My main workflow (Workflow 2) correctly fails and triggers the error handler, but the Discord node within the Error Workflow consistently fails with a TypeError: Cannot read properties of undefined (reading 'error'). As a result, no error messages are being sent to my Discord channel.
I’ve tried debugged the data, with the help of chatgpt, claude and gemini, verified the input to the Discord node, and confirmed that the expressions appear logically correct based on that input. This leads me to suspect an internal node issue or version-specific bug affecting the Discord node within this Error Workflow context.
The error message observed in the Discord node’s output in the Error Workflow is:
{ "errorMessage": "Cannot read properties of undefined (reading 'error')", "errorDetails": {}, "n8nDetails": { "n8nVersion": "1.103.2 (Self Hosted)", "binaryDataMode": "default", "stackTrace": [ "TypeError: Cannot read properties of undefined (reading 'error')", " at ExecuteContext.parseDiscordError (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/Discord/v2/helpers/utils.ts:32:30)", " at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_1af219c3f47f2a1223ec4ccec249a974/node_modules/n8n-nodes-base/nodes/Discord/v2/actions/webhook/sendLegacy.operation.ts:153:34)", // ... (rest of stack trace for brevity, but I have the full trace) ] } }
This stack trace points to parseDiscordError within the Discord node’s own code, suggesting an internal problem.
Please share your workflow
Workflow 2 (Main Workflow - Simplified for error generation in n8n Course Level 2):
JSON{ "nodes": [ { "parameters": { "interval": "10", "unit": "seconds" }, "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1, "position": [ 250, 150 ] }, { "parameters": { "errorType": "errorMessage", "errorMessage": "An error occured!" }, "name": "Stop and Error", "type": "n8n-nodes-base.stopAndError", "typeVersion": 1, "position": [ 750, 150 ] } ], "connections": { "Schedule Trigger": { "output": [ { "node": "Stop and Error", "port": "main" } ] } } }
Workflow 3 (Error Workflow as per n8n Course Level 2 requirements):
JSON{ "nodes": [ { "parameters": {}, "name": "Error Trigger", "type": "n8n-nodes-base.errorTrigger", "typeVersion": 1, "position": [ 250, 150 ] }, { "parameters": { "connectionType": "webhook", "webhookUrl": "YOUR_DISCORD_WEBHOOK_URL", // Replace with your actual URL "operation": "sendMessage", "message": "The workflow {{ $json.workflow.name }} failed, with the error message: {{ $json.execution.error.message }}. Last node executed: {{ $json.execution.lastNodeExecuted }}. Check this workflow execution here: {{ $json.execution.url }} My Unique ID: 8b09e510b72faa570f586e55496bd62b" }, "name": "Discord", "type": "n8n-nodes-base.discord", "typeVersion": 2, "position": [ 500, 150 ], "credentials": { "discordApi": { "id": "YOUR_DISCORD_CREDENTIAL_ID", // Replace with your actual credential ID "name": "Discord Webhook account 2" // Or your credential name } } } ], "connections": { "Error Trigger": { "output": [ { "node": "Discord", "port": "main" } ] } } }
(Please note: I’ve omitted the full main workflow from the course for brevity, focusing on the error generation. The credential ID and webhook URL in WF3’s Discord node are placeholders.)
Workflow 2 Settings (Error Workflow configured): Workflow 2 is configured to use “Workflow 3 - Error Handler” as its “Error Workflow”.
Share the output returned by the last node
The last node (Discord) in Workflow 3 consistently returns the error message provided above.
Input received by the Discord node in Workflow 3 (from a live, failed WF2 execution):
JSON[ { "execution": { "id": "472", "url": "http://localhost:5678/workflow/AiB7RRWXHo6Z8j7v/executions/472", "error": { "level": "warning", "tags": {}, "timestamp": 1753370141822, "context": {}, "functionality": "regular", "name": "NodeOperationError", "node": { "parameters": { "errorType": "errorMessage", "errorMessage": "An error occured!" }, "type": "n8n-nodes-base.stopAndError", "typeVersion": 1, "position": [ 176, -160 ], "id": "f939dbe6-9236-4a3b-b8e2-ec55da5ad5a1", "name": "Stop and Error" }, "messages": [], "message": "An error occured!", "stack": "NodeOperationError: An error occured!\n\t at ExecuteContext.execute (...)\n..." }, "lastNodeExecuted": "Stop and Error", "mode": "trigger" }, "workflow": { "id": "AiB7RRWXHo6Z8j7v", "name": "Workflow 2" } } ]
Even though the actual input shows “Workflow 2”, the Discord node’s “Result” preview within the n8n UI consistently displays “Example Workflow”, which seems to be a UI-specific bug for Error Workflows.
Information on your n8n setup
- n8n version: 1.103.2
- Database (default: SQLite): SQLite (default)
- n8n EXECUTIONS_PROCESS setting (default: own, main): default (own, main)
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: Windows 10 home