{
  "name": "Gary Club — Form → Contact + Welcome SMS",
  "nodes": [
    {
      "parameters": {
        "content": "## ⚡ After import — 3 steps\n\n**1. Bind your credential**\nClick **Upsert Contact** AND **Send Welcome SMS** — both need **Credential for Header Auth** set to your Gary Club Agency key.\n\n**2. Copy your webhook URL**\nClick the **Form Webhook** node. Copy the **Production URL** and use it as your form's POST target.\n\n**3. Edit the welcome message**\nOpen **Welcome Message** and update `body` to your actual welcome text. The `to` field auto-populates from the form's `phone` field.\n\n📋 **Notes**\n- Contact upsert is idempotent — re-submissions update the existing record.\n- If your form doesn't collect `phone`, remove the **Send Welcome SMS** node (or the workflow will error on a missing `to`).\n- Add a `contact_id` to the SMS body once the contact is created: reference `{{ $('Upsert Contact').item.json.id }}` from the Send SMS node.\n\n📚 Docs: https://docs.gary.club/api/contacts | https://docs.gary.club/api/sms",
        "height": 400,
        "width": 400,
        "color": 5
      },
      "id": "33000000-0000-4000-8000-000000000000",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-220, 80]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "gary-form-lead",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "33000000-0001-4000-8000-000000000001",
      "name": "Form Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [260, 300],
      "webhookId": "33000000-webhook-4000-8000-000000000001"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://agency.gary.club/api/public/v1/crm/contacts",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            { "name": "email", "value": "={{ $json.body.email }}" },
            { "name": "first_name", "value": "={{ $json.body.first_name }}" },
            { "name": "last_name", "value": "={{ $json.body.last_name }}" },
            { "name": "phone", "value": "={{ $json.body.phone }}" },
            { "name": "source", "value": "web_form" }
          ]
        },
        "options": {}
      },
      "id": "33000000-0002-4000-8000-000000000002",
      "name": "Upsert Contact",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [500, 300]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            { "id": "f1", "name": "to", "value": "={{ $('Form Webhook').item.json.body.phone }}", "type": "string" },
            { "id": "f2", "name": "contact_id", "value": "={{ $json.id }}", "type": "string" },
            { "id": "f3", "name": "body", "value": "={{ 'Hi ' + $('Form Webhook').item.json.body.first_name + \"! Thanks for reaching out — we'll be in touch shortly. Reply STOP to opt out.\" }}", "type": "string" }
          ]
        },
        "options": {}
      },
      "id": "33000000-0003-4000-8000-000000000003",
      "name": "Welcome Message",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [740, 300]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://agency.gary.club/api/public/v1/sms/messages",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            { "name": "to", "value": "={{ $json.to }}" },
            { "name": "body", "value": "={{ $json.body }}" },
            { "name": "contact_id", "value": "={{ $json.contact_id }}" }
          ]
        },
        "options": {}
      },
      "id": "33000000-0004-4000-8000-000000000004",
      "name": "Send Welcome SMS",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [980, 300]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify({ ok: true }) }}",
        "options": { "responseCode": 200 }
      },
      "id": "33000000-0005-4000-8000-000000000005",
      "name": "Respond 200",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [1220, 300]
    }
  ],
  "connections": {
    "Form Webhook": { "main": [[{ "node": "Upsert Contact", "type": "main", "index": 0 }]] },
    "Upsert Contact": { "main": [[{ "node": "Welcome Message", "type": "main", "index": 0 }]] },
    "Welcome Message": { "main": [[{ "node": "Send Welcome SMS", "type": "main", "index": 0 }]] },
    "Send Welcome SMS": { "main": [[{ "node": "Respond 200", "type": "main", "index": 0 }]] }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "tags": [{ "name": "gary-club-api" }]
}
