GeoIP Node

GeoIP node to lookup location or ASN information from an IP

Overview

The GeoIP Node performs IP address lookups to retrieve geolocation or ASN (Autonomous System Number) information. It uses the MaxMind GeoLite2 database to provide either detailed raw data or a simplified, user-friendly summary about the location or network associated with an IP address.

Common scenarios:

  • Enriching contact or event data with geographic information based on IP addresses.
  • Detecting and analyzing traffic sources for security or analytics purposes.
  • Routing workflows based on user location or network provider.

Practical examples:

  • Automatically tagging leads in a CRM with their country and city based on their signup IP.
  • Blocking or flagging workflow items from certain countries or networks.
  • Localizing content or notifications according to the user's detected language or region.

Properties

Name Type Meaning
Lookup Type options Selects whether to perform a "Location" (City) or "ASN" lookup for the provided IP address.
IP string The IP address to look up.
Simplify boolean If enabled, returns a simplified version of the response (only for Location lookups).
Options collection Additional settings for output customization.
└ Put Output In Field string (Options) Name of the field in which to place the lookup result.
└ Language options (Options) Language for location names (applies only if "Simplify" is enabled).

Output

  • If "Put Output In Field" is set:
    The lookup result is placed inside the specified field of the output JSON (e.g., json.geo).

  • If "Simplify" is enabled and "Lookup Type" is "Location":
    The output contains a simplified object with fields such as:

    • city: City name (in selected language)
    • country: Country name (in selected language)
    • location: Location name (in selected language)
    • continent: Continent name (in selected language)
    • postal: Postal code
    • registered_country: Registered country name (in selected language)
    • coordinates: Latitude and longitude as a comma-separated string
    • subdivisions: Array of subdivision names (e.g., states/provinces)
  • If "Simplify" is disabled or "Lookup Type" is "ASN":
    The output contains the full raw response from the MaxMind database for the IP.

  • If no result is found:
    The item is skipped (not included in the output).


Dependencies

  • External Services/Databases:
  • Node.js Packages:
    • maxmind
    • geolite2-redist
  • n8n Configuration:
    • No API keys required; the node uses local database files distributed with the dependencies.

Troubleshooting

Common issues:

  • Invalid or missing IP address:
    If the IP is empty or invalid, no data will be returned for that item.
  • Database not found or inaccessible:
    Errors may occur if the GeoLite2 database cannot be loaded (e.g., due to missing files or permissions).
  • Unsupported language code:
    If an unsupported language is selected, English will be used as fallback.

Error messages:

  • "Cannot read property 'get' of undefined":
    Indicates the database could not be opened. Check installation and file access.
  • "No data found for IP":
    The IP address does not exist in the database or is malformed.
  • NodeOperationError:
    General error wrapper for unexpected failures; check the error details for more information.

How to resolve:

  • Ensure the IP address is valid and present.
  • Verify that all dependencies are installed and accessible.
  • Use supported language codes as listed in the node's options.

Links and References

Discussion