{
  "name": "Kapzio · Nouveau prospect → Google Sheets + Slack",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "kapzio-prospects",
        "responseMode": "onReceived",
        "options": { "rawBody": true }
      },
      "id": "6b1f2c1e-1a0e-4c55-9a51-0a0b6d6f0001",
      "name": "Webhook Kapzio",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [0, 0],
      "webhookId": "kapzio-prospects"
    },
    {
      "parameters": {
        "conditions": {
          "options": { "caseSensitive": true, "leftValue": "", "typeValidation": "loose" },
          "conditions": [
            {
              "id": "c1",
              "leftValue": "={{ $json.headers['x-kapzio-event'] }}",
              "rightValue": "lead.created",
              "operator": { "type": "string", "operation": "equals" }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "6b1f2c1e-1a0e-4c55-9a51-0a0b6d6f0002",
      "name": "Nouveau prospect ?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [240, 0]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": { "__rl": true, "value": "", "mode": "list" },
        "sheetName": { "__rl": true, "value": "Prospects", "mode": "name" },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Date": "={{ $('Webhook Kapzio').item.json.body.occurred_at }}",
            "Société": "={{ $('Webhook Kapzio').item.json.body.data.lead.company_name }}",
            "Contact": "={{ $('Webhook Kapzio').item.json.body.data.lead.contact_name }}",
            "E-mail": "={{ $('Webhook Kapzio').item.json.body.data.lead.email }}",
            "Téléphone": "={{ $('Webhook Kapzio').item.json.body.data.lead.phone }}",
            "Source": "={{ $('Webhook Kapzio').item.json.body.data.lead.source }}",
            "Étape": "={{ $('Webhook Kapzio').item.json.body.data.lead.stage }}",
            "Identifiant Kapzio": "={{ $('Webhook Kapzio').item.json.body.data.lead.id }}"
          }
        },
        "options": {}
      },
      "id": "6b1f2c1e-1a0e-4c55-9a51-0a0b6d6f0003",
      "name": "Ajouter à Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [500, -100]
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": { "__rl": true, "value": "", "mode": "list" },
        "text": "=:sparkles: Nouveau prospect Kapzio : *{{ $('Webhook Kapzio').item.json.body.data.lead.company_name || $('Webhook Kapzio').item.json.body.data.lead.contact_name }}*\n{{ $('Webhook Kapzio').item.json.body.data.lead.email }} · {{ $('Webhook Kapzio').item.json.body.data.lead.phone }}\nSource : {{ $('Webhook Kapzio').item.json.body.data.lead.source }}",
        "otherOptions": {}
      },
      "id": "6b1f2c1e-1a0e-4c55-9a51-0a0b6d6f0004",
      "name": "Prévenir sur Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.2,
      "position": [500, 100]
    }
  ],
  "connections": {
    "Webhook Kapzio": { "main": [[{ "node": "Nouveau prospect ?", "type": "main", "index": 0 }]] },
    "Nouveau prospect ?": {
      "main": [
        [
          { "node": "Ajouter à Google Sheets", "type": "main", "index": 0 },
          { "node": "Prévenir sur Slack", "type": "main", "index": 0 }
        ],
        []
      ]
    }
  },
  "settings": { "executionOrder": "v1" },
  "pinData": {},
  "meta": { "templateCredsSetupCompleted": false },
  "tags": []
}
