Skip to main content

Send Text Message

Sends a text message via the WhatsApp Business Cloud API.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Phone Number ID - WhatsApp Business Phone Number ID from Meta Developer Portal.
  • To Phone Number - Recipient's phone number with country code (without + sign). Example: 1234567890.
  • Message Text - The text message to send (supports up to 4096 characters).

Options

  • API Version - Meta Graph API version. Default is 21.0.
  • Preview URL - Enable URL preview in message. Default is false. When enabled, WhatsApp will generate a preview for the first URL found in the message.
  • Access Token - WhatsApp Cloud API Access Token credential (required).

Output

  • Response - The complete API response object containing message details, including the message ID and recipient information.

How It Works

The Send Text Message node sends a text message to a WhatsApp user. When executed, the node:

  1. Validates all required inputs (Phone Number ID, recipient, message text)
  2. Retrieves the access token from the credential
  3. Constructs the WhatsApp Cloud API endpoint URL
  4. Builds the message payload with text content
  5. Sends a POST request to the WhatsApp API
  6. Returns the API response with message details

Requirements

  • A WhatsApp Business Account in Meta Developer Portal
  • A WhatsApp Business Phone Number configured and verified
  • Access Token with appropriate permissions from Meta
  • Recipient must have a WhatsApp account
  • Your business number must comply with WhatsApp Business messaging policies

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Phone Number ID
  • Empty or invalid recipient phone number
  • Empty message text
  • Invalid access token
  • Recipient number is not a valid WhatsApp account
  • Rate limiting errors from WhatsApp API
  • Message violates WhatsApp policies
  • Network connectivity issues

Usage Notes

  • Phone numbers should include country code without the + sign (e.g., 14155551234 for US)
  • Messages can contain up to 4096 characters
  • URLs in messages are automatically detected and can be previewed if Preview URL is enabled
  • Line breaks are supported using \n in the message text
  • WhatsApp markdown formatting is supported for text styling:
    • Bold: *text*
    • Italic: _text_
    • Strikethrough: ~text~
    • Monospace: ```text```
  • The first message to a user must be initiated by the user or use a template message
  • After a user messages you, you have a 24-hour window to send freeform messages

Example

Basic Text Message:

Inputs:

  • Phone Number ID: 123456789012345
  • To Phone Number: 14155551234
  • Message Text: Hello! Your order has been confirmed.

Options:

  • API Version: 21.0
  • Preview URL: false
  • Access Token: (your credential)

Output:

{
"messaging_product": "whatsapp",
"contacts": [
{
"input": "14155551234",
"wa_id": "14155551234"
}
],
"messages": [
{
"id": "wamid.HBgNMTIzNDU2Nzg5MAAV..."
}
]
}

Example with URL Preview

Inputs:

  • Phone Number ID: 123456789012345
  • To Phone Number: 14155551234
  • Message Text: Check out our website: https://example.com

Options:

  • Preview URL: true

The recipient will see a rich preview of the URL with title, description, and image.

Example with Formatting

Message Text:

*Order Confirmation*

Your order #12345 has been confirmed!

Items:
- Product A (Qty: 2)
- Product B (Qty: 1)

Total: $99.99

Thank you for your purchase!

Tips for RPA Developers

  • Store the message ID from the response for tracking and logging
  • Implement retry logic for network failures
  • Use template messages for the first message to users who haven't messaged you
  • Check WhatsApp Business Policy before automating messages to avoid account restrictions
  • Rate limits apply: max 80 messages per second per phone number
  • For bulk messaging, implement delays between messages to avoid rate limiting
  • Use variables and flow data to personalize messages
  • Monitor the 24-hour messaging window for non-template messages

Common Errors and Solutions

Error: Invalid phone number

  • Ensure the phone number includes the country code
  • Remove any special characters (+, -, spaces)
  • Verify the number is a valid WhatsApp account

Error: Message not allowed outside 24-hour window

  • Use a template message instead for reaching out first
  • Wait for the user to message you to open the 24-hour window

Error: Rate limit exceeded

  • Implement delays between messages
  • Reduce message volume or spread over time
  • Consider upgrading your WhatsApp Business API tier

Error: Invalid access token

  • Verify the token in Meta Developer Portal
  • Check if the token has expired
  • Ensure the token has necessary permissions