{
  "name": "Verifly Signup Email Gate",
  "nodes": [
    {
      "parameters": {
        "path": "verifly-signup-gate",
        "httpMethod": "POST",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "Webhook",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [260, 240]
    },
    {
      "parameters": {
        "url": "=https://verifly.email/api/v1/verify?email={{ encodeURIComponent($json.body.email) }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer {{$env.VERIFLY_API_KEY}}"
            }
          ]
        }
      },
      "id": "VerifyEmail",
      "name": "Verify email with Verifly",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [500, 240]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "leftValue": "={{ $json.result || $json.status || $json.deliverability }}",
              "rightValue": "deliverable",
              "operator": {
                "type": "string",
                "operation": "contains"
              }
            }
          ],
          "combinator": "or"
        },
        "options": {}
      },
      "id": "GoodEnough",
      "name": "Deliverable enough?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [740, 240]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { allowed: true, verification: $json } }}"
      },
      "id": "Allow",
      "name": "Allow",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [980, 140]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ { allowed: false, verification: $json } }}"
      },
      "id": "Review",
      "name": "Review",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [980, 340]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [[{ "node": "Verify email with Verifly", "type": "main", "index": 0 }]]
    },
    "Verify email with Verifly": {
      "main": [[{ "node": "Deliverable enough?", "type": "main", "index": 0 }]]
    },
    "Deliverable enough?": {
      "main": [
        [{ "node": "Allow", "type": "main", "index": 0 }],
        [{ "node": "Review", "type": "main", "index": 0 }]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}
