Twilio SMS node gives “Invalid 'To' phone number” despite correct WhatsApp format from webhookTwilio SMS node gives “Invalid 'To' phone number” despite correct WhatsApp format from webhook

Hi everyone :waving_hand:

I’m trying to build a WhatsApp integration using n8n + Twilio + OpenAI Assistants API. When a user sends a WhatsApp message, I route the webhook input into an assistant and then try to send a response back via Twilio using the Reply to User on WhatsApp-Send SMS node.

But I keep getting this error:

Bad request - Invalid ‘To’ phone number

Even though I see the incoming number like this:

From: whatsapp:+918902781099


I also tried this in the **To** field:

{{ "whatsapp:" + $node["Incoming WhatsApp Message-Webhook"].json["body"]["From"].replace("whatsapp:", "").trim() }}

But it still fails.

Here’s a screenshot of the Twilio node:

:brain: What I suspect:

The problem may be with how I’m referencing the number, or maybe the expression isn’t resolving correctly from the webhook.


:repeat_button: What I tried:

  • Logging the From value with a Set node → confirms it’s whatsapp:+918902781099
  • Using replace("whatsapp:", "") logic
  • Tried both .json["From"] and .json["body"]["From"]

Would love help from anyone who has faced this with WhatsApp or Twilio nodes inside n8n. Happy to share full workflow if needed.

Thanks :folded_hands:

Hi there @Rs_Property_Guide , your problem does sound a bit weird, and yes, if you cna to share the workflow here, it will definitely help up to help you better

I have the same issue as well. Any solutions?

Hi @Rs_Property_Guide and @Serdar ,
I was also facing the exact same issue. Before Trying out my solution make sure that the number is registered on Twilio. You can check it from the screenshot below and make sure that , it is being verified with the code , you can click on open in whatsapp as well to verify.


Then on From use

whatsapp:yourphonenumber

without any extra space .Do the same on To as well .Disable the To Whatsapp toggle.
If it’s working for you guys as well it might be a bug. We should raise this as an issue.

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