google-maps

n8n node to calculate travel time and distance using Google Maps API

Package Information

Released: 10 mo ago
Downloads: 31 weekly / 241 monthly
Latest Version: 0.1.1
Author: Aurelian Shuttleworth

Documentation

n8n-nodes-google-maps

This is an n8n community node. It lets you use Google Maps in your n8n workflows.

The node allows you to calculate the travel time and distance between two locations using the Google Maps Distance Matrix API.

n8n is a fair-code licensed workflow automation platform.

Installation
Operations
Credentials
Compatibility
Usage
Resources
Version history

Installation

Follow the installation guide in the n8n community nodes documentation.

Operations

  • Get Travel Time and Distance: Calculates the travel time and distance between a specified origin and destination. You can specify the travel mode (Driving, Walking, Bicycling, or Transit).

Credentials

To use this node, you need to authenticate with the Google Maps API. You'll need a Google Maps API key.

  1. Go to the Google Cloud Console.
  2. Create a new project or select an existing one.
  3. Enable the "Distance Matrix API" for your project.
  4. Create an API key in the "Credentials" section.
  5. It is recommended to restrict the API key to be used only for the Distance Matrix API.
  6. In your n8n workflow, create new credentials for the Google Maps node.
  7. Enter your API key in the "API Key" field.

Compatibility

This node is compatible with n8n version 1.0.0 and later. It is tested against n8n * (as per peerDependencies).

Usage

This node takes an origin and a destination as input, along with a travel mode, and returns the travel distance and duration.

Example:

If you provide:

  • Origin: "New York, NY"
  • Destination: "Boston, MA"
  • Travel Mode: "Driving"

The node will output an object containing:

  • origin: The full address of the origin.
  • destination: The full address of the destination.
  • distance: The distance in a human-readable format (e.g., "215 mi").
  • distanceValue: The distance in meters.
  • duration: The duration in a human-readable format (e.g., "3 hours 53 mins").
  • durationValue: The duration in seconds.
  • mode: The travel mode used for the calculation.

Resources

Version history

v0.1.0 - Initial release.

Discussion