Automation Workflows

Build automated workflows that chain FrontDeskOS tools together to handle common front desk scenarios without manual intervention.

Overview

FrontDeskOS automations let you define workflows that trigger on specific events and execute a series of tool calls automatically. Common use cases include post-call follow-ups, appointment reminders, lead nurturing sequences, and daily reporting.

Missed Call Follow-Up

Automatically create a callback and send an SMS when a call is missed:

missed-call-automation.tstypescript
import { FrontDeskAutomation } from "@frontdeskos/mcp-server";

const missedCallFollowUp = new FrontDeskAutomation({
  name: "Missed Call Follow-Up",
  trigger: {
    event: "call.missed",
    conditions: {
      // Only during business hours (after-hours handled separately)
      during_hours: true,
    },
  },
  steps: [
    {
      tool: "frontdesk_create_callback",
      args: (event) => ({
        phone: event.data.caller_phone,
        caller_name: event.data.caller_name,
        reason: "Missed call - return call ASAP",
        priority: "high",
      }),
    },
    {
      tool: "frontdesk_create_lead",
      args: (event) => ({
        name: event.data.caller_name || "Unknown Caller",
        phone: event.data.caller_phone,
        source: "call",
        notes: "Missed call - needs follow-up",
      }),
      // Only create lead if caller is not an existing patient
      condition: (event) => !event.data.is_existing_patient,
    },
  ],
});

Appointment Reminders

Send automated reminders 24 hours and 2 hours before appointments:

appointment-reminders.tstypescript
const appointmentReminder = new FrontDeskAutomation({
  name: "Appointment Reminder",
  trigger: {
    schedule: "0 8 * * *", // Run daily at 8 AM
  },
  steps: [
    {
      // Get tomorrow's appointments
      tool: "frontdesk_list_appointments",
      args: () => {
        const tomorrow = new Date();
        tomorrow.setDate(tomorrow.getDate() + 1);
        return {
          date: tomorrow.toISOString().split("T")[0],
          status: "scheduled",
        };
      },
    },
    {
      // Send reminder for each appointment
      tool: "frontdesk_send_reminder",
      forEach: "previous.appointments",
      args: (appointment) => ({
        appointment_id: appointment.id,
        channel: "sms",
        message: `Reminder: You have an appointment tomorrow at ${appointment.time} with ${appointment.staff_name}. Reply C to confirm or R to reschedule.`,
      }),
    },
  ],
});

Lead Nurturing Sequence

Automatically follow up with new leads that haven't booked within 48 hours:

lead-nurture.tstypescript
const leadNurture = new FrontDeskAutomation({
  name: "Lead Nurture - 48hr Follow-up",
  trigger: {
    schedule: "0 10 * * *", // Run daily at 10 AM
  },
  steps: [
    {
      tool: "frontdesk_list_leads",
      args: () => ({
        status: "new",
        sort: "newest",
        limit: 50,
      }),
    },
    {
      // Filter to leads created 48+ hours ago
      tool: "frontdesk_score_lead",
      forEach: "previous.leads",
      condition: (lead) => {
        const hoursSinceCreated =
          (Date.now() - new Date(lead.created_at).getTime()) / 3600000;
        return hoursSinceCreated >= 48 && hoursSinceCreated < 72;
      },
      args: (lead) => ({
        lead_id: lead.id,
      }),
    },
    {
      // Create follow-up callbacks for high-score leads
      tool: "frontdesk_create_callback",
      forEach: "previous.results",
      condition: (result) => result.score >= 60,
      args: (result) => ({
        phone: result.phone,
        caller_name: result.name,
        reason: `Lead follow-up (score: ${result.score}). Interest: ${result.service_interest}`,
        priority: result.score >= 80 ? "high" : "normal",
      }),
    },
  ],
});

Daily Report Generation

daily-report.tstypescript
const dailyReport = new FrontDeskAutomation({
  name: "End of Day Report",
  trigger: {
    schedule: "0 18 * * 1-5", // 6 PM, weekdays
  },
  steps: [
    {
      tool: "frontdesk_call_analytics",
      args: () => ({
        date_from: new Date().toISOString().split("T")[0],
        date_to: new Date().toISOString().split("T")[0],
      }),
    },
    {
      tool: "frontdesk_booking_stats",
      args: () => ({
        date_from: new Date().toISOString().split("T")[0],
        date_to: new Date().toISOString().split("T")[0],
      }),
    },
    {
      tool: "frontdesk_lead_report",
      args: () => ({
        date_from: new Date().toISOString().split("T")[0],
        date_to: new Date().toISOString().split("T")[0],
      }),
    },
  ],
  // Send compiled report via webhook
  onComplete: {
    webhook: "https://yourapp.com/reports/daily",
  },
});
Testing Automations
Use the FrontDeskOS dashboard to test automations with simulated events before enabling them in production. Each automation has a "Test Run" button that executes the workflow with sample data.

Registering Automations

Register all automationstypescript
import { FrontDeskMCPServer } from "@frontdeskos/mcp-server";

const server = new FrontDeskMCPServer({
  apiKey: process.env.FRONTDESK_API_KEY!,
  workspaceId: process.env.FRONTDESK_WORKSPACE_ID!,
});

// Register automations
server.registerAutomation(missedCallFollowUp);
server.registerAutomation(appointmentReminder);
server.registerAutomation(leadNurture);
server.registerAutomation(dailyReport);

await server.start();
console.log("FrontDeskOS running with 4 automations");

Search Documentation

Search for pages, tools, and guides