Google Maps Action Block
What it does: Turns addresses into coordinates, finds nearby places, computes routes and travel times, and builds map images — using the Google Maps Platform web service APIs.
In simple terms: Give the block an address, a pair of coordinates, or a search phrase, and it hands back structured location data you can branch on, store, or feed to an LLM.
Credentials
Create an API key in the Google Cloud Console → APIs & Services → Credentials, then enable the APIs you plan to call in the same project:
- Geocoding API — Geocode Address, Reverse Geocode
- Places API — Search Places, Nearby Search, Place Details, Place Autocomplete
- Directions API — Get Directions
- Distance Matrix API — Distance Matrix
- Time Zone API / Elevation API / Maps Static API — the remaining actions
Restrict the key to those APIs (and, where possible, to your server IPs). An unrestricted key is billable by anyone who obtains it.
Actions
| Action | What it does | Output |
|---|---|---|
| Geocode Address | Converts an address into coordinates | results plus flattened formattedAddress, lat, lng, placeId |
| Reverse Geocode | Converts lat,lng into an address | Same flattened shape as Geocode |
| Search Places | Places Text Search from a free-form query | results, count |
| Nearby Search | Places within a radius of a point, by type/keyword | results, count |
| Place Details | Full detail for one place_id | The result object (name, address, phone, website, rating, hours, url) |
| Place Autocomplete | Predictions for partially typed input | predictions, count |
| Get Directions | Route between origin and destination, optional waypoints | routes plus summary (distanceText, durationText, startAddress, endAddress, steps) |
| Distance Matrix | Travel distance/time for every origin–destination pair | rows plus flattened pairs |
| Get Time Zone | Time zone at a point for a timestamp | timeZoneId, timeZoneName, offsets |
| Get Elevation | Elevation for one or more points | results plus first elevation |
| Static Map URL | Builds a Maps Static API image URL (no request is sent) | { url } |
Errors
Google's web services answer with HTTP 200 and report the real outcome in a status field. The block fails the step whenever status is not OK, surfacing error_message when Google provides one — common values are REQUEST_DENIED (API not enabled or key restricted), OVER_QUERY_LIMIT, and INVALID_REQUEST.
Search-style actions (Search Places, Nearby Search, Place Autocomplete, Geocode, Directions, Distance Matrix) treat ZERO_RESULTS as a success with an empty list, so you can branch on count instead of handling an error.
Tips
- Radius is in meters and caps at 50000.
- Pass
departure_timeasnowon Directions and Distance Matrix to get traffic-aware durations. - Place Details defaults to a useful field set (
name,formatted_address,geometry,formatted_phone_number,website,rating,user_ratings_total,opening_hours,url); narrowing the Fields input lowers your bill. - Chain Place Autocomplete → Place Details with the same Session Token so Google bills the pair as one session.
- Static Map URL embeds the API key in the returned URL. Only send it somewhere you trust, and use a key restricted to the Maps Static API.