{
  "name": "AI Lead Qualifier",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "new-lead"
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "model": "gpt-4",
        "messages": {
          "values": [
            {
              "content": "Score this lead 1-10 based on urgency and fit:\nName: {{$json.name}}\nEmail: {{$json.email}}\nMessage: {{$json.message}}\nCompany: {{$json.company}}\n\nRespond with JSON: {score: 1-10, reason: \"brief reason\", priority: \"high/medium/low\"}"
            }
          ]
        }
      },
      "name": "AI Score",
      "type": "n8n-nodes-base.openAi",
      "position": [
        500,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "number": [
            {
              "value1": "={{$json.score}}",
              "operation": "largerEqual",
              "value2": 7
            }
          ]
        }
      },
      "name": "Route by Score",
      "type": "n8n-nodes-base.if",
      "position": [
        750,
        300
      ]
    },
    {
      "parameters": {
        "channel": "#high-priority-leads",
        "text": "\ud83d\udd25 HIGH PRIORITY LEAD\nName: {{$json.name}}\nScore: {{$json.score}}/10\nReason: {{$json.reason}}\nMessage: {{$json.message}}"
      },
      "name": "Slack Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        1000,
        200
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "AI Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Score": {
      "main": [
        [
          {
            "node": "Route by Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Score": {
      "main": [
        [
          {
            "node": "Slack Alert",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    }
  }
}