{
  "name": "ControlLaunchPad - Form submission to lead (starter)",
  "active": false,
  "nodes": [
    {
      "parameters": {
        "content": "## Setup\nCreate an incoming Header Auth credential for your form sender. Create a separate Header Auth credential for CLP using Authorization as the name and Bearer followed by your key as its value. Use a clp_test_ key to preview first. Test keys save nothing. Replace it with a clp_live_ key when ready. Map the form fields and keep submissionId stable across retries. You can add stageId to the Create lead JSON to place a deal in a selected stage. Activate the workflow and use the Production URL after testing.",
        "height": 280,
        "width": 640
      },
      "id": "setup-notes",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        240,
        0
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "clp-form-lead",
        "authentication": "headerAuth",
        "options": {},
        "responseMode": "lastNode"
      },
      "id": "form-webhook",
      "name": "Form submission",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        260,
        360
      ],
      "webhookId": "clp-form-lead"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.controllaunchpad.com/api/v1/leads",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Idempotency-Key",
              "value": "={{ $json.body.submissionId }}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ firstName: $json.body.firstName, lastName: $json.body.lastName, email: $json.body.email, phone: $json.body.phone, propertyAddress: $json.body.propertyAddress, source: 'n8n form', dedupe: true }) }}",
        "options": {
          "timeout": 15000
        }
      },
      "id": "create-lead",
      "name": "Create lead",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        600,
        360
      ]
    }
  ],
  "connections": {
    "Form submission": {
      "main": [
        [
          {
            "node": "Create lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "tags": []
}
