{
  "name": "Lead Router \u2192 CRM (ClarioAI)",
  "nodes": [
    {
      "parameters": {
        "path": "lead-intake",
        "responseMode": "onReceived"
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// Dedupe by email, enrich, route to owner\nconst lead = $input.first().json;\nreturn [{ json: { ...lead, normalized_email: (lead.email || '').toLowerCase().trim(), routed_at: new Date().toISOString() }}];"
      },
      "name": "Normalize",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {},
      "name": "HubSpot / Pipedrive Upsert",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        680,
        300
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Normalize",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize": {
      "main": [
        [
          {
            "node": "HubSpot / Pipedrive Upsert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "source": "ClarioAI \u2014 clarioai.ca"
  }
}