{
  "schema_version": "1.0.0",
  "id": "quote-request-callback",
  "title": "Book a callback slot for every quote request",
  "category": "speed-to-lead",
  "difficulty": "intermediate",
  "featured": false,
  "description": "A Jotform quote request texts the rep on duty and puts a 15-minute callback on the shared calendar, then logs the promise.",
  "tags": [
    "speed-to-lead",
    "jotform",
    "twilio",
    "google-calendar",
    "callbacks"
  ],
  "apps": [
    "Jotform",
    "Code by Zapier",
    "Twilio",
    "Google Calendar",
    "Google Sheets"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 4 steps after the trigger"
    ]
  },
  "tasks": {
    "typical": 4,
    "max": 4
  },
  "trigger": {
    "app": "Jotform",
    "event": "New Submission",
    "kind": "instant",
    "title": "New quote request",
    "why": "Jotform pushes each submission to Zapier as soon as it is sent.",
    "config": {
      "Form": "Quote request"
    },
    "outputs": [
      "submission_id",
      "created_at",
      "name",
      "email",
      "phone",
      "service",
      "postcode",
      "best_time"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "phone",
      "kind": "code",
      "app": "Code by Zapier",
      "event": "Run JavaScript",
      "title": "Format the phone number",
      "why": "The rep gets a number they can tap to dial.",
      "code": {
        "language": "javascript",
        "module": "normalize-phone",
        "file": "code/normalize-phone.js"
      },
      "input_data": {
        "phone": "{{trigger.phone}}",
        "default_country": "44"
      },
      "outputs": [
        "e164",
        "valid",
        "extension"
      ]
    },
    {
      "key": "rep",
      "kind": "action",
      "app": "Twilio",
      "event": "Send SMS",
      "title": "Text the rep on duty",
      "why": "One text with name, service, and number. The rep number is the on-call phone, not a personal one.",
      "fields": {
        "From Number": "YOUR_TWILIO_NUMBER",
        "To Number": "YOUR_ON_CALL_NUMBER",
        "Message": "Quote request: {{trigger.name}}, {{trigger.service}} in {{trigger.postcode}}. Best time: {{trigger.best_time}}. Call {{phone.e164}}. Callback is on the calendar.",
        "Send Large Messages?": "No"
      },
      "outputs": [
        "sid",
        "status"
      ]
    },
    {
      "key": "slot",
      "kind": "action",
      "app": "Google Calendar",
      "event": "Quick Add Event",
      "title": "Put the callback on the calendar",
      "why": "Quick Add reads plain English, so \"in 15 minutes\" becomes a real slot the whole team can see.",
      "fields": {
        "Calendar": "Sales callbacks",
        "Describe Event": "Call back {{trigger.name}} about {{trigger.service}} ({{phone.e164}}) in 15 minutes for 15 minutes"
      },
      "outputs": [
        "id",
        "html_link",
        "start_date_time"
      ]
    },
    {
      "key": "log",
      "kind": "action",
      "app": "Google Sheets",
      "event": "Create Spreadsheet Row",
      "title": "Log the promise",
      "why": "The sheet is the callback audit trail: request time, slot time, and a column the rep fills in after the call.",
      "fields": {
        "Drive": "My Google Drive",
        "Spreadsheet": "Sales",
        "Worksheet": "Callbacks",
        "Columns": {
          "requested_at": "{{trigger.created_at}}",
          "name": "{{trigger.name}}",
          "phone": "{{phone.e164}}",
          "service": "{{trigger.service}}",
          "postcode": "{{trigger.postcode}}",
          "callback_at": "{{slot.start_date_time}}",
          "calendar_link": "{{slot.html_link}}",
          "outcome": ""
        }
      },
      "outputs": [
        "id",
        "row_number"
      ]
    }
  ]
}
