Triage and answer college WhatsApp enquiries with OpenAI and Supabase

Go to Workflow
0 views
Built by Muhammad Bilal Muhammad Bilal
Created on August 28, 2026

Description

Quick overview
This workflow ingests college documents from Google Drive into a Supabase vector store, then runs a WhatsApp-based admissions receptionist that handles text, voice, and image enquiries using OpenAI with retrieval and a reviewer step before replying and logging the conversation in Supabase.

How it works
When a WhatsApp message is received, the workflow detects whether the user sent text, a voice note, or an image.
For voice notes, it fetches the WhatsApp media URL, downloads the audio, and uses OpenAI to transcribe it into text.
For images, it fetches the WhatsApp media URL, downloads the image, and uses OpenAI Vision to extract all readable content and combine it with any image caption.
It normalizes all input types into a single “question” format, then creates a conversation record in Supabase.
An OpenAI chat agent uses the Supabase vector-store retriever tool to look up relevant college information (with chat history stored in Postgres) and generates a draft reply.
A second OpenAI reviewer validates the draft against the same Supabase knowledge base, then either approves it, retries generation once with correction instructions, or falls back to a safe response.
The workflow updates the Supabase conversation record with the final response and sends the reply back to the user via WhatsApp.

Setup
Connect WhatsApp Cloud API credentials for both the WhatsApp Trigger and WhatsApp nodes, then configure the webhook in Meta to point to the trigger URL.
Add an OpenAI API credential for chat completions, audio transcription, image analysis, and embeddings.
Create and connect a Supabase project with a documents table and a match_documents query (RPC) for vector search, then add Supabase API credentials and set the table name used by the vector store nodes.
Connect a Postgres database for chat memory and ensure it is reachable from your n8n instance.
Replace placeholders like YOUR_GOOGLE_DRIVE_FILE_ID, YOUR_CLIENT_UUID, and YOUR_USER_UUID, and ensure the Supabase conversations table contains the referenced columns (client_id, user_id, phone, user_message, message_type, ai_response, response_type, language, status).

Requirements
WhatsApp Cloud API, OpenAI, Supabase with pgvector, PostgreSQL, and Google Drive credentials are required.

Customization
Replace the college branding and placeholder IDs, then customize the AI prompts, supported languages, response tone, retry rules, and WhatsApp messages.

Nodes Used (13)

AI Agent
@n8n/n8n-nodes-langchain.agent
Code
n8n-nodes-base.code
Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader
Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi
Google Drive
n8n-nodes-base.googleDrive
HTTP Request
n8n-nodes-base.httpRequest
OpenAI
@n8n/n8n-nodes-langchain.openAi
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Postgres Chat Memory
@n8n/n8n-nodes-langchain.memoryPostgresChat
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured
Supabase
n8n-nodes-base.supabase
Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase
WhatsApp Business Cloud
n8n-nodes-base.whatsApp