Activate this automation on N8nPort with one click
We have completed the workflow installation, node configuration, and setup for you, so the automation is ready to activate without a manual import or node-by-node configuration.
Quick answers
How does this workflow help manage appointment leads?
This workflow manages appointment leads by capturing incoming SMS inquiries, using an AI agent to interact with customers for scheduling, and storing all conversation history and appointment details in Airtable.
Can this workflow send follow-up messages automatically?
Yes, the workflow includes a scheduled component that identifies leads without a confirmed appointment and automatically generates and sends follow-up messages via Twilio to re-engage them.
What tools are used for scheduling appointments in this workflow?
The workflow uses an AI agent powered by OpenAI, which interacts with the Cal.com API through HTTP Request tools to check availability, create, reschedule, or cancel appointments.
How does the workflow handle requests to stop messages?
If a customer sends a message containing the word "STOP," the workflow updates their record in Airtable to prevent further follow-up messages and sends a confirmation SMS.
This workflow helps businesses automatically manage appointment leads and follow-up messages. It uses AI to handle customer questions via SMS, schedule appointments, and send timely follow-ups to potential clients who haven't booked a service yet. This setup helps you keep your lead management organized and responsive.
Key Questions About This Workflow
How does this workflow help manage appointment leads?
This workflow manages appointment leads by capturing incoming SMS inquiries, using an AI agent to interact with customers for scheduling, and storing all conversation history and appointment details in Airtable.
Can this workflow send follow-up messages automatically?
Yes, the workflow includes a scheduled component that identifies leads without a confirmed appointment and automatically generates and sends follow-up messages via Twilio to re-engage them.
What tools are used for scheduling appointments in this workflow?
The workflow uses an AI agent powered by OpenAI, which interacts with the Cal.com API through HTTP Request tools to check availability, create, reschedule, or cancel appointments.
How does the workflow handle requests to stop messages?
If a customer sends a message containing the word "STOP," the workflow updates their record in Airtable to prevent further follow-up messages and sends a confirmation SMS.
Quick Overview
This n8n workflow is a complete solution for handling customer appointment inquiries and follow-ups. It starts by listening for incoming SMS messages with Twilio. An AI agent then takes over the conversation, using Cal.com to manage scheduling, rescheduling, and cancellations. All customer chats and appointment data are stored in Airtable. The workflow also includes a scheduled part that automatically finds and follows up with leads who haven't booked an appointment, making sure no potential client is missed. Customers can also opt out of messages by replying "STOP."
What This Workflow Does
This workflow automates key parts of lead and appointment management for businesses like PC repair services. When a customer sends an SMS, the system gets to work. It checks Airtable for past chat history to keep the conversation in context, then an AI agent talks with the customer to understand their needs and schedule an appointment using Cal.com. The conversation and appointment status are always kept up-to-date in Airtable. If a customer doesn't book right away, a separate, scheduled part of the workflow finds these leads and sends automated follow-up messages to encourage them to book. It also respects customer choices, letting them stop messages at any time.
How It Works
The workflow has two main parts: one that talks to customers in real-time and another that sends scheduled follow-ups.
Real-time Customer Interaction
Receiving Customer SMS
The workflow starts when a customer sends an SMS. A Twilio Trigger node catches these incoming messages.
Checking for Command Words
Right after getting a message, a Switch node checks for command words like "STOP." If it finds "STOP," the workflow updates the customer's status in Airtable and sends a confirmation message with Twilio.
Retrieving Chat History
For other messages, an Airtable node (Get Existing Chat Session) looks up past conversations with the customer. This gives the AI agent context for the chat.
AI-Powered Appointment Scheduling
An Agent node (Appointment Scheduling Agent1), using an OpenAI Chat Model, handles the conversation. It's set up to understand what customers want, answer questions, and manage appointments. It uses several HTTP Request tools to talk to the Cal.com API:
Get Availability: Checks for open appointment slots.
Create a Booking: Schedules new appointments.
Find Existing Booking and Get Existing Booking: Finds appointments that have already been scheduled.
Reschedule Booking: Changes the time of an existing appointment.
Cancel Booking: Removes a scheduled appointment.
The agent's response goes through Structured Output Parser and Auto-fixing Output Parser nodes to make sure the data is formatted correctly.
Updating Session and Responding
After the AI agent replies or does something, an Airtable node (Create/Update Session) updates the customer's record. This includes saving chat messages, updating appointment details, and noting the last message time. Finally, a Twilio node (Send Reply) sends the AI agent's response back to the customer via SMS.
Scheduled Follow-ups
Daily Trigger
A Schedule Trigger node (Every 24hrs) kicks off the follow-up process once a day.
Identifying Follow-Up Candidates
An Airtable node (Find Follow-Up Candidates) searches your lead tracker for customers who meet certain criteria:
No appointment scheduled.
Status is not "STOP."
Fewer than three follow-up messages sent.
Last follow-up was at least three days ago.
Generating Follow-Up Messages
For each lead it finds, a Chain Llm node (Generate Follow Up Message) uses an OpenAI Chat Model to write a personalized follow-up message. This message uses the customer's name, a summary of their inquiry, and past chat history to re-engage them.
Updating Follow-Up Status and Sending Message
An Airtable node (Update Follow-Up Count and Date) increases the follow-up count and updates the last follow-up date for that customer. Then, a Twilio node (Send Follow Up Message) sends the generated message to the customer, including instructions on how to stop future messages.
Ready to automate?
The complete installation and configuration are already prepared for your workspace. Activate the preconfigured workflow on N8nPort with one click.
Prerequisites
To set up and run this workflow, you'll need accounts and API access for these services:
n8n Instance: Where you'll host and run this workflow.
Twilio Account: For sending and receiving SMS messages. You'll need a Twilio phone number and your Account SID and Auth Token to create a Twilio API credential.
Airtable Account: To store customer data, chat history, and track leads. You'll need an API key for an Airtable Token API credential. You'll also need to set up an Airtable base and a table (like "Lead Tracker") with fields for
session_id,status,customer_name,customer_summary,chat_messages,scheduled_at,appointment_id,last_message_at,last_followup_at,followup_count, andtwilio_service_number.Cal.com Account: For managing appointments. You'll need a Cal.com API key for a Cal API credential. For Cal.com's v2 API, you'll also need to set up an HTTP Header Auth credential with your API key, as shown in their API docs. You'll also need an
eventTypeIdfrom your Cal.com setup, which sets the length of bookings.OpenAI Account: To power the AI agent and message generation. You'll need an OpenAI API key to create Open AI API and OpenAI API key credentials.
How You Set It Up
To set up this workflow, you'll need to configure each service and connect them in n8n:
Import the Workflow: Get the workflow JSON file and import it into your n8n instance.
Configure Twilio: Set up your Twilio API credential with your Account SID and Auth Token. Configure the Twilio Trigger node to receive incoming messages and make sure its webhook URL is set correctly in your Twilio account.
Prepare Airtable: Create an Airtable base and a table named "Lead Tracker" (or similar) with the needed fields (
session_id,status,customer_name, etc.). Set up your Airtable Token API credential. Update the Airtable nodes (Get Existing Chat Session, Create/Update Session, etc.) to use your base and table IDs.Set Up Cal.com: Configure your Cal API credential with your API key. For the Cal.com API v2 calls, create an HTTP Header Auth credential as explained in Cal.com's documentation. Update the
eventTypeIdin the Get Availability and Create a Booking nodes to match an event type from your Cal.com account. This ID is important for bookings to work.Integrate OpenAI: Set up your OpenAI API credentials with your OpenAI API key. The AI agent and follow-up message generator use these.
Review and Activate: Check all the node settings, especially any expressions that use data from other nodes. When you're ready, activate the workflow.
What You Can Customize
You can customize this workflow in several ways to fit your business:
AI Agent Behavior: Change the system message in the Appointment Scheduling Agent1 node to adjust the AI's personality, what it knows, and how it interacts. You can change how it answers questions, what it focuses on, and its tone.
Follow-Up Logic: Change the rules in the Find Follow-Up Candidates Airtable node to control when and to whom follow-ups are sent. You can change the number of follow-ups, the time between them, or add other conditions.
Follow-Up Message Content: Edit the prompt in the Generate Follow Up Message node to change the style and content of the follow-up messages.
Cal.com Event Type: Change the
eventTypeIdin the Cal.com API nodes to use different appointment types or lengths that you've set up in your Cal.com account."STOP" Command: You can add more keywords to the Check For Command Words node for other actions, like "HELP" or "STATUS."
Airtable Schema: While the workflow expects certain fields, you can add more fields to your Airtable base to capture other lead information that's useful for your business.
Limitations and Troubleshooting
Keep these points in mind when using this workflow:
External Service Dependency: The workflow needs Twilio, Airtable, Cal.com, and OpenAI to be working correctly. If any of them have issues, the workflow might fail.
AI Accuracy: The AI's answers can sometimes be unpredictable. Even with a good system message, complex questions might get strange replies. It's a good idea to check the AI's conversations now and then.
Cal.com Event ID: Make sure the
eventTypeIdin the Cal.com nodes matches an event type in your account. If it's wrong, bookings will fail.Airtable Field Names: The workflow expects specific field names in your Airtable base. If your field names are different, it will cause errors.
Credential Validity: Make sure your API keys and credentials for all services are up-to-date and have the right permissions.
Webhook Configuration: The Twilio Trigger won't work unless you set up its webhook URL correctly in your Twilio account.
Frequently Asked Questions
What happens if a customer replies "STOP"?
If a customer replies with "STOP," the workflow updates their record in Airtable to mark their status as "STOP," which prevents any more automated follow-up messages. A confirmation message is also sent to the customer.
How often does the workflow check for follow-up candidates?
The workflow is set to check for follow-up candidates every 24 hours, using the "Every 24hrs" Schedule Trigger node.
Can the AI agent handle rescheduling or canceling appointments?
Yes, the AI agent has tools to find existing bookings, reschedule them, or cancel them by talking to the Cal.com API.
What information does the workflow store in Airtable?
The workflow stores customer session IDs, chat messages, customer names, inquiry summaries, appointment details (like scheduled time and appointment ID), and follow-up tracking info (like last message time, last follow-up time, and follow-up count).
Source and Next Steps
This workflow is based on an original from the n8n.io website. You can find it and more details here: Handling Appointment Leads and Follow-up With Twilio, Cal.com and AI.
To get started, import the workflow into your n8n instance, set up your credentials for Twilio, Airtable, Cal.com, and OpenAI, and tweak any settings to fit how you work.
Activate this workflow on N8nPort
Choose your workspace and activate the fully prepared automation with one click.