US Phone Number Formatter and Validator Workflow

somdn_product_page

This n8n workflow automates the process of validating, formatting, and standardizing US phone numbers received from external sources or workflows. The goal is to ensure phone numbers are correctly formatted according to international and national standards, and to handle cases where numbers are invalid or incomplete.

The workflow is triggered by another workflow, receiving a ‘Phone Number’ input. The initial step strips any existing formatting from the phone number, converting it to a plain string of digits. It then checks the first digit to determine if it matches a valid US country code (typically ‘1’). If valid, it adds the country code prefix to the phone number.

Next, the workflow evaluates the total length of the number to verify if it contains a full 10-digit US number, more than 10 digits, or less (invalid). Based on this check, it either proceeds with the formatting or clears invalid entries.

Subsequently, the workflow formats the phone number into several formats: E.164 (international format), national format, full national format with country code, and international dialing format. It also extracts and processes extensions if present.

If the number fails validation, it is cleared from the data set to maintain data integrity. This workflow is particularly useful for contact data management, CRM systems, or any application that requires consistent, validated US phone number formats from diverse input sources.

Node Count

6 – 10 Nodes

Nodes Used

executeWorkflowTrigger, if, set, switch

Reviews

There are no reviews yet.

Be the first to review “US Phone Number Formatter and Validator Workflow”

Your email address will not be published. Required fields are marked *