{
  "name": "Vantra - Privacy-safe Lead Qualifier Demo",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "vantra-lead-qualifier",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "39146c35-893e-4f1f-99ec-60f6a6a61d8e",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -620,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const body = $json.body ?? $json;\nconst clean = {\n  name: String(body.name ?? '').trim(),\n  businessType: String(body.businessType ?? '').trim(),\n  monthlyMessages: Number(body.monthlyMessages ?? 0),\n  budget: Number(body.budget ?? 0),\n  timelineDays: Number(body.timelineDays ?? 30),\n  consent: body.consent === true,\n};\nreturn [{ json: clean }];"
      },
      "id": "bf5cfa0d-3cc9-4fad-ad91-d52ca1b487f2",
      "name": "Normalize Input",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -380,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const lead = $json;\nlet score = 0;\nif (lead.consent) score += 25;\nif (lead.monthlyMessages >= 300) score += 25;\nif (lead.budget >= 100) score += 25;\nif (lead.timelineDays <= 30) score += 25;\n\nlet status = 'nurture';\nif (!lead.consent) status = 'needs-consent';\nelse if (score >= 75) status = 'qualified';\nelse if (score >= 50) status = 'review';\n\nreturn [{\n  json: {\n    ok: true,\n    lead: {\n      name: lead.name || 'Anonymous',\n      businessType: lead.businessType || 'Not provided'\n    },\n    score,\n    status,\n    nextAction: status === 'qualified'\n      ? 'Route to a human sales representative.'\n      : status === 'needs-consent'\n        ? 'Request consent before follow-up.'\n        : 'Send an approved informational follow-up.'\n  }\n}];"
      },
      "id": "a0c8549a-6c83-40c7-abcb-151cbd4c4631",
      "name": "Process Request",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -120,
        0
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ $json }}",
        "options": {
          "responseCode": 200
        }
      },
      "id": "7ec4171a-a164-4e76-a5ba-0d3233c9d703",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.4,
      "position": [
        140,
        0
      ]
    },
    {
      "parameters": {
        "content": "### Test payload\n```json\n{\n  \"name\": \"Ana\",\n  \"businessType\": \"jewelry\",\n  \"monthlyMessages\": 450,\n  \"budget\": 150,\n  \"timelineDays\": 14,\n  \"consent\": true\n}\n```\n\nSend this body to the Webhook test URL.",
        "height": 300,
        "width": 360
      },
      "id": "00c19807-6fde-4274-a14f-5d71a2939268",
      "name": "How to test",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -620,
        -360
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Normalize Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Input": {
      "main": [
        [
          {
            "node": "Process Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Request": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "efedd95c-6af3-43b8-bf3d-b668b18f7673",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "tags": []
}