{
  "schema_version": "1.0.0",
  "id": "calendly-cancel-rebook",
  "title": "Offer a new time when a Calendly booking is cancelled",
  "category": "booking",
  "difficulty": "beginner",
  "featured": false,
  "description": "A cancelled Calendly booking triggers a friendly rebooking email, a heads-up to the host in Slack, and a row in the cancellations log.",
  "tags": [
    "booking",
    "calendly",
    "cancellations",
    "gmail",
    "slack"
  ],
  "apps": [
    "Calendly",
    "Gmail",
    "Slack",
    "Google Sheets"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 3 steps after the trigger"
    ]
  },
  "tasks": {
    "typical": 3,
    "max": 3
  },
  "trigger": {
    "app": "Calendly",
    "event": "Invitee Canceled",
    "kind": "instant",
    "title": "Booking cancelled",
    "why": "Fires when an invitee cancels any booked event.",
    "config": {
      "Scope": "User"
    },
    "outputs": [
      "invitee_name",
      "invitee_first_name",
      "invitee_email",
      "invitee_phone",
      "event_type_name",
      "event_start_time",
      "event_end_time",
      "timezone",
      "cancel_url",
      "reschedule_url",
      "questions_and_answers"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "rebook",
      "kind": "action",
      "app": "Gmail",
      "event": "Send Email",
      "title": "Invite them to pick another time",
      "why": "A short, no-pressure email with the booking link, sent while the intent is still fresh.",
      "fields": {
        "To": "{{trigger.invitee_email}}",
        "Subject": "Want to find another time?",
        "Body Type": "plain",
        "Body": "Hi {{trigger.invitee_first_name}},\n\nNo problem about cancelling {{trigger.event_type_name}}. If you would still like to talk, you can pick any open slot here: YOUR_BOOKING_LINK\n\nIf now is not the right time, no reply needed.\n\nYOUR_NAME",
        "From Name": "YOUR_BUSINESS_NAME"
      },
      "outputs": [
        "id",
        "thread_id"
      ]
    },
    {
      "key": "host",
      "kind": "action",
      "app": "Slack",
      "event": "Send Channel Message",
      "title": "Tell the host",
      "why": "The host can reuse the freed slot or follow up personally.",
      "fields": {
        "Channel": "#bookings",
        "Message Text": ":calendar: {{trigger.invitee_name}} cancelled {{trigger.event_type_name}} on {{trigger.event_start_time}}. A rebooking email went out.",
        "Send as a bot?": "Yes",
        "Bot Name": "Zap alerts",
        "Include a link to this Zap?": "No"
      },
      "outputs": [
        "ts",
        "permalink"
      ]
    },
    {
      "key": "log",
      "kind": "action",
      "app": "Google Sheets",
      "event": "Create Spreadsheet Row",
      "title": "Log the cancellation",
      "why": "A monthly cancellation count is a filter on this sheet.",
      "fields": {
        "Drive": "My Google Drive",
        "Spreadsheet": "Bookings",
        "Worksheet": "Cancellations",
        "Columns": {
          "cancelled_at": "{{meta.human_now}}",
          "invitee": "{{trigger.invitee_name}}",
          "email": "{{trigger.invitee_email}}",
          "event_type": "{{trigger.event_type_name}}",
          "was_scheduled_for": "{{trigger.event_start_time}}",
          "answers": "{{trigger.questions_and_answers}}"
        }
      },
      "outputs": [
        "id",
        "row_number"
      ]
    }
  ]
}
