{
  "name": "HVACAutomate — Appointment Reminder Sequence (24h + 2h)",
  "flow": [
    {
      "id": 1,
      "module": "gateway:CustomWebHook",
      "version": 1,
      "parameters": { "hook": 1, "maxResults": 1 },
      "mapper": {},
      "metadata": {
        "designer": { "x": 0, "y": 0 },
        "restore": { "parameters": { "hook": { "label": "New Appointment Webhook" } } },
        "notes": "Trigger this webhook from your scheduling tool (ServiceTitan, Housecall Pro, Google Calendar) when a new appointment is booked. Send: customer_name, customer_phone, appointment_datetime (ISO 8601), tech_name"
      }
    },
    {
      "id": 2,
      "module": "builtin:BasicFeeder",
      "version": 1,
      "parameters": {},
      "mapper": { "delay": "{{formatDate(addHours(parseDate(1.appointment_datetime, 'YYYY-MM-DDTHH:mm:ss'), -24), 'X') - formatDate(now, 'X')}}" },
      "metadata": {
        "designer": { "x": 300, "y": 0 },
        "notes": "Delay until 24 hours before appointment"
      }
    },
    {
      "id": 3,
      "module": "twilio:ActionCreateMessage",
      "version": 1,
      "parameters": { "account": 1 },
      "mapper": {
        "to": "{{1.customer_phone}}",
        "from": "YOUR_TWILIO_NUMBER",
        "body": "Hi {{1.customer_name}}, just a reminder that {{1.tech_name}} from YOUR_COMPANY is scheduled to arrive tomorrow. Reply YES to confirm or call YOUR_PHONE if you need to reschedule. See you tomorrow!"
      },
      "metadata": { "designer": { "x": 600, "y": 0 } }
    },
    {
      "id": 4,
      "module": "builtin:BasicFeeder",
      "version": 1,
      "parameters": {},
      "mapper": { "delay": "{{formatDate(addHours(parseDate(1.appointment_datetime, 'YYYY-MM-DDTHH:mm:ss'), -2), 'X') - formatDate(now, 'X')}}" },
      "metadata": {
        "designer": { "x": 900, "y": 0 },
        "notes": "Delay until 2 hours before appointment"
      }
    },
    {
      "id": 5,
      "module": "twilio:ActionCreateMessage",
      "version": 1,
      "parameters": { "account": 1 },
      "mapper": {
        "to": "{{1.customer_phone}}",
        "from": "YOUR_TWILIO_NUMBER",
        "body": "Hey {{1.customer_name}}, {{1.tech_name}} is on his way and should arrive around YOUR_ETA_TIME. Call us at YOUR_PHONE if anything comes up. See you soon!"
      },
      "metadata": { "designer": { "x": 1200, "y": 0 } }
    }
  ],
  "metadata": {
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": true,
      "confidential": false,
      "dataloss": false,
      "dlq": false,
      "freshVariables": false
    },
    "designer": { "orphans": [] },
    "zone": "us1.make.com"
  }
}
