Discord node not functioning right; AI Agent output does not go through it and it fails to execute
What is the error message (if any)?
Cannot read properties of undefined (reading 'error')
Please share your workflow
Share the output returned by the last node
N/A. Same error message
Information on your n8n setup
n8n version: 1.114.3
Database (default: SQLite): SQLite
n8n EXECUTIONS_PROCESS setting (default: own, main): main
Running n8n via (Docker, npm, n8n cloud, desktop app): Podman (Docker, but undercomplicated)
Operating system: Fedora Silverblue 42
FYI, NO, this is not the Level 2 challenge thing, or whatever. This is a solo thing. All other Discord messaging nodes work with no problems, and this is the only one that’s broken
Create a new temporary workflow with only these two nodes:
Set Node
Add a field:
Name: Message
Value: Test message from n8n
Discord Node
Channel: your test channel
Message:
{{$json[“Message”]}}
Run this test.
If this fails → the Discord node itself (credentials, permissions, or setup) is the issue.
If this succeeds → the problem lies with how data is passed from your AI Agent node.
Step 2: Check the Discord Node Configuration
Common pitfalls:
Wrong “Send To” type (must be Channel or User, not empty)
Missing or invalid credentials — try re-selecting your Discord credentials
n8n Discord node bug — occasionally happens; restarting n8n or re-saving the node fixes it
Step 3: Test with Chat Node (Optional but Good)
If Step 1 succeeds, connect a Chat node (e.g., OpenAI, Gemini, or local AI node) → Discord node,
and set the Discord message to:
{{$json[“text”] || $json[“output”] || $json[“Message”] || “No content”}}
This ensures you handle any of the possible field names your agent might return.
Step 4: Ensure Correct Data Propagation
Your example JSON:
{
“Message”: “Fake message; ignore this message”
}
works only if the Discord node’s Message field uses the exact key (case-sensitive):
{{$json[“Message”]}}
If you accidentally wrote:
{{$json[“message”]}}
(lowercase “m”), it will be undefined, resulting in the error you’re seeing.