libphonenumber

n8n community node for parsing, formatting, and validating phone numbers using libphonenumber-js (Google libphonenumber port).

Package Information

Released: 5 mo ago
Downloads: 12 weekly / 32 monthly
Latest Version: 0.1.1
Author: Ciprian Arsenie

Documentation

@voxbee/n8n-nodes-libphonenumber

n8n community node for parsing, formatting and validating phone numbers worldwide using libphonenumber-js — a JavaScript port of Google's libphonenumber.

This is an n8n community node. It lets you handle phone numbers in your n8n workflows without writing JavaScript.

Installation • Operations • Examples • Credentials • Compatibility • License

Installation

Follow the installation guide in the n8n community nodes documentation.

In your n8n instance, go to Settings → Community Nodes, click Install, and enter:

@voxbee/n8n-nodes-libphonenumber

After installation a new Phone Number node will appear in the node panel.

Operations

Operation What it does Output fields
Parse Extract the structured parts of a phone number e164, international, national, nationalNumber, country, countryCallingCode, type, isValid, possible
Format Reformat a number in E.164 / International / National / RFC3966 formatted, format, isValid
Validate Check whether a number is valid isValid, country, type
Get Country Return only the ISO country code and calling code country, countryCallingCode

Common parameters

  • Phone Number (required) — the phone number to process. Either include the international prefix (e.g. +40215700000) or set a Default Country below.
  • Default Country (optional) — ISO 3166-1 alpha-2 code (e.g. RO, DE, US) used when the input has no + prefix.
  • Continue On Invalid (option) — when set, returns { isValid: false, error: ... } instead of throwing.

Examples

1. Parse a phone number for CRM enrichment

Input:

+40215700000

Parse operation output:

{
  "input": "+40215700000",
  "isValid": true,
  "e164": "+40215700000",
  "international": "+40 21 570 0000",
  "national": "021 570 0000",
  "nationalNumber": "215700000",
  "country": "RO",
  "countryCallingCode": "+40",
  "type": "FIXED_LINE",
  "possible": true
}

This is the typical output you'd send to a CRM that stores nationalNumber and countryCallingCode as separate fields (Twenty CRM, HubSpot, etc.) — no more CONFLICTING_PHONE_COUNTRY_CODE errors.

2. Format an international number for display

Input: +447700900123, format: INTERNATIONAL (UK Ofcom drama-use number range)

Output:

{ "formatted": "+44 7700 900123", "format": "INTERNATIONAL", "isValid": true }

3. Validate before sending an SMS

Use the Validate operation followed by an IF node on isValid to skip junk numbers.

4. Detect country from a number

Get Country for +33123456789 returns:

{ "country": "FR", "countryCallingCode": "+33" }

Credentials

This node does not require any credentials. All processing happens locally inside the n8n process — no external API calls.

Compatibility

  • n8n: >= 1.0.0 (uses n8nNodesApiVersion: 1)
  • Node.js: >= 20.15
  • Built on top of libphonenumber-js ^1.11.0

Why this exists

When syncing phone numbers between systems (Chatwoot → CRM, web forms → Salesforce, etc.) it's common to hit issues like:

  • CONFLICTING_PHONE_COUNTRY_CODE because the source hard-coded RO while the actual prefix was +45
  • Search mismatches because one system stores +40215700000 and another stores 215700000
  • Typing the same prefix-stripping logic in every Code node

This node centralises all of that into a no-code n8n action.

Development

git clone https://github.com/voxbee/n8n-nodes-libphonenumber.git
cd n8n-nodes-libphonenumber
npm install
npm run build

Test locally by linking the build output into your n8n custom directory:

mkdir -p ~/.n8n/custom
ln -s "$(pwd)" ~/.n8n/custom/@voxbee/n8n-nodes-libphonenumber

Restart n8n and the node will appear in the panel.

License

MIT © Voxbee

Discussion