WhatsApp Web

Send messages via WhatsApp Web

Overview

This node enables sending WhatsApp messages via WhatsApp Web using the whatsapp-web.js library. It connects to WhatsApp Web through a headless browser session, authenticates locally, and sends text messages to specified recipients.

Common scenarios include:

  • Automating notifications or alerts to WhatsApp users.
  • Sending personalized messages in bulk workflows.
  • Integrating WhatsApp messaging into broader automation pipelines without needing official WhatsApp Business API access.

For example, you can use this node to send order confirmations or appointment reminders directly to customers' WhatsApp numbers.

Properties

Name Meaning
Recipient WhatsApp number (with country code) to which the message will be sent. Example: "+1234567890"
Message Text content of the message to send via WhatsApp

Output

The node outputs an array of JSON objects corresponding to each input item processed. Each output JSON object contains:

  • recipient: The WhatsApp number the message was sent to.
  • message: The text message that was sent.
  • status: A string indicating the message status, always "sent" if successful.

No binary data is produced by this node.

Example output JSON for one item:

{
  "recipient": "+1234567890",
  "message": "Hello from n8n!",
  "status": "sent"
}

Dependencies

  • Requires the whatsapp-web.js npm package to interact with WhatsApp Web.
  • Uses Puppeteer internally to run a headless Chromium browser session.
  • Stores authentication data locally under ./scripts/.wwebjs_auth to maintain session persistence.
  • No external API keys are required, but the user must scan a QR code on first run to authenticate the WhatsApp Web session manually.

Troubleshooting

  • Authentication Failure: If the node fails with an authentication error, ensure the initial QR code scan was completed successfully. Delete the local auth folder (./scripts/.wwebjs_auth) to reset authentication and try again.
  • Message Not Sent: Verify the recipient number includes the correct country code and is registered on WhatsApp.
  • Headless Browser Issues: Puppeteer requires certain system dependencies (like Chromium). On some systems, missing libraries may cause failures. Installing necessary OS packages or running in non-headless mode for debugging can help.
  • Long Initialization Time: The node waits for WhatsApp Web client readiness before sending messages; this can take several seconds especially on first run.

Links and References

Discussion