{
  "name": "Luda AI Starter Pack - Submission Logger",
  "nodes": [
    {
      "parameters": {
        "content": "## Submission Logger\n\nLogs every form submission as a new row in a Google Sheet automatically.\n\n**Before you activate:**\n1. Create a Google Sheet first, with a header row matching the columns you want: name, email, message, submittedAt (or your own names).\n2. Point your form tool at this webhook's Production URL (same setup as the Lead Notifier).\n3. In the 'Log to Sheet' node, select your spreadsheet and sheet tab.\n4. Submit one test entry and confirm the row lands correctly.\n\nIf you add a new field to your form later, you have to add a matching column in the sheet yourself and update the 'Format Submission' node. The sheet will not grow a new column on its own.",
        "height": 340,
        "width": 380
      },
      "id": "sticky-1",
      "name": "Setup Notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-380, -180]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "submission-logger",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "node-webhook",
      "name": "Form Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [-160, 0],
      "webhookId": "submission-logger"
    },
    {
      "parameters": {
        "mode": "manual",
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "name",
              "value": "={{ $json.body.name || $json.body.Name || '' }}",
              "type": "string"
            },
            {
              "id": "2",
              "name": "email",
              "value": "={{ $json.body.email || $json.body.Email || '' }}",
              "type": "string"
            },
            {
              "id": "3",
              "name": "message",
              "value": "={{ $json.body.message || $json.body.Message || '' }}",
              "type": "string"
            },
            {
              "id": "4",
              "name": "submittedAt",
              "value": "={{ $now.toISO() }}",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": false
      },
      "id": "node-set",
      "name": "Format Submission",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [60, 0]
    },
    {
      "parameters": {
        "resource": "sheet",
        "operation": "append",
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "",
          "cachedResultName": "Your submissions sheet"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {},
          "schema": [
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "email",
              "displayName": "email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false
            },
            {
              "id": "message",
              "displayName": "message",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false
            },
            {
              "id": "submittedAt",
              "displayName": "submittedAt",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": false
            }
          ]
        },
        "options": {}
      },
      "id": "node-sheets",
      "name": "Log to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [300, 0],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "REPLACE_WITH_YOUR_CREDENTIAL_ID",
          "name": "Your Google Sheets account"
        }
      }
    }
  ],
  "connections": {
    "Form Webhook": {
      "main": [
        [
          {
            "node": "Format Submission",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Submission": {
      "main": [
        [
          {
            "node": "Log to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  }
}
