{
  "name": "Verify Outbound Leads with MailVeri from Apollo and Clay",
  "nodes": [
    {
      "parameters": {
        "content": "### 1. Inbound Lead Ingestion\nReceives prospect contact data from **Apollo**, **Clay**, or scraping webhooks and normalizes contact attributes.",
        "height": 340,
        "width": 380,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [180, 160],
      "id": "sticky-note-ingest",
      "name": "Sticky Note: Ingest"
    },
    {
      "parameters": {
        "content": "### 2. MailVeri Verification\nCalls MailVeri REST API (`/v1/verify-mail/`) for real-time MX, disposable, and live SMTP handshakes.\n\n*Protects sender reputation with 99% accuracy.*",
        "height": 340,
        "width": 260,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [600, 160],
      "id": "sticky-note-verify",
      "name": "Sticky Note: Verify"
    },
    {
      "parameters": {
        "content": "### 3. Deliverability Routing & Protection\n• **VALID:** Safe to email. Route directly to Instantly, Smartlead, or CRM.\n• **INVALID / RISKY:** Auto-quarantine to protect sender domain reputation.",
        "height": 520,
        "width": 540,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [880, 80],
      "id": "sticky-note-routing",
      "name": "Sticky Note: Routing"
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "lead-ingest",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [220, 280],
      "id": "1d8e6a2b-635b-4c57-a9a3-5c2f30b91e01",
      "name": "Webhook: Inbound Lead (Apollo/Clay)"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "email_assign",
              "name": "email",
              "value": "={{ $json.body.email || $json.body.mail || $json.query.email || '' }}",
              "type": "string"
            },
            {
              "id": "first_name_assign",
              "name": "first_name",
              "value": "={{ $json.body.first_name || $json.body.firstName || '' }}",
              "type": "string"
            },
            {
              "id": "company_assign",
              "name": "company",
              "value": "={{ $json.body.company || $json.body.company_name || '' }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [400, 280],
      "id": "2e9f7b3c-746c-5d68-b0b4-6d3a41c02f12",
      "name": "Set: Lead Fields"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.mailveri.com/v1/verify-mail/",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_MAILVERI_API_KEY"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"email\": \"{{ $json.email }}\"\n}",
        "options": {
          "timeout": 10000
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [640, 280],
      "id": "3f0a8c4d-857d-6e79-c1c5-7e4b52d13a23",
      "name": "MailVeri: Verify Email"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "status_check",
              "leftValue": "={{ $json.status }}",
              "rightValue": "VALID",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [920, 280],
      "id": "4a1b9d5e-968e-7f80-d2d6-8f5c63e24b34",
      "name": "If Status == VALID"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "status_log",
              "name": "delivery_action",
              "value": "ROUTE_TO_CAMPAIGN",
              "type": "string"
            },
            {
              "id": "verified_email",
              "name": "clean_email",
              "value": "={{ $('Set: Lead Fields').item.json.email }}",
              "type": "string"
            },
            {
              "id": "lead_status",
              "name": "verification_verdict",
              "value": "DELIVERABLE",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [1180, 180],
      "id": "5b2c0e6f-079f-8a91-e3e7-9a6d74f35c45",
      "name": "Deliverable: Push to Outreach"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "suppress_action",
              "name": "delivery_action",
              "value": "SUPPRESS_TO_AVOID_BOUNCE",
              "type": "string"
            },
            {
              "id": "risky_email",
              "name": "rejected_email",
              "value": "={{ $('Set: Lead Fields').item.json.email }}",
              "type": "string"
            },
            {
              "id": "rejection_reason",
              "name": "reason",
              "value": "={{ $json.status || 'UNKNOWN' }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [1180, 380],
      "id": "6c3d1f7a-180a-9b02-f4f8-0b7e85a46d56",
      "name": "Suppressed: Quarantined Lead"
    }
  ],
  "connections": {
    "Webhook: Inbound Lead (Apollo/Clay)": {
      "main": [
        [
          {
            "node": "Set: Lead Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set: Lead Fields": {
      "main": [
        [
          {
            "node": "MailVeri: Verify Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MailVeri: Verify Email": {
      "main": [
        [
          {
            "node": "If Status == VALID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Status == VALID": {
      "main": [
        [
          {
            "node": "Deliverable: Push to Outreach",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Suppressed: Quarantined Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  }
}
