{
  "name": "Gary Club — Inbound SMS Auto-Reply",
  "nodes": [
    {
      "parameters": {
        "content": "## ⚡ After import — 3 steps\n\n**1. Bind your credential**\nClick the **Reply SMS** node → set **Credential for Header Auth** to your Gary Club Agency key.\n\n**2. Register this webhook in Gary Club**\nCopy the **Production URL** from the **SMS Received** node. In your Gary Club dashboard → Settings → Webhooks → add the URL for the `sms.received` event.\n\n**3. Customize your reply**\nEdit the **Auto-Reply** node:\n- Update the `to` expression if your field name differs.\n- Edit `body` to your actual reply text.\n- Add more IF branches for other keywords (HOURS, PRICING, BOOK, etc.).\n\n📋 **Notes**\n- The `body` field in the webhook payload is the raw SMS text the contact sent.\n- The `from` field is the contact's phone number (E.164 format).\n- Always include opt-out language and confirm `data.to` is your sending number.\n- Chain additional IF → SMS nodes to handle multiple keywords.\n\n📚 Docs: https://docs.gary.club/api/sms | https://docs.gary.club/api/webhooks",
        "height": 430,
        "width": 400,
        "color": 5
      },
      "id": "44000000-0000-4000-8000-000000000000",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-220, 60]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "gary-sms-received",
        "responseMode": "lastNode",
        "options": {}
      },
      "id": "44000000-0001-4000-8000-000000000001",
      "name": "SMS Received",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [260, 300],
      "webhookId": "44000000-webhook-4000-8000-000000000001"
    },
    {
      "parameters": {
        "conditions": {
          "options": { "caseSensitive": false, "leftValue": "", "typeValidation": "loose" },
          "conditions": [
            {
              "id": "c1",
              "leftValue": "={{ $json.body.data.body }}",
              "rightValue": "HELP",
              "operator": { "type": "string", "operation": "contains" }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "44000000-0002-4000-8000-000000000002",
      "name": "Keyword Filter",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [500, 300]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            { "id": "f1", "name": "to", "value": "={{ $('SMS Received').item.json.body.data.from }}", "type": "string" },
            { "id": "f2", "name": "body", "value": "Thanks for reaching out! Our team is available Mon–Fri 9am–5pm. Reply STOP to opt out.", "type": "string" },
            { "id": "f3", "name": "contact_id", "value": "={{ $('SMS Received').item.json.body.data.contact_id }}", "type": "string" }
          ]
        },
        "options": {}
      },
      "id": "44000000-0003-4000-8000-000000000003",
      "name": "Auto-Reply",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [740, 200]
    },
    {
      "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": "44000000-0004-4000-8000-000000000004",
      "name": "Reply SMS",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [980, 200]
    }
  ],
  "connections": {
    "SMS Received": { "main": [[{ "node": "Keyword Filter", "type": "main", "index": 0 }]] },
    "Keyword Filter": {
      "main": [
        [{ "node": "Auto-Reply", "type": "main", "index": 0 }],
        []
      ]
    },
    "Auto-Reply": { "main": [[{ "node": "Reply SMS", "type": "main", "index": 0 }]] }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "tags": [{ "name": "gary-club-api" }]
}
