Create Automation

Build workflow automations that fire on specific triggers and execute a sequence of actions.

frontdesk_create_automation

Create a new automation rule with a trigger event, optional conditions to filter when the automation runs, and one or more actions to execute. Automations are active by default.

POSTtools/frontdesk_create_automation
ParameterTypeDescription
namerequiredstringA descriptive name for the automation.
triggerrequiredstringThe event that fires the automation. See trigger events table below.
conditionsarrayArray of condition objects that must all be true for the automation to run. Each object has field, operator, and value.
actionsrequiredarrayArray of action objects to execute in order. Each object has type and a config object specific to the action type.
activebooleanWhether the automation is enabled.Default: true

Trigger Events

The trigger determines when the automation fires. Each trigger provides context data that can be used in conditions and action templates.

ParameterTypeDescription
call.endedtriggerFires when a call completes. Provides call duration, status, summary, and caller info.
call.missedtriggerFires when a call is missed or unanswered. Provides caller phone and timestamp.
call.receivedtriggerFires when an inbound call is received (before it ends).
lead.createdtriggerFires when a new lead is created in the system.
lead.status_changedtriggerFires when a lead's status transitions (e.g., new to qualified). Provides old and new status.
lead.score_changedtriggerFires when a lead's score is updated. Provides old and new score values.
appointment.bookedtriggerFires when a new appointment is scheduled.
appointment.cancelledtriggerFires when an appointment is cancelled.
appointment.upcomingtriggerFires a configurable time before an appointment starts (default: 1 hour).
appointment.completedtriggerFires when an appointment is marked as completed.
schedule.dailytriggerFires once per day at a configured time. Useful for daily reports and digests.
schedule.weeklytriggerFires once per week on a configured day and time.

Condition Operators

Conditions filter when the automation executes. All conditions must evaluate to true (AND logic). Each condition has a field, operator, and value.

ParameterTypeDescription
equalsoperatorExact match. Works with strings and numbers.
not_equalsoperatorNegated exact match.
greater_thanoperatorNumeric comparison. The field value must be greater than the condition value.
less_thanoperatorNumeric comparison. The field value must be less than the condition value.
inoperatorField value must be one of the values in the provided array.
not_inoperatorField value must not be any of the values in the provided array.
containsoperatorString contains check. Case-insensitive.
starts_withoperatorString prefix check. Case-insensitive.

Action Types

Actions are executed sequentially in the order they are defined. Each action has a type and a config object with type-specific parameters.

ParameterTypeDescription
send_smsactionSend an SMS message. Config: to (phone number, defaults to trigger contact), message (text body) or template (template ID).
send_emailactionSend an email. Config: to (email address), subject (string), body (HTML string) or template (template ID).
send_slackactionPost a message to Slack. Config: channel (channel name or ID), message (text body with optional template variables).
create_leadactionCreate a new lead record. Config: name, phone, email, source, and any custom fields.
update_leadactionUpdate an existing lead. Config: lead_id (or use trigger context), fields object with key-value pairs to update.
create_callbackactionSchedule a callback. Config: phone (defaults to trigger contact), priority (low, normal, high), notes.
book_appointmentactionBook an appointment. Config: lead_id, datetime, duration_minutes, type, notes.
http_requestactionMake an HTTP request to an external service. Config: url (required), method (GET, POST, PUT, DELETE), headers (object), body (object or string).
delayactionPause execution before the next action. Config: duration (number), unit (seconds, minutes, hours, days).
score_leadactionAdjust a lead's score. Config: lead_id (or use trigger context), adjustment (number, positive or negative), reason (string).
assign_agentactionAssign a lead or call to an agent. Config: agent_id (or 'auto' for round-robin), reason (string).

Template Variables

Use template variables in action configs to reference trigger context data. Variables are wrapped in double curly braces and resolved at execution time.

