Error “Cannot read properties of undefined (reading 'error')” in Discord node – but only when running full workflow

Hi,
I have an issue with my workflow where I want to send an AI-generated message (from the Basic LLM Chain node) to a Discord channel using the Discord node.

When I run the entire workflow, I get this error from the Discord node:

Cannot read properties of undefined (reading 'error')

If I run the Discord node alone afterwards, I get the same error.

However, if I first manually execute the AI node, and then run the Discord node, everything works as expected and the message is sent properly.

I’m only using GUI elements – no custom code.
The AI node outputs JSON with a text field (a string), and I reference it in the Discord node using {{ $json.text }}.

I’m running n8n locally on Windows with the latest version installed.
Attached is a screenshot of my workflow:

Any ideas what could be causing this?

Thanks in advance! :folded_hands:

can you share workflow so we can understand problem better?

i got the same problem

I was getting this error because the channel the bot was trying to send messages in was private and it didn’t have access. So if it happens could be related to permissions.
I wish the error output was clearer, Discord surely responds with a complete error message, but we just get basic info in the node.

I fixed it like this

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.