WhatsApp: Send Message

Send a WhatsApp message

Overview

This node sends a WhatsApp text message to a specified phone number using an external WhatsApp API service. It is useful for automating notifications, alerts, or any communication that needs to be delivered via WhatsApp. For example, businesses can use it to send order confirmations, appointment reminders, or customer support messages directly to customers' WhatsApp accounts.

Properties

Name Meaning
Phone Number The recipient's phone number including country code but without "+" or "00" prefix (e.g., 51912345678).
Message The text content of the WhatsApp message to be sent.

Output

The node outputs JSON data for each input item processed. Each output item contains:

  • success: A boolean indicating if the message was sent successfully.
  • messageId: The unique identifier of the sent message returned by the WhatsApp API, or "unknown" if not provided.
  • timestamp: The ISO string timestamp when the message was sent.
  • In case of failure (if continuing on fail), an error field with the error message and success set to false.

No binary data is produced by this node.

Dependencies

  • Requires an external WhatsApp API service accessible via HTTP.
  • Needs an API authentication credential configured in n8n to authorize requests to the WhatsApp API.
  • The base URL for the API is taken from the credential configuration.

Troubleshooting

  • Common issues:
    • Invalid or missing phone number format may cause the API to reject the request.
    • Authentication failures if the API key or token is incorrect or expired.
    • Network connectivity problems preventing access to the WhatsApp API endpoint.
  • Error messages:
    • Errors thrown by the API are captured and returned in the output if "Continue On Fail" is enabled.
    • If not enabled, errors will stop execution and show detailed error information referencing the failed item index.
  • Resolution tips:
    • Ensure phone numbers include the correct country code without "+" or "00".
    • Verify API credentials and permissions.
    • Check network and firewall settings to allow outbound requests to the WhatsApp API.

Links and References

Discussion