{
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "webhook",
        "responseMode": "onReceived"
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "const lead = {\n  name: $json[\"body\"][\"name\"],\n  email: $json[\"body\"][\"email\"],\n  phone: $json[\"body\"][\"phone\"],\n  message: $json[\"body\"][\"message\"]\n};\n\nconst aiResponse = await $node[\"AI Model\"].run({\n  input: lead.message\n});\n\nreturn [{\n  json: {\n    ...lead,\n    classification: aiResponse.output\n  }\n}];"
      },
      "name": "Parse Lead",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        400,
        300
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "sheetId": "your-google-sheet-id",
        "range": "Hot",
        "values": "={{$json[\"classification\"] === 'hot' ? [$json[\"name\"], $json[\"email\"], $json[\"phone\"], $json[\"message\"]] : []}}"
      },
      "name": "Add to Google Sheets Hot",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        550,
        300
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "sheetId": "your-google-sheet-id",
        "range": "Neutral",
        "values": "={{$json[\"classification\"] === 'neutral' ? [$json[\"name\"], $json[\"email\"], $json[\"phone\"], $json[\"message\"]] : []}}"
      },
      "name": "Add to Google Sheets Neutral",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        550,
        400
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "sheetId": "your-google-sheet-id",
        "range": "Cold",
        "values": "={{$json[\"classification\"] === 'cold' ? [$json[\"name\"], $json[\"email\"], $json[\"phone\"], $json[\"message\"]] : []}}"
      },
      "name": "Add to Google Sheets Cold",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        550,
        500
      ]
    },
    {
      "parameters": {
        "channel": "your-slack-channel",
        "text": "Neuer heißer Lead: {{$json[\"name\"]}} - {{$json[\"email\"]}}"
      },
      "name": "Send Slack Notification",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 1,
      "position": [
        700,
        300
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Parse Lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Lead": {
      "main": [
        [
          {
            "node": "Add to Google Sheets Hot",
            "type": "main",
            "index": 0
          },
          {
            "node": "Add to Google Sheets Neutral",
            "type": "main",
            "index": 0
          },
          {
            "node": "Add to Google Sheets Cold",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Slack Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}