Problems with the phone number on WhatsApp (On Message) node

Hi
When I drag and drop the phone number information, the number is wrong, but when I enter it manually, it works perfectly.

Example:
My phone number: 12 34 56789101112
What happens when I drag and drop the information: 12 34 6789101112
In other words, it keeps the country and region number but loses the first digit of my phone number.

I’ve already checked and the on message node receives the wrong number every time, no matter what I do.

My problem is slightly similar to this: Problem with sending WhatsApp messages in N8N self-hosted

Does anyone know how to solve this problem?

{
“nodes”: [
{
“parameters”: {
“updates”: [
“messages”
]
},
“type”: “n8n-nodes-base.whatsAppTrigger”,
“typeVersion”: 1,
“position”: [
100,
0
],
“id”: “1c177a89-053b-4b2f-98b1-9687a77e1698”,
“name”: “Receptor de chate”,
“webhookId”: “806f4a09-5b0f-49e8-8e67-5f4fb03f2cd0”,
“credentials”: {
“whatsAppTriggerApi”: {
“id”: “jLLEXVSiymTmDI5g”,
“name”: “WhatsApp OAuth account”
}
}
},
{
“parameters”: {
“promptType”: “define”,
“text”: “={{ $json.messages[0].text.body }}”,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 1.8,
“position”: [
660,
0
],
“id”: “41da6c87-4ea3-41b0-8dc2-5f70fcea5760”,
“name”: “AI Agent”
},
{
“parameters”: {
“model”: {
“__rl”: true,
“value”: “gpt-3.5-turbo”,
“mode”: “list”,
“cachedResultName”: “gpt-3.5-turbo”
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatOpenAi”,
“typeVersion”: 1.2,
“position”: [
620,
200
],
“id”: “2612b9cf-6085-4936-b30c-1fe1da13230d”,
“name”: “OpenAI Chat Model”,
“credentials”: {
“openAiApi”: {
“id”: “47QO75bhLHAceAfD”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“sessionIdType”: “customKey”,
“sessionKey”: “={{ $(‘Receptor de chate’).item.json.contacts[0].wa_id }}”
},
“type”: “@n8n/n8n-nodes-langchain.memoryBufferWindow”,
“typeVersion”: 1.3,
“position”: [
760,
200
],
“id”: “192ea926-1d35-4cfd-bc8b-0dcd68cab170”,
“name”: “Simple Memory”
},
{
“parameters”: {
“operation”: “send”,
“phoneNumberId”: “582181234982206”,
“recipientPhoneNumber”: “={{ $(‘If’).item.json.contacts[0].wa_id }}”,
“textBody”: “={{ $json.output }}”,
“additionalFields”: {}
},
“type”: “n8n-nodes-base.whatsApp”,
“typeVersion”: 1,
“position”: [
1100,
-40
],
“id”: “6455b9af-89c5-47fa-9885-4d2537130bee”,
“name”: “WhatsApp Business Cloud”,
“webhookId”: “f3c2bbf3-8974-4971-ab7b-7aeaed19a3ff”,
“credentials”: {
“whatsAppApi”: {
“id”: “QZdPdsq29vDSG4Iv”,
“name”: “WhatsApp account”
}
}
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “2094a61d-60f9-4aeb-9036-03344c14784b”,
“leftValue”: “={{ $json.messages[0].text.body }}”,
“rightValue”: “”,
“operator”: {
“type”: “string”,
“operation”: “exists”,
“singleValue”: true
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.2,
“position”: [
380,
20
],
“id”: “3702f2fe-e0d8-4024-a580-4211a80b7011”,
“name”: “If”
}
],
“connections”: {
“Receptor de chate”: {
“main”: [
[
{
“node”: “If”,
“type”: “main”,
“index”: 0
}
]
]
},
“AI Agent”: {
“main”: [
[
{
“node”: “WhatsApp Business Cloud”,
“type”: “main”,
“index”: 0
}
]
]
},
“OpenAI Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “AI Agent”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Simple Memory”: {
“ai_memory”: [
[
{
“node”: “AI Agent”,
“type”: “ai_memory”,
“index”: 0
}
]
]
},
“WhatsApp Business Cloud”: {
“main”: [

]
},
“If”: {
“main”: [
[
{
“node”: “AI Agent”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “830499f171848f15a469f0e9f9a863419688d34cef2f92af12f26fd8a2674645”
}
}

Information on your n8n setup

  • n8n version: 1.83.2
  • Running n8n via: Docker or browser

Just to confirm the information:

Are you saying the WhatsApp trigger is receiving the wrong phone number in the JSON data?

Can you share a screenshot of that JSON, in the trigger node?

my number starts with 55 55 997…
but the information stored is without one of the numbers nine.

[

{

“messaging_product”: “whatsapp”,

“metadata”: {

“display_phone_number”: “15556366651”,

“phone_number_id”: “582181234982206”

},

“contacts”: [

{

“profile”: {

“name”: “Matheus M”

},

“wa_id”: “5555971XXXXX”

}

],

“messages”: [

{

“from”: “5555971XXXXX”,

“id”: “wamid.HBgMNTU1NTk3MTE0MjI5FQIAEhggNEUzQjZEQTBCQkREOTM4M0Y5QzBDNEZDQzY5NUQ2MUEA”,

“timestamp”: “1742680231”,

In Brazl we had our numbers updated to include an additional digit 9 in front of our old numbers.

But that didn’t change the number in our WhatsApp accounts. Only the phone number.

So if you go into someone else’s whatsapp and open your profile on it, you will probably see your old number (without the 9).

What you’re gonna have to do is create a logic around that problem to solve it in a creative way.

  • Are you able to send text messages to that whatsapp number even with the digit 9 missing?
  • If not, are you able to use another ID (like phone_number_id) to make a request to the WhatsApp API and obtain the true number, before sending the message?

I know Evolution API has a way of verifying if a number has a WhatsApp account or not. But I don’t know about the official API.

:point_right: If my reply answers your question, please remember to mark it as a solution.

Every time I test the workflow, this error appears and I don’t receive a single message, that is, it doesn’t identify my number because of the missing 9.

Do you know how I could get the ID of my phone number?

  • If not, are you able to use another ID (like phone_number_id) to make a request to the WhatsApp API and obtain the true number, before sending the message?

I have no idea how I could do this, is there somewhere that teaches this?

Basically I registered on meta the number that appears on WhatsApp Busnes Cloud, I don’t know why it worked but thanks for the help

1 Like

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