👉 n8n No Limits Access :

https://www.hostg.xyz/SHHAd

Hébergement VPS n8n | Automatisation sécurisée et évolutive

coupon -15% : DRFIRAS15

👉 Formation n8n en Français

Formation n8n en Français : Automatisation & Agents IA

coupon -20% : LANCEMENT : HERE


Intro

This course rebuilds the classic "WhatsApp Sales Agent + RAG" template with one major upgrade: the agent now understands voice notes, photos and videos, not just text. Whatever a customer sends, it becomes plain text before reaching the AI Sales Agent, which can also search your product catalogue (RAG) and remembers the last messages per customer.

Flow diagram (text)

PART 1 - Build the knowledge base (run once)
Manual Trigger -> Knowledge Base Settings -> Download Product Brochure -> Extract Brochure Text -> Insert Product Catalogue into Vector Store
   (subnodes: Embeddings for Indexing, Load Brochure Document <- Split Brochure Text)

PART 2 - WhatsApp Sales Agent (production)
WhatsApp Trigger -> Configuration -> Route by Message Type (Switch)
  case Audio -> Get Audio Media URL -> Download Audio File -> Transcribe Voice Note -----\
  case Image -> Get Image Media URL -> Download Image File -> Analyze Image with GPT Vision -\
  case Video -> Get Video Media URL -> Download Video File -> Describe Video with Gemini -----> Prepare Agent Input -> AI Sales Agent -> Reply to Customer
  case Text  ------------------------------------------------------------------------------/
  fallback (Unsupported) -> Reply Unsupported Message

AI Sales Agent subnodes: OpenAI Chat Model, Per-Customer Chat Memory, query_product_catalogue (tool) <- Product Catalogue (Retrieve) <- Embeddings for Retrieval

Prerequisites & credentials

Credential Type Where to get it Used on
WhatsApp Trigger credential whatsAppTriggerApi Meta developer app > WhatsApp product > API setup (Client ID/Secret) WhatsApp Trigger
WhatsApp Business credential whatsAppApi Same Meta app, permanent access token All WhatsApp send / media nodes, and the 3 HTTP download nodes (predefined credential type)
OpenAI account openAiApi platform.openai.com > API keys Transcription, Vision, Chat model, Embeddings
Google Gemini (PaLM) API key googlePalmApi Google AI Studio > Get API key Video understanding

Test the WhatsApp credential: send yourself a text message on your test number after activating the workflow; you should see an execution appear.

Node-by-node build guide

1. Configuration (the single place to edit)

Node type: Set (n8n-nodes-base.set v3.4), includeOtherFields: true (critical - keeps the original WhatsApp payload flowing through).

Name Type Default value Role
openai_model string gpt-5.4-mini Chat model used by the AI Sales Agent
vision_model string gpt-5.4-mini Model used to describe photos
video_model string models/gemini-3.5-flash Gemini model used to describe videos
memory_context_window number 10 How many past messages the agent remembers per customer
max_reply_length number 1500 Hard cap on WhatsApp reply length
vector_store_key string product_catalogue Must match the key used in "Knowledge Base Settings"
phone_number_id string (you fill this) Your WhatsApp Business phone number ID
system_prompt string (provided, editable) The Sales Agent persona and instructions
product_catalogue_description string (provided) Description shown to the LLM for the RAG tool
unsupported_message_text string (provided) Reply sent for message types we don't handle

2. Knowledge Base Settings (Part 1 only)