Modular AI Customer Support Chatbot with Calendar and RAG Integration - n8n Workflow

Build an advanced, multi-tool AI assistant using this n8n workflow. Integrate WhatsApp, OpenAI, Gmail, Google Calendar, and Supabase for comprehensive customer support automation using specialized n8n node agents.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Technical teams needing high-availability, multi-functional AI customer service.
Businesses that manage bookings and FAQs through WhatsApp using n8n templates.
n8n users looking for advanced, multi-agent automation examples.
Developers utilizing OpenAI and vector databases (Supabase) in their n8n projects.

Overview

This sophisticated n8n workflow transforms standard WhatsApp communication into a powerful, automated customer support system. It acts as an AI orchestrator, receiving user queries via a Twilio n8n trigger and intelligently routing them to specialized sub-agents for tasks like booking appointments (via Google Calendar), retrieving knowledge base data (via Supabase RAG), or sending follow-up emails (via Gmail). The architecture demonstrates how complex processes can be managed efficiently using multiple connected n8n node agents, ensuring quick, accurate, and context-aware responses, thereby significantly improving response times and customer satisfaction. This comprehensive n8n solution drastically reduces manual workload.

How it Works

The process begins when the Incoming WhatsApp Message n8n trigger receives a new message via Twilio.


  1. Data Preparation: The message content and user/bot mobile numbers are extracted and formatted by the Format Incoming Message n8n node.

  2. Orchestration: The data is passed to the WhatsApp AI Support Agent (a Langchain agent powered by OpenAI and backed by a Postgres Conversation Memory n8n node). This agent analyzes the user's intent, leveraging the memory for continuous conversation context.

  3. Intent Routing: Based on the analysis, the primary agent delegates the task to one of three n8n toolWorkflow sub-agents:

If scheduling is needed, it calls the Calendar Tool, which runs a sub-agent workflow containing n8n node operations for Google Calendar (Get, Create, Delete events).
If knowledge retrieval (FAQ, pricing) is needed, it calls the Knowledge Base Tool, which connects to the Supabase Vector Store using OpenAI embeddings.
* If email communication is required, it calls the Email Tool, which connects to a sub-agent workflow utilizing the Send a message in Gmail n8n node.

  1. Response Generation: The primary WhatsApp AI Support Agent receives the output from the specialized sub-agent. It then rephrases the technical result into a clear, conversational WhatsApp message, utilizing context stored in the Conversation Memory n8n node.

  2. Delivery: Finally, the processed reply is sent back to the customer via the Send WhatsApp Reply n8n node (Twilio). This seamless n8n workflow cycle ensures end-to-end automation of customer support interactions.

Installation Guide

To use this complete n8n workflow template, follow these steps:


  1. Import the Workflow: Copy the provided JSON data and paste it into your n8n instance using the "New" -> "Import from JSON" option.

  2. Setup Credentials: This powerful n8n workflow requires credentials for the following services:

OpenAI: For all AI language model n8n node instances (Chat Models).
Twilio: For the Incoming WhatsApp Message n8n trigger and the Send WhatsApp Reply n8n node. Configure the Twilio webhook to point to your n8n instance's production URL.
Google Calendar: Required for the Calendar sub-agent tools (Get many events in Google Calendar, Create an event in Google Calendar).
Gmail: Required for the Email sub-agent tool (Send a message in Gmail).
* Supabase/Postgres: For the Supabase Vector Store (RAG) and the Conversation Memory (Postgres) n8n node. Ensure your vector store table is correctly set up with embeddings.

  1. Configure Sub-Workflows: Note that the agent tools (Calendar Tool, Knowledge Base Tool, Email Tool) reference separate n8n workflow IDs. You must ensure those corresponding sub-workflows (containing the specific Google Calendar, Gmail, and Supabase nodes) are imported and active in your n8n environment, and their IDs match those referenced in the toolWorkflow n8n node parameters. This step is critical for the main n8n workflow to function correctly.

  2. Activate: Set the main n8n workflow and all referenced sub-workflows to "Active."

Node Details

This complex n8n workflow relies on a modular system of interconnected n8n node types:

Incoming WhatsApp Message (Twilio Trigger): Function: The primary n8n trigger. Listens for incoming WhatsApp messages to initiate the n8n workflow.
WhatsApp AI Support Agent (Agent Node): Function: The core orchestrator. This n8n node analyzes user intent, manages conversation state via memory, and routes requests to the appropriate specialized n8n node tool.
Conversation Memory (Postgres) (Memory Node): Function: Maintains state and context for the WhatsApp AI Support Agent, crucial for multi-turn conversations. Key Configuration: Uses the user's mobile number as the unique sessionKey.
OpenAI Chat Model (LLM Node): Function: Multiple instances (e.g., OpenAI Chat Model1) power the agents. Uses the gpt-4.1-mini model for intelligence and decision-making across the entire n8n workflow.
Calendar Tool, Knowledge Base Tool, Email Tool (Tool Workflow Nodes): Function: These are critical n8n node components that delegate execution to separate, specialized n8n templates (sub-agents), enabling modular tool use.
Supabase Vector Store (Vector Store Node): Function: Used by the Knowledge Base Agent to retrieve relevant documents (RAG) based on the user's query, providing data for accurate answers. Key Configuration: Configured for retrieve-as-tool mode, connected to the documents table.
Send a message in Gmail (Gmail Tool Node): Function: Executes the final email sending action within the Email Agent sub-workflow, using dynamic fields for To, Subject, and Message based on AI output.
Get many events in Google Calendar / Create an event in Google Calendar (Google Calendar Tool Nodes): Function: Used by the Calendar Agent sub-workflow to manage scheduling conflicts and book new appointments. These are essential n8n node actions for calendar management.


  • Send WhatsApp Reply (Twilio Node): Function: Sends the final, AI-generated response back to the user on WhatsApp, completing the n8n workflow.

Related n8n Workflows

Free

Nodes: 13 Nodes
Updated: December 26 2025
View all
Created by
Nabin Bhandari
Nabin Bhandari

Featured*