WhatsApp Web Send icon

WhatsApp Web Send

Send messages, media, and manage WhatsApp Web communications

Reply to Message

AI-generated

Overview

This node enables sending messages through WhatsApp Web using the whatsapp-web.js library. It supports multiple operations including sending plain text messages, media files (images, videos, audio, documents), location coordinates, and replying to specific existing messages in a chat.

Common scenarios where this node is useful include:

  • Automating customer support replies by sending text or media.
  • Broadcasting updates with images or documents to groups or individuals.
  • Sharing location information dynamically.
  • Replying directly to a particular message in a conversation thread for clarity.

For example, a business could use this node to automatically reply to a customer's query message with a relevant answer or file attachment, or send a location pin of their store.

Properties

Name Meaning
Chat ID WhatsApp chat identifier: phone number with @c.us for individual chats or group ID with @g.us for groups.
Original Message ID The ID of the message you want to reply to (required for "Reply to Message" operation).
Reply Message Text content of the reply message (required for "Reply to Message" operation).
Parse Mentions in Reply Boolean flag indicating whether to parse @mentions in the reply message text.
Connection Timeout (seconds) Timeout duration in seconds for establishing the WhatsApp connection (default is 60 seconds).

Note: The above properties are specific to the "Reply to Message" operation. Other operations have their own relevant properties (not detailed here as per user request).

Output

The node outputs an array with one JSON object per input item containing:

  • operation: The performed operation name (e.g., "replyToMessage").
  • chatId: The WhatsApp chat ID where the message was sent.
  • success: Boolean indicating if the message was sent successfully.
  • messageId: The unique ID of the sent message (if successful).
  • timestamp: Timestamp of when the message was sent.
  • error: Error message string if the operation failed.

If the node sends media, it does not output binary data but references media via URLs. The output focuses on metadata about the sent message.

Dependencies

  • Requires an API key credential for WhatsApp Web authentication (managed internally via session).
  • Uses the whatsapp-web.js library to interact with WhatsApp Web.
  • Puppeteer is used under the hood to automate browser interactions.
  • Temporary user data directories are created under /tmp/whatsapp-web-<sessionName>-<workflowId> for session management.
  • No additional external services are required beyond WhatsApp itself.

Troubleshooting

  • Connection Timeout: If the node fails to connect within the specified timeout, it will error out suggesting re-authentication may be needed. Increasing the timeout or reinitializing the session can help.
  • Authentication Failures: Errors related to authentication failure indicate invalid or expired session credentials. Re-authenticating the WhatsApp session is necessary.
  • Original Message Not Found: When replying to a message, if the original message ID is incorrect or no longer available, the node returns an error stating "Original message not found".
  • Session Lock Errors: Errors mentioning "SingletonLock" or "Failed to create a ProcessSingleton" relate to concurrent session conflicts or corrupted session data. Cleaning up the session directory (/tmp/whatsapp-web-...) often resolves this.
  • Unknown Operation: If an unsupported operation value is provided, the node throws an error indicating the unknown operation.

Links and References


This summary covers the "Reply to Message" operation of the WhatsApp Web Send node based on static analysis of the source code and provided property definitions.

Discussion