{
  "name": "Walk-in wait time by text (Barbershops & salons)",
  "nodes": [
    {
      "id": "d93acc7b-8d81-5381-98be-072ecc7d9e45",
      "name": "Incoming text",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "httpMethod": "POST",
        "path": "incoming-sms",
        "responseMode": "responseNode",
        "options": {}
      },
      "webhookId": "1965349a-03bf-561b-93a2-b638d1a8bb32"
    },
    {
      "id": "46261bc6-5a53-55d1-a396-31ede7e605fa",
      "name": "Config (edit me)",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        220,
        0
      ],
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "266a3b49-0094-500c-9c0b-ea615cd08b6a",
              "name": "business_name",
              "value": "YOUR BUSINESS NAME",
              "type": "string"
            },
            {
              "id": "91c7c270-9515-526e-bd60-fa8623607911",
              "name": "booking_link",
              "value": "https://YOUR-BOOKING-LINK",
              "type": "string"
            },
            {
              "id": "48ca5ea5-7930-5f81-8288-d0ac636b5b61",
              "name": "hours",
              "value": "Mon-Fri 8am-6pm",
              "type": "string"
            },
            {
              "id": "13f77f29-cda2-5cae-a711-03e91216db75",
              "name": "owner_email",
              "value": "you@example.com",
              "type": "string"
            },
            {
              "id": "fb1a5ebf-7dae-538f-b015-53640ec7fe01",
              "name": "owner_cell",
              "value": "+15555550100",
              "type": "string"
            },
            {
              "id": "3a706ab9-8846-5c81-b389-19cb282d04b0",
              "name": "twilio_number",
              "value": "+15555550199",
              "type": "string"
            },
            {
              "id": "0d836b1d-cde2-5177-ab71-4ef31850243b",
              "name": "wait_sheet_id",
              "value": "YOUR_GOOGLE_SHEET_ID",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": true,
        "options": {}
      }
    },
    {
      "id": "efa19c58-abe0-5137-b8da-2f5eac74b4a6",
      "name": "Acknowledge Twilio (text)",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        440,
        0
      ],
      "parameters": {
        "respondWith": "text",
        "responseBody": "<Response></Response>",
        "options": {
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "text/xml"
              }
            ]
          }
        }
      }
    },
    {
      "id": "b1949a1c-c02d-5a0c-b090-bf0aae8139a6",
      "name": "Read wait (text)",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        660,
        0
      ],
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "={{ $('Config (edit me)').item.json.wait_sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Wait",
          "mode": "name"
        },
        "options": {}
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "REPLACE_SHEETS_CREDENTIAL",
          "name": "Google Sheets account (placeholder)"
        }
      },
      "alwaysOutputData": true
    },
    {
      "id": "e610d09c-ba53-5aaa-a303-e93e6e2c468e",
      "name": "Owner setting the wait?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        880,
        0
      ],
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": false,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "a9c5a06f-17e8-5168-ba05-4d85d3aa01c8",
              "leftValue": "={{ $('Incoming text').item.json.body.From }}",
              "rightValue": "={{ $('Config (edit me)').item.json.owner_cell }}",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            },
            {
              "id": "bdb6acd9-90ae-5947-9ea1-94704da064e4",
              "leftValue": "={{ $('Incoming text').item.json.body.Body.trim() }}",
              "rightValue": "WAIT ",
              "operator": {
                "type": "string",
                "operation": "startsWith"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      }
    },
    {
      "id": "3266904a-900b-5391-b670-e4245225e5e7",
      "name": "Save new wait",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        1100,
        -140
      ],
      "parameters": {
        "operation": "update",
        "documentId": {
          "__rl": true,
          "value": "={{ $('Config (edit me)').item.json.wait_sheet_id }}",
          "mode": "id"
        },
        "sheetName": {
          "__rl": true,
          "value": "Wait",
          "mode": "name"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "row_key": "current",
            "current_wait": "={{ $('Incoming text').item.json.body.Body.trim().slice(5) }}",
            "updated_at": "={{ $now.toFormat('h:mm a') }}"
          },
          "matchingColumns": [
            "row_key"
          ],
          "schema": [
            {
              "id": "row_key",
              "displayName": "row_key",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "current_wait",
              "displayName": "current_wait",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "updated_at",
              "displayName": "updated_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ]
        },
        "options": {}
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "REPLACE_SHEETS_CREDENTIAL",
          "name": "Google Sheets account (placeholder)"
        }
      }
    },
    {
      "id": "16fbaf19-5d8b-5fdc-afc9-34614cb3c1aa",
      "name": "Confirm to owner",
      "type": "n8n-nodes-base.twilio",
      "typeVersion": 1,
      "position": [
        1320,
        -140
      ],
      "parameters": {
        "from": "={{ $('Config (edit me)').item.json.twilio_number }}",
        "to": "={{ $('Incoming text').item.json.body.From }}",
        "message": "=Got it. Current wait set to: {{ $('Incoming text').item.json.body.Body.trim().slice(5) }}",
        "options": {}
      },
      "credentials": {
        "twilioApi": {
          "id": "REPLACE_TWILIO_CREDENTIAL",
          "name": "Twilio account (placeholder)"
        }
      }
    },
    {
      "id": "a2af6fbf-f4be-5600-b72b-cd8e0c9e984a",
      "name": "Reply with wait time",
      "type": "n8n-nodes-base.twilio",
      "typeVersion": 1,
      "position": [
        1100,
        80
      ],
      "parameters": {
        "from": "={{ $('Config (edit me)').item.json.twilio_number }}",
        "to": "={{ $('Incoming text').item.json.body.From }}",
        "message": "=Hey! Walk-ins welcome at {{ $('Config (edit me)').item.json.business_name }}. Hours: {{ $('Config (edit me)').item.json.hours }}. Current wait: about {{ $('Read wait (text)').first().json.current_wait || 'ask us' }}. Rather book a time? {{ $('Config (edit me)').item.json.booking_link }}",
        "options": {}
      },
      "credentials": {
        "twilioApi": {
          "id": "REPLACE_TWILIO_CREDENTIAL",
          "name": "Twilio account (placeholder)"
        }
      }
    },
    {
      "id": "82e93658-85ed-5d81-aea0-462d0494223d",
      "name": "Setup steps",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -520,
        -160
      ],
      "parameters": {
        "content": "## Setup (about 45 min)\n1. Make a Google Sheet with a tab named `Wait` and columns `row_key | current_wait | updated_at`. Add one row: `current | 15 min | `.\n2. Fill in **Config (edit me)** (sheet ID is the long code in the sheet's URL).\n3. Connect your **Twilio** and **Google Sheets** credentials.\n4. In Twilio, set your number's 'A message comes in' webhook to `YOUR_N8N_URL/webhook/incoming-sms`.\n5. From the owner cell, text `WAIT 20 min` to update. Anyone else who texts gets hours + wait + booking link.\n\nUsing the missed-call workflow too? It already includes this, so use one or the other on the same number.",
        "height": 440,
        "width": 480
      }
    }
  ],
  "connections": {
    "Incoming text": {
      "main": [
        [
          {
            "node": "Config (edit me)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config (edit me)": {
      "main": [
        [
          {
            "node": "Acknowledge Twilio (text)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Acknowledge Twilio (text)": {
      "main": [
        [
          {
            "node": "Read wait (text)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read wait (text)": {
      "main": [
        [
          {
            "node": "Owner setting the wait?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Owner setting the wait?": {
      "main": [
        [
          {
            "node": "Save new wait",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Reply with wait time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save new wait": {
      "main": [
        [
          {
            "node": "Confirm to owner",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "meta": {
    "templateCredsSetupCompleted": false,
    "generatedBy": "Speed-to-Lead Playbooks"
  },
  "tags": []
}