Geocoding Addresses via Google Sheets and Maps API - n8n Workflow

Automate geocoding with this powerful n8n workflow. Use this n8n template to read addresses from Google Sheets, call the Google Maps API, and update location data efficiently.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Data Analysts who need to enrich location data stored in spreadsheets.
Logistics and operations teams requiring accurate geospatial data.
Users looking for practical n8n templates integrating external APIs with cloud storage.
Developers seeking an example of a batch HTTP Request n8n node implementation.

Overview

Managing vast datasets often involves manually finding geographic coordinates for addresses, a time-consuming and error-prone process. This specialized n8n workflow solves this by fully automating the geocoding task. It acts as an automated bridge between Google Sheets and the Google Maps Platform API. The core value of this n8n template is its ability to process multiple addresses iteratively, making a simple HTTP request for each item and then accurately writing the resulting Lat/Long data back into the original sheet. Utilizing the Google Sheets n8n node ensures that large batch operations are handled smoothly and reliably, making this a highly efficient and repeatable solution built entirely within n8n.

How it Works

The entire process is initiated by the manual n8n trigger node.


  1. Trigger & Read: The execution starts with the 'When clicking ‘Test workflow’' n8n trigger, which immediately proceeds to the 'Extract The Places from Google Sheet' n8n node.

  2. Data Extraction: This Google Sheets n8n node reads all rows from the specified sheet (likely containing the addresses to be geocoded).

  3. API Call: For every address extracted, the 'Using Google Map API to Return Lat Long Back' n8n node (an HTTP Request n8n node) executes. It dynamically inserts the 'Address' field from the sheet item into the Google Maps API query parameters. This is where the geocoding request is made.

  4. Response Handling: The API returns a JSON payload containing the location geometry. This n8n workflow extracts the latitude (lat) and longitude (lng) from the first result.

  5. Data Update: Finally, the 'Update Lat-Long in Each Places' Google Sheets n8n node takes the newly calculated Lat/Long pair and the original row_number (carried over from the extraction step) and updates the designated 'Latlong' column in the Google Sheet, completing the automated geocoding process. This looping structure allows the n8n workflow to handle many addresses in sequence.

Installation Guide

To use this powerful n8n template, follow these steps:


  1. Import: Copy the provided JSON and import it directly into your n8n instance using the 'New' > 'Import from JSON' option.

  2. Google Sheets Credentials: You must configure a Google Sheets OAuth2 API credential. Click on the credential field in both Google Sheets n8n node steps ('Extract The Places...' and 'Update Lat-Long...') and connect your Google Account, granting necessary read/write permissions.

  3. Configure Sheet IDs: Ensure both Google Sheets n8n node instances are pointed at your specific spreadsheet document ID and sheet name (or GID). The workflow currently targets a sheet named 'Sheet2' in the 'Latlong Testing' document.

  4. Google Maps API Key: In the 'Using Google Map API to Return Lat Long Back' n8n node, replace the placeholder API key in the key query parameter with your valid Google Maps Platform API key. For production environments, it is recommended to store this key securely using an n8n credential or environment variable expression instead of hardcoding it.

  5. Run: Click the 'When clicking ‘Test workflow’' n8n trigger to test the execution.

Node Details

When clicking ‘Test workflow’ (Manual Trigger n8n trigger):
Function: Starts the n8n workflow manually for testing or single executions.
Key Configuration: None, standard manual trigger.

Extract The Places from Google Sheet (Google Sheets n8n node):
Function: Fetches all data (rows and columns) from the source sheet, feeding the addresses into the next step.
Key Configuration: Operation set to 'Get All' (implied by lack of explicit parameters), targeting a specific Sheet ID and Name.

Using Google Map API to Return Lat Long Back (HTTP Request n8n node):
Function: Queries the Google Maps Text Search API to resolve the address into coordinates.
Key Configuration: Uses dynamic data mapping: query parameter is set to ={{ $json.Address }}. Requires a valid Google Maps API Key to be configured.

Update Lat-Long in Each Places (Google Sheets n8n node):
Function: Updates the Latlong column in the source spreadsheet using the results obtained from the previous n8n node.
Key Configuration: Operation is set to 'Update'. Matches rows based on the incoming row_number and writes the combined latitude and longitude string ({{ $json.results[0].geometry.location.lat }},{{ $json.results[0].geometry.location.lng }}) to the 'Latlong' column.

Related n8n Workflows

Free

Nodes: 3 Nodes
Updated: December 26 2025
View all
Created by

Automation consultant specializing in Data, AI, and Automation, founder of hundredtimesfaster.com and No Code AI community. Currently AI & Data Solutions Lead at Assetwise PCL, with a proven track record of driving innovation and efficiency in leading firms. Author of Practical Data Visualization & Analytics with Looker Studio. Book a consultation to explore custom solutions!

Featured*