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.
tools/frontdesk_create_automation| Parameter | Type | Description |
|---|---|---|
namerequired | string | A descriptive name for the automation. |
triggerrequired | string | The event that fires the automation. See trigger events table below. |
conditions | array | Array of condition objects that must all be true for the automation to run. Each object has field, operator, and value. |
actionsrequired | array | Array of action objects to execute in order. Each object has type and a config object specific to the action type. |
active | boolean | Whether 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.
| Parameter | Type | Description |
|---|---|---|
call.ended | trigger | Fires when a call completes. Provides call duration, status, summary, and caller info. |
call.missed | trigger | Fires when a call is missed or unanswered. Provides caller phone and timestamp. |
call.received | trigger | Fires when an inbound call is received (before it ends). |
lead.created | trigger | Fires when a new lead is created in the system. |
lead.status_changed | trigger | Fires when a lead's status transitions (e.g., new to qualified). Provides old and new status. |
lead.score_changed | trigger | Fires when a lead's score is updated. Provides old and new score values. |
appointment.booked | trigger | Fires when a new appointment is scheduled. |
appointment.cancelled | trigger | Fires when an appointment is cancelled. |
appointment.upcoming | trigger | Fires a configurable time before an appointment starts (default: 1 hour). |
appointment.completed | trigger | Fires when an appointment is marked as completed. |
schedule.daily | trigger | Fires once per day at a configured time. Useful for daily reports and digests. |
schedule.weekly | trigger | Fires 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.
| Parameter | Type | Description |
|---|---|---|
equals | operator | Exact match. Works with strings and numbers. |
not_equals | operator | Negated exact match. |
greater_than | operator | Numeric comparison. The field value must be greater than the condition value. |
less_than | operator | Numeric comparison. The field value must be less than the condition value. |
in | operator | Field value must be one of the values in the provided array. |
not_in | operator | Field value must not be any of the values in the provided array. |
contains | operator | String contains check. Case-insensitive. |
starts_with | operator | String 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.
| Parameter | Type | Description |
|---|---|---|
send_sms | action | Send an SMS message. Config: to (phone number, defaults to trigger contact), message (text body) or template (template ID). |
send_email | action | Send an email. Config: to (email address), subject (string), body (HTML string) or template (template ID). |
send_slack | action | Post a message to Slack. Config: channel (channel name or ID), message (text body with optional template variables). |
create_lead | action | Create a new lead record. Config: name, phone, email, source, and any custom fields. |
update_lead | action | Update an existing lead. Config: lead_id (or use trigger context), fields object with key-value pairs to update. |
create_callback | action | Schedule a callback. Config: phone (defaults to trigger contact), priority (low, normal, high), notes. |
book_appointment | action | Book an appointment. Config: lead_id, datetime, duration_minutes, type, notes. |
http_request | action | Make an HTTP request to an external service. Config: url (required), method (GET, POST, PUT, DELETE), headers (object), body (object or string). |
delay | action | Pause execution before the next action. Config: duration (number), unit (seconds, minutes, hours, days). |
score_lead | action | Adjust a lead's score. Config: lead_id (or use trigger context), adjustment (number, positive or negative), reason (string). |
assign_agent | action | Assign 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.
| Parameter | Type | Description |
|---|---|---|
{{lead.name}} | string | The full name of the lead associated with the trigger event. |
{{lead.phone}} | string | The phone number of the lead. |
{{call.duration}} | number | The call duration in seconds (available on call triggers). |
{{call.summary}} | string | AI-generated summary of the call (available on call.ended). |
{{appointment.date}} | string | The date and time of the appointment (ISO 8601 format). |
{{business.name}} | string | Your business name as configured in settings. |
{{business.phone}} | string | Your business phone number. |
Examples
Missed Call Follow-Up
Automatically send an SMS to the caller and notify your team on Slack when a call is missed.
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.
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.
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
{
"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"
}
}