ParameterTypeDescription
{{lead.name}}stringThe full name of the lead associated with the trigger event.
{{lead.phone}}stringThe phone number of the lead.
{{call.duration}}numberThe call duration in seconds (available on call triggers).
{{call.summary}}stringAI-generated summary of the call (available on call.ended).
{{appointment.date}}stringThe date and time of the appointment (ISO 8601 format).
{{business.name}}stringYour business name as configured in settings.
{{business.phone}}stringYour business phone number.
Template Variable Resolution
Variables that cannot be resolved (e.g., using a call variable on a lead trigger) will be replaced with an empty string. Check your trigger type to ensure the variables you use are available.

Examples

Missed Call Follow-Up

Automatically send an SMS to the caller and notify your team on Slack when a call is missed.

Missed Call Follow-Uptypescript
const result = await mcp.callTool("frontdesk_create_automation", {
  name: "Missed call SMS + Slack alert",
  trigger: "call.missed",
  conditions: [],
  actions: [
    {
      type: "send_sms",
      config: {
        to: "{{lead.phone}}",
        message: "Hi {{lead.name}}, we missed your call to {{business.name}}. We'll call you back shortly, or call us at {{business.phone}}."
      }
    },
    {
      type: "send_slack",
      config: {
        channel: "#missed-calls",
        message: "Missed call from {{lead.name}} ({{lead.phone}}). SMS follow-up sent automatically."
      }
    }
  ]
});

Hot Lead Fast Track

When a lead score crosses a threshold, automatically assign an agent, book a callback, and notify the sales channel.

Hot Lead Fast Tracktypescript
const result = await mcp.callTool("frontdesk_create_automation", {
  name: "Hot lead fast track",
  trigger: "lead.score_changed",
  conditions: [
    { field: "new_score", operator: "greater_than", value: "80" },
    { field: "status", operator: "not_in", value: ["converted", "disqualified"] }
  ],
  actions: [
    {
      type: "score_lead",
      config: {
        adjustment: 10,
        reason: "Auto-boosted: score crossed hot threshold"
      }
    },
    {
      type: "assign_agent",
      config: {
        agent_id: "auto",
        reason: "Hot lead auto-assignment"
      }
    },
    {
      type: "create_callback",
      config: {
        priority: "high",
        notes: "Hot lead (score > 80) - call within 5 minutes"
      }
    },
    {
      type: "send_slack",
      config: {
        channel: "#sales-alerts",
        message: "Hot lead alert: {{lead.name}} ({{lead.phone}}) score is now above 80. Agent assigned and callback scheduled."
      }
    }
  ]
});

Appointment Reminder Sequence

Send a reminder SMS when an appointment is upcoming, with a delay before a second confirmation message.

Appointment Reminder Sequencetypescript
const result = await mcp.callTool("frontdesk_create_automation", {
  name: "Appointment reminder sequence",
  trigger: "appointment.upcoming",
  conditions: [],
  actions: [
    {
      type: "send_sms",
      config: {
        to: "{{lead.phone}}",
        message: "Reminder: You have an appointment with {{business.name}} on {{appointment.date}}. Reply CONFIRM to confirm or CANCEL to reschedule."
      }
    },
    {
      type: "delay",
      config: {
        duration: 30,
        unit: "minutes"
      }
    },
    {
      type: "send_sms",
      config: {
        to: "{{lead.phone}}",
        message: "Your appointment with {{business.name}} is coming up soon at {{appointment.date}}. See you there!"
      }
    }
  ]
});

Response

Response
200 OK
{
  "automation": {
    "id": "auto_01abc",
    "name": "Missed call SMS + Slack alert",
    "trigger": "call.missed",
    "conditions": [],
    "actions": [
      {
        "type": "send_sms",
        "config": {
          "to": "{{lead.phone}}",
          "message": "Hi {{lead.name}}, we missed your call to {{business.name}}. We'll call you back shortly, or call us at {{business.phone}}."
        }
      },
      {
        "type": "send_slack",
        "config": {
          "channel": "#missed-calls",
          "message": "Missed call from {{lead.name}} ({{lead.phone}}). SMS follow-up sent automatically."
        }
      }
    ],
    "active": true,
    "created_at": "2025-01-15T10:00:00Z",
    "updated_at": "2025-01-15T10:00:00Z"
  }
}

Search Documentation

Search for pages, tools, and guides