I am new with n8n, so i decided to test some templates of Whatsapp Chat bot with OpenAI Agent (This template). However, even when i set all credentials, and just Test Workflow, the Whatsapp Business Node (send response to my number) stops with an strange error.
Problem in node ‘Reply To User’: Can’t get data for expression
Please share your workflow
{
“nodes”: [
{
“parameters”: {
“updates”: [
“messages”
]
},
“id”: “77ee6494-4898-47dc-81d9-35daf6f0beea”,
“name”: “WhatsApp Trigger”,
“type”: “n8n-nodes-base.whatsAppTrigger”,
“position”: [
2260,
580
],
“webhookId”: “aaa71f03-f7af-4d18-8d9a-0afb86f1b554”,
“typeVersion”: 1,
“credentials”: {
“whatsAppTriggerApi”: {
“id”: “g4WfkNBaLnSzDWab”,
“name”: “WhatsApp OAuth account”
}
}
},
{
“parameters”: {
“model”: “gpt-4o-2024-08-06”,
“options”: {}
},
“id”: “57210e27-1f89-465a-98cc-43f890a4bf58”,
“name”: “OpenAI Chat Model”,
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“position”: [
2840,
680
],
“typeVersion”: 1,
“credentials”: {
“openAiApi”: {
“id”: “3O4qwm3vDRoDg1Wm”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“sessionIdType”: “customKey”,
“sessionKey”: “=whatsapp-75-{{ $json.messages[0].from }}”
},
“id”: “e1053235-0ade-4e36-9ad2-8b29c78fced8”,
“name”: “Window Buffer Memory”,
“type”: “@n8n/n8n-nodes-langchain.memoryBufferWindow”,
“position”: [
2980,
660
],
“typeVersion”: 1.2
},
{
“parameters”: {
“operation”: “send”,
“phoneNumberId”: “613660101822626”,
“recipientPhoneNumber”: “={{ $(‘WhatsApp Trigger’).item.json.messages[0].from }}”,
“textBody”: “={{ $json.output }}”,
“additionalFields”: {
“previewUrl”: false
}
},
“id”: “1ae5a311-36d7-4454-ab14-6788d1331780”,
“name”: “Reply To User”,
“type”: “n8n-nodes-base.whatsApp”,
“position”: [
3720,
580
],
“typeVersion”: 1,
“webhookId”: “ea523805-81cd-48a8-b840-938a13d38afd”,
“credentials”: {
“whatsAppApi”: {
“id”: “ItllIDWRCnwM0r04”,
“name”: “WhatsApp account”
}
}
},
{
“parameters”: {
“promptType”: “define”,
“text”: “={{ $json.messages[0].text.body }}”,
“options”: {
“systemMessage”: “You are an assistant working for a company who sells Yamaha Powered Loudspeakers and helping the user navigate the product catalog for the year 2024. Your goal is not to facilitate a sale but if the user enquires, direct them to the appropriate website, url or contact information.\n\nDo your best to answer any questions factually. If you don’t know the answer or unable to obtain the information from the datastore, then tell the user so.”
}
},
“id”: “a36524d0-22a6-48cc-93fe-b4571cec428a”,
“name”: “AI Sales Agent”,
“type”: “@n8n/n8n-nodes-langchain.agent”,
“position”: [
2860,
460
],
“typeVersion”: 1.6
}
],
“connections”: {
“WhatsApp Trigger”: {
“main”: [
[
{
“node”: “AI Sales Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“OpenAI Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “AI Sales Agent”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Window Buffer Memory”: {
“ai_memory”: [
[
{
“node”: “AI Sales Agent”,
“type”: “ai_memory”,
“index”: 0
}
]
]
},
“AI Sales Agent”: {
“main”: [
[
{
“node”: “Reply To User”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateId”: “2465”,
“instanceId”: “2a8fb0e700a28a669e746d49847fe3310c0112b78570ed75bd3372d5514a9cfd”
}
}
Share the output returned by the last node
[
{
“output”: “Hello! How can I assist you today?”
}
]
Information on your n8n setup
- n8n version:1,8,3
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
- Operating system: Windows