Overview
This node parses a given phone number and extracts detailed information about it. It is useful for workflows that need to validate, format, or analyze phone numbers from various countries. For example, it can be used to standardize phone numbers in contact lists, verify if a phone number is valid and possible, or extract country and type information for further processing.
Properties
| Name | Meaning |
|---|---|
| Keep Only Set | Whether to keep only the values set by this node and remove all other data from input items. |
| Default Country | The default country code to assume when parsing the phone number (e.g., US, GB, DE). |
| Phone Number | The phone number string to parse (e.g., "+1 555 555 5555"). |
Output
The node outputs JSON data with the following fields describing the parsed phone number:
country: The detected country code of the phone number (e.g., "US").countryCallingCode: The international calling code (e.g., "1" for USA).nationalNumber: The national significant number part without country code.formatNational: The phone number formatted in the national style.formatInternational: The phone number formatted in the international style.formatE164: The phone number formatted in E.164 standard.formatRFC3966: The phone number formatted according to RFC3966.possible: Boolean indicating if the phone number is possibly valid.valid: Boolean indicating if the phone number is valid.nonGeographic: Boolean indicating if the phone number is non-geographic.type: The type of phone number (e.g., "mobile", "fixed line").
If the input item contains binary data and "Keep Only Set" is false, the binary data is preserved in the output.
Dependencies
- Uses the external library
libphonenumber-jsfor phone number parsing and formatting. - No external API keys or credentials are required.
- No special environment variables or n8n configurations needed.
Troubleshooting
- Invalid or empty phone number: If the phone number is invalid or empty, the output fields will mostly be empty or false. Ensure the phone number is correctly formatted and includes country code if necessary.
- Unsupported country code: If the default country code is not supported, parsing may fail or produce incomplete results. Use one of the supported ISO country codes.
- Incorrect "Keep Only Set" usage: Setting "Keep Only Set" to true removes all original input data except the parsed phone number info, which might cause loss of important data unintentionally.
- Parsing errors: Errors related to phone number parsing usually stem from malformed input strings or unsupported formats.