{
  "nodes": [
    {
      "id": "c57da7be-c2f3-4352-8761-d51f923b9d83",
      "name": "Validate email",
      "type": "@zerobounce/n8n-nodes-zerobounce.zeroBounce",
      "position": [
        672,
        752
      ],
      "parameters": {
        "email": "={{ $('Shopify customer created').item.json.email }}",
        "addOptions": {
          "timeout": 10
        }
      },
      "credentials": {
        "zeroBounceApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a195d9bb-b1c5-4758-b745-6866646398e2",
      "name": "Shopify customer created",
      "type": "n8n-nodes-base.shopifyTrigger",
      "position": [
        0,
        1040
      ],
      "parameters": {
        "topic": "customers/create",
        "authentication": "oAuth2"
      },
      "credentials": {
        "shopifyOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c37fec98-e438-4e49-8afc-52e32ad8efc5",
      "name": "Status",
      "type": "n8n-nodes-base.switch",
      "position": [
        896,
        736
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Valid",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "468015f8-26f2-4e72-be62-cb7a801b1e5d",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "valid"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Catch-all",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "ee6eb4c7-2d0e-4645-9454-5d63d863d355",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "catch-all"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra",
          "renameFallbackOutput": "Other"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "11e6943d-e04e-47f2-9533-575c53b4a564",
      "name": "Has email?",
      "type": "n8n-nodes-base.if",
      "position": [
        224,
        1040
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "7287ef71-fd0e-4283-a029-d56939120766",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.email }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "159e3d9e-6e73-408d-aebf-e27246c49884",
      "name": "Filter by score",
      "type": "n8n-nodes-base.switch",
      "position": [
        1568,
        544
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "high",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "loose"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "47aa6c56-2c5a-41ac-8f5c-5b7f183d898b",
                    "operator": {
                      "type": "number",
                      "operation": "gte"
                    },
                    "leftValue": "={{ $json.score }}",
                    "rightValue": 9
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "medium",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "loose"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "b1bdb574-a04c-4086-86a3-899e53ccda07",
                    "operator": {
                      "type": "number",
                      "operation": "gte"
                    },
                    "leftValue": "={{ $json.score }}",
                    "rightValue": 3
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "low",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "loose"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "5c624f71-1acc-4ce8-92d3-821fe2d4f83b",
                    "operator": {
                      "type": "number",
                      "operation": "lt"
                    },
                    "leftValue": "={{ $json.score }}",
                    "rightValue": 3
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": 2
        },
        "looseTypeValidation": true
      },
      "typeVersion": 3.3
    },
    {
      "id": "c0c00021-4e1f-45c8-a10a-b18322e9c156",
      "name": "Score email",
      "type": "@zerobounce/n8n-nodes-zerobounce.zeroBounce",
      "position": [
        1344,
        560
      ],
      "parameters": {
        "email": "={{ $('Shopify customer created').item.json.email }}",
        "resource": "scoring"
      },
      "credentials": {
        "zeroBounceApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "8398b129-4b38-4557-8780-dfe5750575c4",
      "name": "Not valid",
      "type": "n8n-nodes-base.set",
      "position": [
        1792,
        1136
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "760f0ae8-a358-4875-9607-37f2d827bafe",
              "name": "reason",
              "type": "string",
              "value": "Not valid"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "66fa9bd0-225d-41db-a342-6c4b4f2e28b8",
      "name": "Not enough credits for scoring",
      "type": "n8n-nodes-base.set",
      "position": [
        1792,
        944
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "760f0ae8-a358-4875-9607-37f2d827bafe",
              "name": "reason",
              "type": "string",
              "value": "Not enough credits for scoring"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "94fbf491-0148-4ddb-bdef-f7cc0791a6ab",
      "name": "Not enough credits for validation",
      "type": "n8n-nodes-base.set",
      "position": [
        1792,
        1328
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "760f0ae8-a358-4875-9607-37f2d827bafe",
              "name": "reason",
              "type": "string",
              "value": "Not enough credits for validation"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "9fe832a7-2cf8-4730-87e6-5be214557184",
      "name": "Email missing",
      "type": "n8n-nodes-base.set",
      "position": [
        1792,
        1520
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "760f0ae8-a358-4875-9607-37f2d827bafe",
              "name": "reason",
              "type": "string",
              "value": "Email missing"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5d0d6419-ee99-452e-8093-7cf8fcfb7e78",
      "name": "Check credits for validation",
      "type": "@zerobounce/n8n-nodes-zerobounce.zeroBounce",
      "onError": "continueErrorOutput",
      "position": [
        448,
        944
      ],
      "parameters": {
        "resource": "account",
        "addOptions": {
          "creditsRequired": 1
        }
      },
      "credentials": {
        "zeroBounceApi": {
          "name": "<your credential>"
        }
      },
      "executeOnce": false,
      "typeVersion": 1
    },
    {
      "id": "7833c644-0f85-413e-88b4-0a3b2ce50333",
      "name": "Check credits for scoring",
      "type": "@zerobounce/n8n-nodes-zerobounce.zeroBounce",
      "onError": "continueErrorOutput",
      "position": [
        1120,
        752
      ],
      "parameters": {
        "resource": "account",
        "addOptions": {
          "creditsRequired": 1
        }
      },
      "credentials": {
        "zeroBounceApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a08e6bbd-1617-47b5-afd7-6217d72dfc8e",
      "name": "Medium score",
      "type": "n8n-nodes-base.set",
      "position": [
        1792,
        560
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "760f0ae8-a358-4875-9607-37f2d827bafe",
              "name": "reason",
              "type": "string",
              "value": "Medium score"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "6bfd3b4f-4e31-4db5-ba4c-594b9dfc64ab",
      "name": "Low score",
      "type": "n8n-nodes-base.set",
      "position": [
        1792,
        752
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "760f0ae8-a358-4875-9607-37f2d827bafe",
              "name": "reason",
              "type": "string",
              "value": "Low score"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "aef3ae96-fa35-46d7-9586-8bb57778c705",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        112
      ],
      "parameters": {
        "color": 7,
        "width": 864,
        "content": "## Shopify to HubSpot: Advanced ZeroBounce Lead Vetting\n\n**This workflow automates the transition of new Shopify customers into HubSpot, using [ZeroBounce](https://www.zerobounce.net) for multi-layer validation (Validation + AI Scoring).**\n\n**Results are also output to Google Sheets for review.**"
      },
      "typeVersion": 1
    },
    {
      "id": "30c3261c-089d-49b1-85b6-ec91c92aecc0",
      "name": "Add to Accepted",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2016,
        272
      ],
      "parameters": {
        "columns": {
          "value": {
            "ID": "={{ $('Shopify customer created').item.json.id }}",
            "Email": "={{ $('Shopify customer created').item.json.email }}",
            "ZB Score": "={{ $node[\"Score email\"] ? $('Score email').item.json.score : \"\" }}",
            "Last Name": "={{ $('Shopify customer created').item.json.last_name }}",
            "ZB Domain": "={{ $('Validate email').item.json.domain }}",
            "ZB Status": "={{ $('Validate email').item.json.status }}",
            "First Name": "={{ $('Shopify customer created').item.json.first_name }}",
            "ZB Account": "={{ $('Validate email').item.json.account }}",
            "Accepted At": "={{ $now }}",
            "ZB MX Found": "={{ $('Validate email').item.json.mx_found }}",
            "ZB MX Record": "={{ $('Validate email').item.json.mx_record }}",
            "ZB Free Email": "={{ $('Validate email').item.json.free_email }}",
            "ZB Sub Status": "={{ $('Validate email').item.json.sub_status }}",
            "Accepted Reason": "={{ $json.reason }}",
            "ZB Did You Mean": "={{ $('Validate email').item.json.did_you_mean }}",
            "ZB SMTP Provider": "={{ $('Validate email').item.json.smtp_provider }}",
            "ZB Domain Age Days": "={{ $('Validate email').item.json.domain_age_days }}"
          },
          "schema": [
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Accepted At",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Accepted At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Accepted Reason",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Accepted Reason",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ZB Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Sub Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ZB Sub Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Free Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ZB Free Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Did You Mean",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ZB Did You Mean",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Account",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ZB Account",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Domain",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ZB Domain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Domain Age Days",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ZB Domain Age Days",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB SMTP Provider",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ZB SMTP Provider",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB MX Found",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ZB MX Found",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB MX Record",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ZB MX Record",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Score",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "ZB Score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "ID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 490801678,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fzvQqJzYXFaPiINaQunC16t2Xe2oXs-EhCy-x4uDa6U/edit#gid=490801678",
          "cachedResultName": "Accepted"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1fzvQqJzYXFaPiINaQunC16t2Xe2oXs-EhCy-x4uDa6U",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fzvQqJzYXFaPiINaQunC16t2Xe2oXs-EhCy-x4uDa6U/edit?usp=drivesdk",
          "cachedResultName": "ZeroBounce Validation"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "46a54e92-b1cd-4921-a718-445e1f414b14",
      "name": "Add to Rejected",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2016,
        864
      ],
      "parameters": {
        "columns": {
          "value": {
            "ID": "={{ $('Shopify customer created').item.json.id }}",
            "Email": "={{ $('Shopify customer created').item.json.email }}",
            "ZB Score": "={{ $node[\"Score email\"] ? $('Score email').item.json.score : \"\" }}",
            "Last Name": "={{ $('Shopify customer created').item.json.last_name }}",
            "ZB Domain": "={{ $('Validate email').item.json.domain }}",
            "ZB Status": "={{ $('Validate email').item.json.status }}",
            "First Name": "={{ $('Shopify customer created').item.json.first_name }}",
            "ZB Account": "={{ $('Validate email').item.json.account }}",
            "Rejected At": "={{ $now }}",
            "ZB MX Found": "={{ $('Validate email').item.json.mx_found }}",
            "ZB MX Record": "={{ $('Validate email').item.json.mx_record }}",
            "Reject Reason": "={{ $json.reason }}",
            "ZB Free Email": "={{ $('Validate email').item.json.free_email }}",
            "ZB Sub Status": "={{ $('Validate email').item.json.sub_status }}",
            "ZB Did You Mean": "={{ $node[\"Validate email\"] ? $('Validate email').item.json.did_you_mean : \"\" }}",
            "ZB SMTP Provider": "={{ $('Validate email').item.json.smtp_provider }}",
            "ZB Domain Age Days": "={{ $('Validate email').item.json.domain_age_days }}"
          },
          "schema": [
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Rejected At",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Rejected At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reject Reason",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Reject Reason",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ZB Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Sub Status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ZB Sub Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Free Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ZB Free Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Did You Mean",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ZB Did You Mean",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Account",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ZB Account",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Domain",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ZB Domain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Domain Age Days",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ZB Domain Age Days",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB SMTP Provider",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ZB SMTP Provider",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB MX Found",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ZB MX Found",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB MX Record",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ZB MX Record",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Score",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ZB Score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "ID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fzvQqJzYXFaPiINaQunC16t2Xe2oXs-EhCy-x4uDa6U/edit#gid=0",
          "cachedResultName": "Rejected"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1fzvQqJzYXFaPiINaQunC16t2Xe2oXs-EhCy-x4uDa6U",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fzvQqJzYXFaPiINaQunC16t2Xe2oXs-EhCy-x4uDa6U/edit?usp=drivesdk",
          "cachedResultName": "ZeroBounce Validation"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "485b4120-cb1d-4b4a-8fc3-382145ab96c0",
      "name": "Create Hubspot contact",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        2240,
        272
      ],
      "parameters": {
        "email": "={{ $('Validate email').item.json.address }}",
        "options": {},
        "authentication": "oAuth2",
        "additionalFields": {
          "lastName": "={{ $('Shopify customer created').item.json.last_name }}",
          "firstName": "={{ $('Shopify customer created').item.json.first_name }}",
          "countryRegionCode": "={{ $('Shopify customer created').item.json.addresses[0].country_code }}"
        }
      },
      "credentials": {
        "hubspotOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "16faad85-7014-4465-bb10-09d09edbd321",
      "name": "High score",
      "type": "n8n-nodes-base.set",
      "position": [
        1792,
        368
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "760f0ae8-a358-4875-9607-37f2d827bafe",
              "name": "reason",
              "type": "string",
              "value": "Medium score"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "24816170-478f-44a4-a08f-a8a63f1941d7",
      "name": "Valid",
      "type": "n8n-nodes-base.set",
      "position": [
        1792,
        176
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "760f0ae8-a358-4875-9607-37f2d827bafe",
              "name": "reason",
              "type": "string",
              "value": "Valid"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "75693212-fdd8-45a0-ae5e-5761dbf0254b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        992
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 208,
        "content": "## \u26a1 Trigger & Verification"
      },
      "typeVersion": 1
    },
    {
      "id": "cdbc4926-62f9-4c99-a227-70d83c343b8e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        656
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 448,
        "content": "## \u2714\ufe0f Stage 1: Email Validation"
      },
      "typeVersion": 1
    },
    {
      "id": "885dbb18-24e1-466c-a1b6-0ef24565d522",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        480
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 432,
        "content": "## \ud83c\udfaf Stage 2: AI Email Scoring"
      },
      "typeVersion": 1
    },
    {
      "id": "c2f6a322-6b91-4539-9083-1ac16c47e8fd",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        112
      ],
      "parameters": {
        "color": 7,
        "width": 656,
        "height": 1568,
        "content": "## \ud83d\udce4 Output Results\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c14013d8-6294-41f2-a519-a8885a71a8ea",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        672,
        112
      ],
      "parameters": {
        "color": 7,
        "width": 518,
        "height": 288,
        "content": "![ZeroBounce Logo](https://raw.githubusercontent.com/zerobounce/n8n-nodes-zerobounce/main/icons/zb-logo-purple.svg)"
      },
      "typeVersion": 1
    },
    {
      "id": "75bf8689-e5a9-4c44-b63d-0a9a213c2fd6",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        1248
      ],
      "parameters": {
        "color": 7,
        "width": 864,
        "height": 432,
        "content": "### \ud83d\udccb Setup Requirements\n- **Shopify:** Connect via OAuth2 to watch for \"Customer Created\" events (Topic: `customers/create`).\n- **ZeroBounce:** Connect via API Key. *[Create one here](https://www.zerobounce.net/members/API)*.\n- **HubSpot:** Connect via OAuth2 to create/update contacts for high-quality leads.\n- **Google Sheets:** Connect via OAuth2 to append/update rows in a Google Sheets worksheet. Alternatively, swap these nodes out with any other data storage node e.g. **n8n Data Table** or **Microsoft Excel**. The sheets/tables can be created with the headers:\n    - *Accepted* columns:\n`ID,Email,First Name,Last Name,Accepted At,Accepted Reason,ZB Status,ZB Sub Status,ZB Free Email,ZB Did You Mean,ZB Account,ZB Domain,ZB Domain Age Days,ZB SMTP Provider,ZB MX Found,ZB MX Record,ZB Score`\n    - *Rejected* columns\n`ID,Email,First Name,Last Name,Rejected At,Rejected Reason,ZB Status,ZB Sub Status,ZB Free Email,ZB Did You Mean,ZB Account,ZB Domain,ZB Domain Age Days,ZB SMTP Provider,ZB MX Found,ZB MX Record,ZB Score`"
      },
      "typeVersion": 1
    },
    {
      "id": "dc5a17c0-586a-4023-91f7-3551a21337e9",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        816
      ],
      "parameters": {
        "color": 7,
        "width": 864,
        "height": 128,
        "content": "### \ud83d\udca1 Key Benefits\n- **\u2728 Zero-Waste Sync:** Only \"Valid\" or \"High-Scoring\" leads reach your CRM.\n- **\ud83d\udee1\ufe0f Credit Safety:** Internal checks ensure you never trigger an API call without credits.\n- **\ud83d\udcca Detailed Suppressions:** Every rejected lead is categorized by reason (e.g. Email Missing, Invalid, Low Score, or Insufficient credits)."
      },
      "typeVersion": 1
    },
    {
      "id": "f55e415a-70fe-4031-a745-9fb9204aeea7",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        992
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 208,
        "content": "### \ud83e\udde9 Nodes used in this workflow\n- [ZeroBounce](https://n8n.io/integrations/zerobounce)\n- [Shopify](https://n8n.io/integrations/shopify)\n- [Hubspot](https://n8n.io/integrations/hubspot)\n- [Google Sheets](https://n8n.io/integrations/google-sheets) (or alternative e.g. [Data Table](https://n8n.io/integrations/data-table))"
      },
      "typeVersion": 1
    },
    {
      "id": "d39d8207-7d26-435c-bbe8-959adf1960a8",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        320
      ],
      "parameters": {
        "color": 7,
        "width": 864,
        "height": 448,
        "content": "### \ud83d\ude80 How it Works\n1. **\u26a1 Trigger & Verification:** Activates on new **Shopify** customers and first checks if an email address is provided.\n    - **Email present:** Proceeds to credit check and validation\n    - **Email missing:** Customer details are added to *Rejected* output for review with reason `'Email missing'`.\n2. **\ud83d\udcb3 Credit Management:** Before each ZeroBounce call, the workflow checks your account for sufficient credits to prevent node failures. \n    - **Success:** Proceeds to Stage 1 (Validation).\n    - **Failure:** Customer details are added to *Rejected* output for retry with reason `'Not enough credits'`.\n3. **\u2714\ufe0f Stage 1: Email Validation:** Validates the email address with ZeroBounce. \n    - **Valid:** Adds the result to *Accepted* output and creates a contact in **HubSpot**.\n    - **Invalid:** Logs to an **n8n Data Table** with the validation results and a reason for rejection for review.\n    - **Catch-all:** Proceeds to Stage 2 (Scoring).\n4.  **\ud83c\udfaf Stage 2: AI Email Scoring:** For \"Catch-all\" emails, the workflow requests **ZeroBounce AI Scoring**.\n    - **High Score (>=9):** Syncs to **HubSpot**.\n    - **Medium/Low Score:** Suppressed and added to an **n8n Data Table** with the assigned score for review.\n5. **\ud83d\udce4 Output Results:**\n    - **Accepted:** Output validation and scoring results to *Accepted* and **Hubspot**\n    - **Rejected** Output validation and scoring results to *Rejected*."
      },
      "typeVersion": 1
    },
    {
      "id": "d6d71104-fcc3-4b2c-871d-a73cffe4bc54",
      "name": "Add to Rejected not validated",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2016,
        1424
      ],
      "parameters": {
        "columns": {
          "value": {
            "ID": "={{ $('Shopify customer created').item.json.id }}",
            "Email": "={{ $('Shopify customer created').item.json.email }}",
            "Last Name": "={{ $('Shopify customer created').item.json.last_name }}",
            "First Name": "={{ $('Shopify customer created').item.json.first_name }}",
            "Rejected At": "={{ $now }}",
            "Reject Reason": "={{ $json.reason }}"
          },
          "schema": [
            {
              "id": "ID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "First Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "First Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Last Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Rejected At",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Rejected At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reject Reason",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Reject Reason",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "ZB Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Sub Status",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "ZB Sub Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Free Email",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "ZB Free Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Did You Mean",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "ZB Did You Mean",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Account",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "ZB Account",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Domain",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "ZB Domain",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Domain Age Days",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "ZB Domain Age Days",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB SMTP Provider",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "ZB SMTP Provider",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB MX Found",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "ZB MX Found",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB MX Record",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "ZB MX Record",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "ZB Score",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "ZB Score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "ID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fzvQqJzYXFaPiINaQunC16t2Xe2oXs-EhCy-x4uDa6U/edit#gid=0",
          "cachedResultName": "Rejected"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1fzvQqJzYXFaPiINaQunC16t2Xe2oXs-EhCy-x4uDa6U",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1fzvQqJzYXFaPiINaQunC16t2Xe2oXs-EhCy-x4uDa6U/edit?usp=drivesdk",
          "cachedResultName": "ZeroBounce Validation"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    }
  ],
  "connections": {
    "Valid": {
      "main": [
        [
          {
            "node": "Add to Accepted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Status": {
      "main": [
        [
          {
            "node": "Valid",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check credits for scoring",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Not valid",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Low score": {
      "main": [
        [
          {
            "node": "Add to Rejected",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Not valid": {
      "main": [
        [
          {
            "node": "Add to Rejected",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has email?": {
      "main": [
        [
          {
            "node": "Check credits for validation",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Email missing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "High score": {
      "main": [
        [
          {
            "node": "Add to Accepted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Score email": {
      "main": [
        [
          {
            "node": "Filter by score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Medium score": {
      "main": [
        [
          {
            "node": "Add to Rejected",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email missing": {
      "main": [
        [
          {
            "node": "Add to Rejected not validated",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate email": {
      "main": [
        [
          {
            "node": "Status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add to Accepted": {
      "main": [
        [
          {
            "node": "Create Hubspot contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter by score": {
      "main": [
        [
          {
            "node": "High score",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Medium score",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Low score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Shopify customer created": {
      "main": [
        [
          {
            "node": "Has email?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check credits for scoring": {
      "main": [
        [
          {
            "node": "Score email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Not enough credits for scoring",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check credits for validation": {
      "main": [
        [
          {
            "node": "Validate email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Not enough credits for validation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Not enough credits for scoring": {
      "main": [
        [
          {
            "node": "Add to Rejected",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Not enough credits for validation": {
      "main": [
        [
          {
            "node": "Add to Rejected not validated",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}