Overview
This node manages WhatsApp sessions using the Wuzapi service. It allows users to connect and disconnect from WhatsApp servers, retrieve QR codes for authentication, check connection status, pair phones, configure proxy settings, and manage S3 storage configurations for media files.
Common scenarios include:
- Automating WhatsApp session management in workflows.
- Subscribing to specific WhatsApp event types such as messages or presence updates.
- Using QR codes to authenticate WhatsApp sessions programmatically.
- Configuring proxy or cloud storage (S3) settings for enhanced connectivity and media handling.
Practical example: A user can automate connecting to WhatsApp, wait for the connection to establish, subscribe to incoming message events, and then process those messages within n8n workflows.
Properties
| Name | Meaning |
|---|---|
| Wait for Connection | Whether to wait for the actual connection status before returning or return immediately (boolean). |
| Subscribe to Events | Event types to subscribe to. Options: All, Chat Presence, History Sync, Message, Presence, Read Receipt. |
Output
The node outputs JSON data representing the response from the Wuzapi API for the selected operation. The structure varies depending on the operation:
- For connect, it returns connection status and subscribed events info.
- For getQr, it includes a
qrCodebinary field containing the WhatsApp QR code image encoded in base64 with MIME type and file extension metadata. - For other operations, it returns relevant session or configuration data as JSON.
If a QR code is retrieved, it is provided as binary data under the key qrCode with properties:
data: Base64-encoded image data.mimeType: Image MIME type (e.g., "image/png").fileExtension: File extension derived from MIME type.fileName: Defaulted to "whatsapp-qr-code.png".
Dependencies
- Requires an API key credential for authenticating with the Wuzapi service.
- Uses the Wuzapi API endpoints for session management.
- Optional dependencies include:
- Proxy server URL if proxy configuration is used.
- AWS S3 or compatible S3 storage credentials and configuration if S3 storage is enabled.
Troubleshooting
- Connection issues: If the node fails to connect, verify the API key credential and network access to Wuzapi servers.
- QR code not generated: Ensure the session is in a state that requires QR code scanning; otherwise, no QR code will be returned.
- Invalid phone number for pairing: Phone numbers must be provided without "+" or spaces and validated by the node.
- Proxy misconfiguration: Incorrect proxy URLs or disabled proxy settings may prevent connection.
- S3 configuration errors: Missing or incorrect S3 credentials, bucket names, or endpoint URLs can cause failures when configuring or testing S3 storage.
- Common error messages are passed through from the Wuzapi API and typically indicate authentication failures, invalid parameters, or network issues.
To resolve errors:
- Double-check all input parameters for correctness.
- Confirm that required credentials and external services are properly configured.
- Use the "Wait for Connection" option to ensure the node waits until the connection is fully established.
Links and References
- Wuzapi Official Documentation (example placeholder)
- WhatsApp Business API Overview
- AWS S3 Documentation