{
  "name": "HVACAutomate — Missed Call Text-Back (under 2 minutes)",
  "flow": [
    {
      "id": 1,
      "module": "twilio:TriggerNewCall",
      "version": 1,
      "parameters": { "account": 1, "phoneNumber": "YOUR_TWILIO_NUMBER" },
      "filter": {
        "name": "Only missed calls (no-answer or busy)",
        "conditions": [[
          { "a": "{{1.CallStatus}}", "b": "no-answer", "o": "text:equal" },
          { "a": "{{1.CallStatus}}", "b": "busy", "o": "text:equal" }
        ]],
        "type": "or"
      },
      "mapper": {},
      "metadata": {
        "designer": { "x": 0, "y": 0 },
        "notes": "Triggers when any call to your Twilio number is missed. Make sure all calls to your business number forward through Twilio first."
      }
    },
    {
      "id": 2,
      "module": "builtin:BasicFeeder",
      "version": 1,
      "parameters": { "delay": 60 },
      "mapper": {},
      "metadata": { "designer": { "x": 300, "y": 0 }, "notes": "1-minute delay — lets voicemail finish before texting" }
    },
    {
      "id": 3,
      "module": "builtin:BasicRouter",
      "version": 1,
      "parameters": {},
      "mapper": {},
      "metadata": { "designer": { "x": 600, "y": 0 } },
      "routes": [
        {
          "flow": [
            {
              "id": 4,
              "module": "twilio:ActionCreateMessage",
              "version": 1,
              "parameters": { "account": 1 },
              "filter": {
                "name": "Business hours (8am–8pm)",
                "conditions": [[{ "a": "{{toNumber(formatDate(now,'H'))}}", "b": "8", "o": "number:greaterThanOrEqual" }, { "a": "{{toNumber(formatDate(now,'H'))}}", "b": "20", "o": "number:lessThan" }]]
              },
              "mapper": {
                "to": "{{1.From}}",
                "from": "YOUR_TWILIO_NUMBER",
                "body": "Hi, this is YOUR_COMPANY. We just missed your call and wanted to make sure we got back to you right away. What can we help you with today? We'll call you back within 15 minutes."
              },
              "metadata": { "designer": { "x": 900, "y": -80 } }
            }
          ]
        },
        {
          "flow": [
            {
              "id": 5,
              "module": "twilio:ActionCreateMessage",
              "version": 1,
              "parameters": { "account": 1 },
              "filter": {
                "name": "After hours",
                "conditions": [[{ "a": "{{toNumber(formatDate(now,'H'))}}", "b": "20", "o": "number:greaterThanOrEqual" }], [{ "a": "{{toNumber(formatDate(now,'H'))}}", "b": "8", "o": "number:lessThan" }]],
                "type": "or"
              },
              "mapper": {
                "to": "{{1.From}}",
                "from": "YOUR_TWILIO_NUMBER",
                "body": "Hi, this is YOUR_COMPANY. We missed your call — our office is currently closed but we'll be back at 8am tomorrow. For HVAC emergencies, call YOUR_EMERGENCY_NUMBER. Otherwise, we'll reach out first thing in the morning!"
              },
              "metadata": { "designer": { "x": 900, "y": 80 } }
            }
          ]
        }
      ]
    }
  ],
  "metadata": {
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": false,
      "confidential": false,
      "dataloss": false,
      "dlq": false,
      "freshVariables": false
    },
    "designer": { "orphans": [] },
    "zone": "us1.make.com"
  }
}
