Persistent Discord Node Error in Error Workflow (Self-Hosted v1.103.2) - "Cannot read properties of undefined (reading 'error')"

Hey @Max_00, welcome to the community :waving_hand:

The problem here isn’t with Discord itself, it’s with how the error workflow data is structured. In your expression you’re calling:

{{ $json.execution.error.message }}

But in error workflows, the error details are nested a bit differently. The correct path is:

{{ $json.execution.error.message || "Unknown error" }}

And for other fields:

  • Workflow name → {{ $json.workflow.name }}

  • Last node executed → {{ $json.execution.lastNodeExecuted }}

  • Execution link → {{ $json.execution.url }}

So your Discord message should look like this:

The workflow {{ $json.workflow.name }} failed  
Error: {{ $json.execution.error.message || "Unknown error" }}  
Last node executed: {{ $json.execution.lastNodeExecuted }}  
Check execution: {{ $json.execution.url }}

This way, if the error object is missing or undefined, the message won’t crash — it’ll just say “Unknown error”.

That should stop the “Cannot read properties of undefined” error and let the Discord node send messages properly.

If this helped, please mark it as Solution so others with the same issue can find it :folded_hands: