AI SMS Appointment Scheduling & Lead Follow-up Agent
Integrates with:
Overview
Unlock Automated Appointment Management & Lead Nurturing with this AI Agent
This n8n workflow deploys a sophisticated AI Agent designed to handle customer interactions via SMS for appointment scheduling and lead management. It listens for incoming Twilio SMS messages, engages users in conversation to book, reschedule, or cancel appointments using Cal.com, and diligently records all interactions and lead statuses in an Airtable base. Furthermore, it features an AI-driven follow-up system that intelligently re-engages leads who haven't yet booked, crafting personalized messages with OpenAI.
This AI Agent's core abilities include:
- Conversational Appointment Scheduling: Understands natural language SMS requests to manage appointments (book, reschedule, cancel) by interacting with the Cal.com API.
- Lead & Session Management: Tracks customer conversations, contact details, appointment status, and follow-up history within Airtable, acting as a lightweight CRM.
- Intelligent Lead Follow-up: Automatically identifies leads in Airtable eligible for follow-up and uses OpenAI to generate and send personalized SMS messages to encourage booking.
- Command Handling: Processes specific commands like "STOP" to manage user opt-out preferences.
Key Features & Benefits
- 24/7 Availability: Provides round-the-clock automated assistance for appointment bookings and initial inquiries via SMS.
- Enhanced Lead Conversion: Proactively follows up with leads using AI-generated personalized messages, increasing the chances of converting them into booked appointments.
- Streamlined Operations: Automates the entire lifecycle from initial SMS contact to appointment scheduling and follow-up, freeing up your team.
- Centralized Data: Keeps all lead and appointment data organized in Airtable for easy tracking and reporting.
- Powered by Advanced AI: Leverages OpenAI's GPT models (e.g., gpt-4o-mini) for natural language understanding, response generation, and follow-up message creation. Utilizes a Langchain agent equipped with tools for Cal.com API interaction and structured output parsing for robust appointment management.
- Customizable: Easily adapt the agent's prompts, follow-up logic, and CRM fields to suit your specific business needs.
Use Cases
- For B2C e-commerce: Automate booking for service appointments (e.g., repairs, installations, consultations) via SMS, and follow up with potential customers who showed interest but didn't book.
- For B2B SaaS: Streamline demo scheduling via SMS for inbound leads, manage lead data in Airtable, and re-engage prospects with AI-generated follow-ups to drive sales.
- Automate appointment reminders, rescheduling, and cancellations for service-based businesses (e.g., salons, clinics, consultants), reducing no-shows and administrative overhead.
- Provide 24/7 initial customer support and booking capabilities for small to medium-sized businesses via SMS, improving customer experience and capturing more leads.
Prerequisites
- An n8n instance (Cloud or self-hosted).
- OpenAI API Key with access to a suitable model (e.g., gpt-4o-mini, gpt-4).
- Twilio account with an active phone number and API credentials (Account SID and Auth Token).
- Airtable account and a Personal Access Token with appropriate base permissions.
- Cal.com account and an API Key (set up as an HTTP Header Authentication credential in n8n, e.g.,
apikey=YOUR_CAL_API_KEY
). - An existing Cal.com event type ID that the agent will use for scheduling appointments.
Setup Instructions
- Download the n8n workflow JSON file.
- Import the workflow into your n8n instance.
- Twilio Setup:
- Configure the 'Twilio Trigger' node: Select/create your Twilio API credentials. The node will generate a webhook URL.
- In your Twilio account, navigate to your phone number's configuration and set this webhook URL for 'A MESSAGE COMES IN'.
- Configure all Twilio 'Send Message' nodes ('Send Reply', 'Send Confirmation', 'Send Follow Up Message') with your Twilio credentials and ensure the 'From' phone number is correctly set (should be your Twilio number).
- OpenAI Setup:
- Configure the 'OpenAI Chat Model1', 'OpenAI Chat Model2', and 'OpenAI Chat Model3' nodes: Select/create your OpenAI API credentials and choose your preferred model (e.g., gpt-4o-mini is used in one instance).
- Airtable Setup:
- Configure all Airtable nodes ('Find Follow-Up Candidates', 'Update Follow-Up Count and Date', 'Create/Update Session', 'Get Existing Chat Session', 'User Request STOP'): Select/create your Airtable Personal Access Token credentials.
- Update the 'Base' (Base ID) and 'Table' (Table ID or Name) parameters in each Airtable node to match your Airtable setup for lead tracking. Ensure your Airtable base has columns corresponding to those used in the workflow (e.g.,
session_id
,status
,followup_count
,last_followup_at
,chat_messages
,appointment_id
,customer_name
,customer_summary
,twilio_service_number
).
- Cal.com Setup (HTTP Tool Nodes for Agent):
- The agent uses several 'HTTP Request Tool' nodes ('Get Availability', 'Create a Booking', etc.) to interact with Cal.com.
- For each of these tool nodes, ensure the 'Authentication' is set to use your Cal.com API Key credential (configured as HTTP Header Auth in n8n, typically
apikey
as the name and your Cal.com API key as the value). - In the 'Get Availability' and 'Create a Booking' tool nodes, find the
eventTypeId
parameter within their respective configurations (e.g., in URL parameters or JSON body) and update it with your specific Cal.com event type ID (e.g., the default is648297
).
- Customize Agent & Prompts:
- Review and customize the system prompt in the 'Appointment Scheduling Agent1' node to reflect your business details, services, and desired conversational style.
- Adjust the prompt in the 'Generate Follow Up Message' (LLM Chain) node to tailor the follow-up messaging strategy.
- Schedule Trigger: Configure the 'Every 24hrs' Schedule Trigger node if you want to change the frequency of the automated follow-up process.
- Activate the workflow.
- Test thoroughly by sending SMS messages to your Twilio number, checking Airtable updates, and Cal.com bookings.
Want your own unique AI agent?
Talk to us - we know how to build custom AI agents for your specific needs.
Schedule a Consultation