IP Geolocation Lookup and HTTP Port Scanner using Google Sheets - n8n Workflow

Automate IP geolocation lookups and HTTP port scanning directly from Google Sheets using this powerful n8n workflow. Perfect for network monitoring and security research. Discover more n8n templates.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Network security analysts and researchers.
DevOps engineers needing automated external IP monitoring.
IT professionals building IP intelligence databases.
Users seeking advanced, practical n8n templates for data enrichment.

Overview

This specialized n8n workflow automates the crucial, time-consuming task of IP address reconnaissance. It starts the moment a new IP address is logged in your Google Sheet. The workflow immediately executes a geolocation lookup, enriching the data with ISP, city, and country information. Following this enrichment, the n8n workflow automatically initiates an HTTP port scan across commonly used ports (80, 443, 3000, 8000, 8080) to check for live services. The entire process—from detection via the n8n trigger to final data update—is seamless, ensuring your security intelligence is current and accurate without manual intervention. This robust n8n workflow demonstrates complex flow control and error handling.

How it Works

The automation begins with the Google Sheets n8n trigger, which monitors a specified sheet for newly added rows containing an IP address.


  1. Geolocation Lookup: The IP address extracted by the n8n trigger is sent via an HTTP Request n8n node to an external GeoIP API (ip-api.com).

  2. Initial Update: The resulting geographic and organizational data (ISP, City, Country, Lat, Lon) is immediately written back to the original row in Google Sheets using a dedicated Google Sheets n8n node.

  3. Port Definition: A Set n8n node adds a list of target ports ([80, 443, 8080, 8000, 3000]) to the data structure.

  4. Item Splitting: The Split Out n8n node then breaks the input into multiple items—one item for the IP combined with each port—allowing the subsequent steps to execute the HTTP scan iteratively for every port.

  5. Port Scanning: An HTTP Request n8n node attempts to connect to http://{{ $json.IP }}:{{$json.ports}}/. Crucially, this n8n node is configured to continue on error, capturing connection refusals or timeouts as scan failures.

  6. Result Aggregation: A Code n8n node (PutAllinOneItem) aggregates the results from the parallel port scans. It checks the response status or error message for each port and compiles a dictionary indicating whether the port is open (true) or inaccessible/closed.

  7. Final Update: Finally, a Google Sheets n8n node updates the Google Sheet row again, populating the designated columns (e.g., Port80, Port443) with the aggregated scan results. This complete n8n workflow cycle ensures maximum data utility.

Installation Guide

To use this n8n workflow template, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON and import it into your n8n instance.

  2. Google Sheets Credentials Setup: You will need two Google Sheets credentials:

One credential for the Google Sheets Trigger n8n node to enable polling.
A second credential for the two Google Sheets n8n nodes (UpdateIPInforow and UpdateHTTPPortsState) for write access.

  1. Sheet Configuration: Ensure your Google Sheet is set up with columns matching the workflow logic (e.g., IP, Country, City, Port80, Port443, etc.). Update the Document ID and Sheet Name parameters in all three Google Sheets n8n node instances to point to your specific spreadsheet.

  2. IP Geolocation Node: The GetIP_Info n8n node uses a free API endpoint (ip-api.com). No credentials are required, but be mindful of usage limits.

  3. Activate: Save the n8n workflow and activate it. The Google Sheets n8n trigger will now check for new IPs periodically.

Node Details

Google Sheets Trigger (n8n trigger):
Function: Starts the n8n workflow when a new row is detected.
Key Configuration: Operation: rowAdded, configured to monitor 'Sheet1' of the 'IP-Info' document.
GetIPInfo (HTTP Request n8n node):
Function: Retrieves geolocation details for the input IP.
Key Configuration: URL is dynamically set to http://ip-api.com/json/{{ $json.IP }}.
UpdateIPInforow (Google Sheets n8n node):
Function: Updates the triggering row with the newly fetched geolocation data.
Key Configuration: Operation: update, matches the row based on the IP column.
Edit Fields (Set n8n node):
Function: Introduces a defined list of ports to scan.
Key Configuration: Sets the ports field to the array: [80, 443, 8080, 8000, 3000].
Split Out (Item Lists n8n node):
Function: Converts the array of ports into individual items, enabling parallel port scanning.
Key Configuration: Splits on the ports field.
CheckHttpPort (HTTP Request n8n node):
Function: Performs the HTTP connectivity check for each port.
Key Configuration: URL is set dynamically to http://{{ $json.IP }}:{{$json.ports}}/. Crucially, onError is set to continueRegularOutput to capture connection errors gracefully.
PutAllinOneItem (Code n8n node):
Function: Aggregates the results of all individual port scans back into one summary object.
Key Configuration: Custom JavaScript logic determines port status based on successful response or specific error codes.
UpdateHTTPPortsState (Google Sheets n8n node):
Function: Writes the final scan results (Port status) back to the Google Sheet.
Key Configuration: Operation: update, uses the IP address to match the correct row and updates columns like Port
80 and Port_443 based on the aggregated results.

Related n8n Workflows

Free

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

Hosting, Virtual Server, Dedicated Server and Register Domain.

Featured*