n8n-nodes-google-maps-directions-api
v0.1.1
Published
Get Google Maps directions between two places with distance, duration, and route options. Apify-backed n8n community node, pay-per-result, and usable as an AI agent tool.
Maintainers
Readme
n8n-nodes-google-maps-directions-api
An n8n community node that gets Google Maps directions between two places and returns distance, duration, and route options. It is backed by the Google Maps Directions API on Apify and bills per result, so there are no subscriptions and no minimums.
Installation · Credentials · Operations · Output · Example workflows · Pricing · Resources
What it does
Give the node a start and end address, and it returns the best distance and duration plus a list of route options. It also works as an AI Agent tool, so an agent can plan routes on demand.
- Get directions for driving, transit, walking, or bicycling
- Avoid tolls or highways
- Localize with a country code and language code
- Choose how much data to return: Simplified, Raw, or Selected Fields
Installation
Follow the n8n community nodes installation guide:
- In n8n, open Settings > Community Nodes.
- Select Install.
- Enter
n8n-nodes-google-maps-directions-apias the npm package name. - Agree to the risks of using community nodes, then select Install.
After it installs, the Google Maps Directions node appears in the nodes panel.
n8n Cloud only allows verified community nodes. Until this node is verified, install it on a self-hosted n8n instance.
Credentials
You need a free Apify account and an API token.
- Sign in to the Apify Console.
- Open Settings > Integrations and copy your Personal API token.
- In n8n, create a new Apify API credential and paste the token.
- Use the credential's Test button to confirm it works.
The node also supports Apify OAuth2 if you prefer to connect that way.
Operations
Route > Get returns directions between two places.
| Parameter | Description |
| --- | --- |
| Start Address | The starting address or place. Required. |
| End Address | The destination address or place. Required. |
| Travel Mode | Best, Driving, Transit, Walking, or Bicycling. |
| Avoid Tolls / Avoid Highways | Route preferences. |
| Country Code / Language Code | Localization, for example us and en. |
| Output | How much data to return: Simplified, Raw, or Selected Fields. |
Output
One item is returned per directions query. The Output parameter lets you choose how much to return:
- Simplified (default): a compact object with
start,end,travelMode,bestDistance,bestDuration,directionsCount,mapsUrl, androutes(each withvia,distance,duration,travelMode). This mode is also used automatically when the node runs as an AI Agent tool, to keep responses small. - Raw: every field the API returns, using the original field names below.
- Selected Fields: pick exactly which fields to include.
Fields (Raw and Selected Fields)
| Field | Type | Description |
| --- | --- | --- |
| result_type | string | Result type, for example directions |
| start | object | Resolved start place |
| end | object | Resolved end place |
| travel_mode | string | Travel mode used |
| directions_found | boolean | Whether routes were found |
| directions_count | integer | Number of route options |
| best_duration | object | Best route duration |
| best_distance | object | Best route distance |
| places_info | object | Details about the start and end places |
| directions | array | All route options with via, distance, duration, and trips |
| durations | array | Durations across the day, when available |
| google_maps_directions_url | string | Link to the route on Google Maps |
Example workflows
1. Compute ETAs for a list of trips
- Read a list of start/end pairs.
- Google Maps Directions: get directions for each, Output
Simplified. - Google Sheets: append
bestDistanceandbestDuration.
2. Toll-free route planning
- Manual Trigger.
- Google Maps Directions: set Avoid Tolls, Travel Mode
Driving. - Set: keep
routesandmapsUrl.
3. Let an AI Agent plan a route
- AI Agent node.
- Attach Google Maps Directions as a tool.
- Ask "How long to drive from Austin to Dallas avoiding tolls?" The agent calls the node (in Simplified mode) and answers with the route.
Pricing
This node calls the Google Maps Directions API on Apify, which is billed pay-per-result, with no subscription and no minimums. Apify also includes a free monthly usage tier that covers typical volumes. See the Actor page for current rates.
Resources
- Google Maps Directions API on Apify
- npm package
- n8n community nodes documentation
- Apify n8n integration guide
