{
  "name": "LEVRYO - Website Form to Slack and Google Sheets",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "website-lead",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "webhook-in",
      "name": "Website Form Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [0, 0],
      "notes": "Point your form's POST action (or a form plugin's webhook setting) at this node's production URL. Send JSON or form-encoded fields named name, email, phone, message."
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            { "id": "w1", "name": "name", "value": "={{ $json.body.name || $json.body.full_name || '' }}", "type": "string" },
            { "id": "w2", "name": "email", "value": "={{ $json.body.email || '' }}", "type": "string" },
            { "id": "w3", "name": "phone", "value": "={{ $json.body.phone || '' }}", "type": "string" },
            { "id": "w4", "name": "message", "value": "={{ $json.body.message || '' }}", "type": "string" },
            { "id": "w5", "name": "page", "value": "={{ $json.headers.referer || '' }}", "type": "string" },
            { "id": "w6", "name": "received_at", "value": "={{ $now.toISO() }}", "type": "string" }
          ]
        },
        "options": {}
      },
      "id": "map-fields",
      "name": "Map Form Fields",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [240, 0],
      "notes": "If your form uses different field names, change the expressions on the right. The names on the left become the sheet columns."
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": { "__rl": true, "mode": "list", "value": "" },
        "sheetName": { "__rl": true, "mode": "list", "value": "" },
        "columns": { "mappingMode": "autoMapInputData", "value": {}, "matchingColumns": [], "schema": [] },
        "options": {}
      },
      "id": "sheets-append",
      "name": "Log Lead to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [480, 0],
      "notes": "Create a sheet with these header cells in row 1: name, email, phone, message, page, received_at."
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": { "__rl": true, "mode": "name", "value": "#leads" },
        "text": "=New website lead\nName: {{ $('Map Form Fields').item.json.name }}\nEmail: {{ $('Map Form Fields').item.json.email }}\nPhone: {{ $('Map Form Fields').item.json.phone }}\nMessage: {{ $('Map Form Fields').item.json.message }}",
        "otherOptions": {}
      },
      "id": "slack-alert",
      "name": "Slack Alert",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.2,
      "position": [720, 0],
      "notes": "Change #leads to your channel."
    }
  ],
  "connections": {
    "Website Form Webhook": { "main": [[{ "node": "Map Form Fields", "type": "main", "index": 0 }]] },
    "Map Form Fields": { "main": [[{ "node": "Log Lead to Sheet", "type": "main", "index": 0 }]] },
    "Log Lead to Sheet": { "main": [[{ "node": "Slack Alert", "type": "main", "index": 0 }]] }
  },
  "settings": { "executionOrder": "v1" },
  "meta": { "templateCredsSetupCompleted": false },
  "tags": []
}
