Whatsapp WebJS icon

Whatsapp WebJS

Connect with Whatsapp WebJS API

Actions3

Overview

This node integrates with the WhatsApp WebJS API to send interactive poll messages within WhatsApp chats. Specifically, the SendPoll operation under the Chatting resource allows users to create and send a poll to a specified chat by providing a title and multiple options. This is useful for gathering opinions or votes from participants in a WhatsApp group or individual chat.

Common scenarios include:

  • Conducting quick surveys or polls in WhatsApp groups.
  • Collecting feedback or preferences from contacts.
  • Organizing informal votes or decisions among friends or team members.

Example: Sending a poll titled "Favorite Fruit" with options "Apple; Banana; Orange" to a group chat to see which fruit is preferred.

Properties

Name Meaning
Chat ID The unique identifier of the WhatsApp chat where the poll will be sent (e.g., xxxxxxx@c.us).
Title The title or question of the poll to be displayed to recipients.
Options Semicolon-separated list of poll options (e.g., option 1; option 2; option 3).
Multiple Answers Boolean flag indicating if multiple answers are allowed (true) or only a single answer (false).

Output

The node outputs JSON data representing the response from the WhatsApp WebJS API after sending the poll message. This typically includes details about the sent message such as message ID, status, and any metadata returned by the API.

No binary data output is produced for this operation.

Dependencies

  • Requires an active connection to the WhatsApp WebJS API via an API key credential configured in n8n.
  • The node uses the session identifier from credentials to target the correct WhatsApp session.
  • Network access to the WhatsApp WebJS API endpoint URL provided in the credentials is necessary.

Troubleshooting

  • Empty or invalid Chat ID: Ensure the Chat ID is correctly formatted and corresponds to an existing WhatsApp chat. Invalid IDs will cause the API request to fail.
  • Malformed poll options: Poll options must be semicolon-separated strings. Missing or empty options may result in errors or no poll being created.
  • API authentication errors: Verify that the API key credential is valid and has the required permissions.
  • Session issues: If the session is not active or expired, the node will fail to send messages. Restart or reauthenticate the session as needed.
  • Network connectivity: Ensure the n8n instance can reach the WhatsApp WebJS API endpoint without firewall or proxy issues.

Links and References

Discussion