Send Location
AI-generatedOverview
This node enables sending various types of messages through WhatsApp Web, including text messages, media files (images, videos, audio, documents), location coordinates, and replies to specific messages. It connects to WhatsApp Web using a headless browser session and performs the requested operation on the specified chat.
Common scenarios where this node is beneficial include:
- Automating customer support by sending text or media responses.
- Sharing location information with contacts or groups.
- Replying programmatically to specific messages in a conversation.
- Broadcasting updates or alerts with multimedia content.
For example, you can use it to send a location pin to a contact after receiving a request for directions, or send an image attachment as part of a notification workflow.
Properties
| Name | Meaning |
|---|---|
| Chat ID | WhatsApp chat identifier: phone number with @c.us for individuals or group ID with @g.us. |
| Latitude | Latitude coordinate of the location to send (required for Send Location operation). |
| Longitude | Longitude coordinate of the location to send (required for Send Location operation). |
| Location Name | Optional name or description of the location being sent. |
| Connection Timeout (seconds) | Timeout duration in seconds to wait for WhatsApp connection before failing (default 60 seconds). |
Note: The above properties are specific to the Send Location operation.
Output
The node outputs an array with one item per input message. Each output item contains a JSON object with the following fields:
operation: The performed operation name (e.g., "sendLocation").chatId: The target WhatsApp chat ID.success: Boolean indicating if the message was sent successfully.messageId: The unique identifier of the sent message (if successful).timestamp: Timestamp when the message was sent.error: Error message string if the operation failed.
No binary data is output by this node.
Dependencies
- Requires an API key credential that provides access to WhatsApp Web sessions.
- Uses the
whatsapp-web.jslibrary to interact with WhatsApp Web via a headless Chromium browser. - Requires Puppeteer-compatible environment with necessary sandboxing disabled for containerized execution.
- Temporary user data directories are created under
/tmp/whatsapp-web-<sessionName>-<workflowId>for session persistence.
Troubleshooting
- Connection Timeout: If the node fails to connect within the specified timeout, consider increasing the "Connection Timeout" property or re-authenticating the WhatsApp session.
- Session Errors: Errors mentioning "SingletonLock", "Session closed", or "Protocol error" indicate issues with the browser session. The node attempts retries and cleans up session directories automatically, but persistent errors may require manual session reset.
- Authentication Failures: Authentication failure events suggest invalid or expired WhatsApp session credentials. Re-authentication is needed.
- Message Not Found (for reply operation): If replying to a message ID that does not exist or is not found in recent messages, the node will return an error.
- Invalid Chat ID: Ensure the chat ID is correctly formatted with
@c.usfor individual contacts or@g.usfor groups.
Links and References
- whatsapp-web.js GitHub repository
- Puppeteer documentation
- WhatsApp Web official client (used internally by the node)