Skip to content

Repository files navigation

Retell AI Real Estate Agent - n8n Workflow

This n8n workflow integrates with Retell AI to create an intelligent real estate agent that can handle appointment booking, checking, cancellation, and rescheduling through voice interactions. The system automatically manages calendar events, sends confirmation emails, and maintains a database of all interactions.

Overview

The workflow consists of two main entry points:

  1. Tool Call Webhook - Handles real-time appointment management during active calls
  2. Call Ended Webhook - Logs call summaries and analytics after calls complete

Complete Workflow

Workflow Components

1. Webhook Endpoints

Tool Call Webhook (/retell-tool)

  • Purpose: Receives real-time function calls from Retell AI during active conversations
  • Method: POST
  • Handles: Appointment booking, checking, cancellation, and rescheduling requests

Call Ended Webhook (/retell-summary)

  • Purpose: Receives call completion data for logging and analytics
  • Method: POST
  • Handles: Call summaries, sentiment analysis, and conversation logs

2. Action Router

The workflow uses a Switch node to route different actions based on the action parameter:

  • check - Verify existing appointments
  • book - Create new appointments
  • cancel - Cancel existing appointments
  • reschedule - Modify appointment times

3. Database Integration

Database Integration

The workflow integrates with NocoDB to manage appointment data with the following fields:

  • Client Name
  • Phone Number
  • Email Address
  • Appointment Time
  • Status (Booked/Confirmed/Cancelled/Call Log)
  • Meeting Link
  • Calendar Event ID
  • Summary (for call logs)

4. Calendar Management

Google Calendar Integration handles:

  • Creating calendar events with Google Meet links
  • Updating appointment times for rescheduling
  • Deleting events for cancellations
  • 30-minute default duration for all appointments

5. Email Notifications

Email Integration

Gmail Integration sends automated emails for:

  • Booking Confirmations: Include meeting links and joining instructions
  • Cancellation Notices: Confirm appointment cancellation
  • Rescheduling Updates: Notify about time changes

Workflow Logic Flow

graph TD
    A[Retell AI Tool Call] --> B{Action Router}
    
    B -->|check| C[Check Existing Appointments]
    B -->|book| D[Book New Meeting]
    B -->|cancel| E[Find Row to Cancel]
    B -->|reschedule| F[Get Reschedule Data]
    
    C --> G[Create Calendar Event]
    D --> H[Response: Book Success]
    D --> G
    
    G --> I[Update Database with Meeting Link]
    I --> J[Send Confirmation Email]
    I --> K[Response: Check Complete]
    
    E --> L[Delete Calendar Event]
    L --> M[Update Status to Cancelled]
    M --> N[Send Cancellation Email]
    N --> O[Response: Cancel Success]
    
    F --> P[Update Calendar Event]
    P --> Q[Update Database Row]
    Q --> R[Get Email Message]
    
    S[Call Ended Webhook] --> T[Log Call Summary to Database]
    
    style A fill:#e1f5fe
    style S fill:#e1f5fe
    style B fill:#fff3e0
    style G fill:#e8f5e8
    style J fill:#fce4ec
    style N fill:#fce4ec
Loading

Action Workflows

Check Appointments Flow

  1. Receive phone number from Retell AI
  2. Query NocoDB for existing appointments
  3. Create calendar event if appointment exists
  4. Update database with meeting link and confirmation status
  5. Send confirmation email with meeting details
  6. Return appointment details to Retell AI

Book Appointment Flow

  1. Receive customer details (name, phone, email, time)
  2. Create new record in NocoDB
  3. Generate Google Calendar event with Meet link
  4. Update database with meeting link and event ID
  5. Send confirmation email to customer
  6. Return success response to Retell AI

Cancel Appointment Flow

  1. Find existing appointment by phone number
  2. Delete corresponding Google Calendar event
  3. Update database status to "Cancelled"
  4. Send cancellation confirmation email
  5. Return cancellation success to Retell AI

Reschedule Appointment Flow

  1. Retrieve appointment details by ID
  2. Update Google Calendar event with new time
  3. Update database with new schedule information
  4. Process email notifications
  5. Return reschedule confirmation

Integration Details

Retell AI Integration

AI Agent Integration

The workflow receives structured data from Retell AI including:

  • Action type (check/book/cancel/reschedule)
  • Customer information (name, phone, email)
  • Appointment details (time, preferences)
  • Call metadata (sentiment, summary)

NocoDB Database Schema

Table: Appointments
- Id (Primary Key)
- ClientName (Text)
- PhoneNumber (Text) 
- Email (Text)
- AppointmentTime (DateTime)
- Status (Text: Booked/Confirmed/Cancelled/Call Log)
- MeetingLink (Text)
- CalendarEventId (Text)
- Summary (Text)
- Language/Sentiment (Text)
- StartTime (DateTime)
- EndTime (DateTime)
- EmailSent (Boolean)

Google Services Integration

  • Google Calendar API: Event management and Meet link generation
  • Gmail API: Automated email communications

Call Analytics & Logging

Agent Analytics

When calls end, the workflow automatically:

  1. Extracts caller information and sentiment
  2. Stores call summary and analysis
  3. Logs conversation metadata
  4. Tracks customer interaction patterns

Setup Requirements

Prerequisites

  • n8n instance (cloud or self-hosted)
  • Retell AI account with webhook configuration
  • NocoDB database setup
  • Google Workspace account with API access
  • Gmail account for sending notifications

Webhook Configuration

Configure these webhook URLs in your Retell AI dashboard:

  • Tool calls: https://your-n8n-instance.com/webhook/retell-tool
  • Call ended: https://your-n8n-instance.com/webhook/retell-summary

Environment Setup

Environment Setup

For local development, use ngrok or similar tunneling service to expose your n8n webhooks to Retell AI.

Response Formats

Success Responses

{
  "result": "success",
  "message": "Appointment booked successfully for [Customer Name]"
}

Check Response

{
  "result": "Found 1 existing appointment(s)",
  "appointment_details": {
    "Id": "123",
    "ClientName": "John Doe",
    "AppointmentTime": "2024-01-20T10:00:00Z",
    "Status": "Confirmed"
  }
}

Error Handling

The workflow includes robust error handling for:

  • Invalid phone numbers or email addresses
  • Calendar conflicts and availability issues
  • Database connection failures
  • Email delivery problems
  • Missing or malformed webhook data

Security Considerations

  • All webhook endpoints use HTTPS
  • Database credentials are stored securely in n8n
  • Email templates sanitize user input
  • Phone numbers are validated before database queries

Monitoring & Analytics

The workflow provides comprehensive logging through:

  • Call summary storage for conversation analysis
  • Appointment status tracking
  • Email delivery confirmation
  • Calendar event synchronization status

This automation streamlines the entire real estate appointment process, from initial customer contact through final confirmation, while maintaining detailed records for business analytics and customer relationship management.

About

This project is an automated voice agent system designed to handle real estate appointment management. It integrates conversational AI with backend database and calendar tools to fully automate the booking lifecycle without human intervention.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors