Send Location Message
Sends a location message with geographic coordinates via the WhatsApp Business Cloud API. Recipients can view the location on a map within WhatsApp.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Phone Number ID - WhatsApp Business Phone Number ID from Meta Developer Portal.
- To Phone Number - Recipient's phone number with country code (without + sign). Example:
1234567890. - Latitude - Latitude coordinate of the location (decimal degrees). Range: -90 to 90.
- Longitude - Longitude coordinate of the location (decimal degrees). Range: -180 to 180.
Options
- API Version - Meta Graph API version. Default is
21.0. - Location Name - Name of the location (e.g., business name, landmark).
- Address - Address of the location (e.g., street address, city).
- Access Token - WhatsApp Cloud API Access Token credential (required).
Output
- Response - The complete API response object containing message details and status.
How It Works
The Send Location Message node sends geographic coordinates to a WhatsApp user. When executed, the node:
- Validates all required inputs (coordinates must be valid)
- Retrieves the access token from the credential
- Constructs the location message payload with coordinates
- Adds optional name and address if provided
- Sends a POST request to the WhatsApp API
- Returns the API response with message details
Requirements
- A WhatsApp Business Account in Meta Developer Portal
- Access Token with appropriate permissions
- Valid latitude and longitude coordinates
- Optional: Location name and address for better context
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid Phone Number ID
- Empty or invalid recipient phone number
- Invalid latitude (must be -90 to 90)
- Invalid longitude (must be -180 to 180)
- Invalid access token
- Network connectivity issues
Coordinate System
WhatsApp uses the WGS84 coordinate system (standard GPS coordinates):
- Latitude: North-South position (-90° to +90°)
- Positive: North of equator
- Negative: South of equator
- Longitude: East-West position (-180° to +180°)
- Positive: East of Prime Meridian
- Negative: West of Prime Meridian
Example: Send Store Location
Inputs:
- Phone Number ID:
123456789012345 - To Phone Number:
14155551234 - Latitude:
37.7749 - Longitude:
-122.4194
Options:
- Location Name:
Our Main Store - Address:
123 Market St, San Francisco, CA 94103
Result: Recipient sees a map pin with the store name and address, can tap to open in Google Maps or Apple Maps.
Example: Delivery Location
Use Case: Send delivery location to driver
Inputs:
- Phone Number ID:
123456789012345 - To Phone Number:
{{driver.phone}} - Latitude:
{{order.deliveryLatitude}} - Longitude:
{{order.deliveryLongitude}}
Options:
- Location Name:
{{customer.name}}'s Delivery Address - Address:
{{order.deliveryAddress}}
Example: Meeting Point
Use Case: Share meeting location with attendees
Inputs:
- Phone Number ID:
123456789012345 - To Phone Number:
{{attendee.phone}} - Latitude:
40.7580 - Longitude:
-73.9855
Options:
- Location Name:
Times Square Meeting Point - Address:
Times Square, Manhattan, NY 10036
Usage Notes
- Coordinates should use decimal degrees format (not degrees/minutes/seconds)
- Name and address are optional but highly recommended for clarity
- Recipients can tap the location to open in their preferred maps app
- Location messages show a map preview in the chat
- Accuracy depends on coordinate precision (6 decimal places is typical)
- The map provider used depends on the recipient's device and settings
Tips for RPA Developers
- Validate coordinates before sending (check range limits)
- Use geocoding services to convert addresses to coordinates
- Store location data in your database for reuse
- Include both name and address for better user experience
- For precision: use 6-7 decimal places in coordinates
- Consider user privacy when sharing locations
- Test location accuracy on different map apps
- Implement reverse geocoding to get address from coordinates
Coordinate Precision
Decimal places and their accuracy:
- 1 decimal place: ~11 km precision
- 2 decimal places: ~1.1 km precision
- 3 decimal places: ~110 m precision
- 4 decimal places: ~11 m precision
- 5 decimal places: ~1.1 m precision
- 6 decimal places: ~0.11 m precision (typical for GPS)
Geocoding Integration
Convert addresses to coordinates using geocoding services:
Google Geocoding API:
// Get coordinates from address
const address = "123 Market St, San Francisco, CA";
const geocodeUrl = `https://maps.googleapis.com/maps/api/geocode/json?address=${encodeURIComponent(address)}&key=YOUR_API_KEY`;
// Response includes latitude and longitude
OpenStreetMap Nominatim (Free):
const address = "123 Market St, San Francisco, CA";
const nominatimUrl = `https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(address)}`;
// Response includes lat and lon
Common Use Cases
Business Location Sharing:
- Store locations
- Office addresses
- Service centers
- Branch locations
Delivery & Logistics:
- Delivery addresses
- Pickup points
- Warehouse locations
- Route waypoints
Event Management:
- Meeting points
- Event venues
- Conference locations
- Parking areas
Customer Service:
- Nearest service center
- ATM locations
- Partner locations
- Support centers
Example: Dynamic Location from Database
// Fetch location from database
const store = await db.query('SELECT * FROM stores WHERE id = ?', [storeId]);
// Send location
const locationMessage = {
phoneNumberId: '123456789012345',
toPhoneNumber: customer.phone,
latitude: store.latitude,
longitude: store.longitude,
locationName: store.name,
address: `${store.street}, ${store.city}, ${store.state} ${store.zip}`
};
Common Errors and Solutions
Error: Invalid latitude
- Ensure latitude is between -90 and 90
- Use decimal degrees, not DMS format
- Check for typos in coordinates
Error: Invalid longitude
- Ensure longitude is between -180 and 180
- Use decimal degrees format
- Verify coordinate signs (+ or -)
Error: Location not accurate
- Increase decimal precision
- Verify coordinates using Google Maps
- Use geocoding service for accurate conversion
Best Practices
- Always include location name and address
- Validate coordinates before sending
- Use appropriate precision (6 decimal places)
- Test locations on different devices
- Consider privacy implications
- Use standard coordinate formats
- Provide clear context with name/address
- Verify location accuracy with maps
- Store frequently used locations
- Follow WhatsApp Business Policy
Privacy Considerations
- Only share locations with user consent
- Don't share personal addresses without permission
- Consider data protection regulations
- Use business locations when possible
- Implement opt-out mechanisms
- Log location sharing for audit
- Comply with GDPR and local laws