This video demonstrates how to build a WhatsApp AI agent that automatically books appointments with clients using n8n, a no-code workflow automation tool. The agent integrates with WhatsApp, AI models (like OpenAI), Google Calendar, and Google Sheets to manage appointments, send confirmations, and reminders. The video aims to show viewers how to create this system without coding skills.
The video transcript details building a WhatsApp AI appointment scheduler using n8n. Here's a numbered breakdown of the process:
Introduction and Overview: The video begins by introducing the concept of an automated WhatsApp AI appointment setter, highlighting its advantages over traditional booking forms. It mentions the availability of pre-built templates.
n8n Workflow Setup: The tutorial starts by guiding the user to the n8n platform and creating a new workflow.
WhatsApp Trigger Integration: A WhatsApp trigger node is added to initiate the workflow, requiring the user to integrate their WhatsApp Business API account. This involves obtaining a Client ID and Client Secret from the Facebook Developer portal by creating a new app and obtaining an access token.
WhatsApp Send Message Node: A WhatsApp "send message" node is added to enable responses from the agent back to the user. This also requires setting up credentials using the access token and business ID from the WhatsApp API setup.
AI Agent Node Integration: An "AI Agent" node is added as the core of the workflow. This node integrates the AI model (OpenAI's GPT-4 is recommended) for natural language processing. A connection to the chosen AI model's API is established by obtaining an API key from the model's platform. A buffer memory is also added to maintain the context of the conversation.
Google Calendar Integration: A Google Calendar tool is added. This involves establishing a connection to the user's Google Calendar account. Two separate Google Calendar nodes are created: one to read available time slots and another to create new events (appointments).
Google Sheets Integration: Google Sheets integration is implemented using three nodes: (1) Google Sheets "read" to access existing appointment data; (2) Google Sheets "add rows" to log new appointments and the user’s email address; and (3) Google Sheets "update rows" to add further appointment details (name, phone number, time zone, topic, etc.) to the same row as the email. A pre-made Google Sheet template is provided, including an App Script for automated reminder scheduling.
Gmail Integration: A Gmail node is added to send email confirmations of appointments. The user connects their Gmail account to send automated confirmation emails to both the client and themselves (using BCC).
System Instructions/Prompt Engineering: Throughout the setup, the user is guided to define system instructions (prompts) that govern how the AI interacts with the different tools and manages the appointment-booking process. This includes specifying the tools available to the AI and defining its workflow logic.
Workflow Testing and Refinement: The workflow is extensively tested throughout the process, addressing errors and refining the system's functionality.
Voice Message Handling: The tutorial demonstrates adding functionality to handle voice messages. This involves using additional WhatsApp nodes (download media and HTTP request) and a transcription service to convert voice to text before processing by the AI.
WhatsApp Reminder Setup: A webhook is implemented to send automated WhatsApp reminders. This involves using an App Script within the Google Sheet to trigger the webhook when a new confirmed appointment is added, specifying a time interval before the appointment (e.g., 2 minutes or 1 hour).
Deployment Considerations: Finally, the video discusses deployment options, including using the user's personal WhatsApp account (requiring a separate business number), or using a third-party service like Twilio to manage WhatsApp messages at scale. A cost analysis is provided, outlining the expenses related to WhatsApp messaging, OpenAI API usage, n8n executions, and the optional third-party WhatsApp API service.
The transcript follows this structure, providing detailed instructions and snippets of code for each step. However, the visual aspects of the process are not directly captured, making perfect replication from the transcript alone impossible.
Here are answers 1-4, based solely on the provided transcript:
What are the specific steps involved in integrating the WhatsApp trigger with the n8n platform?
The transcript details these steps: First, add a "WhatsApp Trigger" node to the n8n workflow. Then, integrate it by providing a Client ID and Client Secret. These credentials are obtained from the Facebook Developer portal after creating a new app. You must log in with your Facebook account, create the app, and then find the Client ID and Client Secret under "App settings" -> "Basic." An access token is also obtained under the WhatsApp API setup within the newly created Facebook app. This access token and the business ID (also found in the Facebook app setup) are needed to configure the WhatsApp “send message” node. Finally, the user connects their chosen WhatsApp account.
What information is required from the Facebook developer portal to connect the WhatsApp trigger in n8n?
The Facebook Developer portal provides the Client ID and Client Secret, obtained after creating a new app. In addition, within the setup for the WhatsApp API of the app, an access token and business ID are needed.
Which AI models are mentioned as compatible options within the WhatsApp agent, and what are the steps involved in connecting to an OpenAI account?
The transcript mentions OpenAI, Anthropic, and Claude as compatible AI models. To connect to an OpenAI account, the user is instructed to go to platform.openai.com, sign in (or sign up), navigate to API keys, create a new key, and copy the generated key to paste into the n8n AI Agent node configuration. The chosen model (e.g., GPT-4) should also be selected in the n8n node.
What tools are used within the agent to manage calendar events (creating, reading, deleting), and how are these tools integrated into the n8n workflow?
The Google Calendar tool is used. Two separate Google Calendar nodes are integrated into the n8n workflow: one to read events (get available time slots), and another to create events (book appointments). A third Google Calendar node is also added to delete calendar events. Each node requires establishing a connection to the user's Google account and specifying the calendar to be used. The read node is used to determine available slots, while the create node adds new events based on the booking information. The delete node removes events when necessary, like cancellations.