{
  "name": "Standardize US phone numbers with multiple format options and validation",
  "nodes": [
    {
      "id": "bf150da4-5e01-4571-a606-10a0fb25004b",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        0,
        275
      ]
    },
    {
      "id": "7c560ecf-c827-413f-a115-7b6bc8f21a41",
      "name": "Check if first digit is valid country code",
      "type": "n8n-nodes-base.if",
      "position": [
        660,
        275
      ]
    },
    {
      "id": "783d8fd0-2a38-41fc-87c9-b0aec9933070",
      "name": "Add valid country code",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        475
      ]
    },
    {
      "id": "a93923f3-5d8d-4617-a63d-50b66b3b1128",
      "name": "Strip phone number formatting",
      "type": "n8n-nodes-base.set",
      "position": [
        220,
        275
      ]
    },
    {
      "id": "58d6d280-ec86-4b69-a89c-e43571ce1035",
      "name": "Check number of digits in phone number",
      "type": "n8n-nodes-base.switch",
      "position": [
        440,
        254
      ]
    },
    {
      "id": "1f6a4aa7-0595-4db3-a9c3-dc7a72656597",
      "name": "Format phone numbers",
      "type": "n8n-nodes-base.set",
      "position": [
        1100,
        325
      ]
    },
    {
      "id": "7bc3c1a0-2056-48a0-b826-21a8c1bff31b",
      "name": "Clear invalid number",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        125
      ]
    }
  ],
  "connections": {
    "Clear invalid number": {
      "main": [
        [
          {
            "node": "Format phone numbers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format phone numbers": {
      "main": [
        []
      ]
    },
    "Add valid country code": {
      "main": [
        [
          {
            "node": "Format phone numbers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Strip phone number formatting": {
      "main": [
        [
          {
            "node": "Check number of digits in phone number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Strip phone number formatting",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check number of digits in phone number": {
      "main": [
        [
          {
            "node": "Check if first digit is valid country code",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add valid country code",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Clear invalid number",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Clear invalid number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if first digit is valid country code": {
      "main": [
        [
          {
            "node": "Format phone numbers",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Clear invalid number",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}