AutomationFlowsAI & RAG › Answer Whatsapp Sales Queries From Text, Voice, Photos, and Video with…

Answer Whatsapp Sales Queries From Text, Voice, Photos, and Video with…

Original n8n title: Answer Whatsapp Sales Queries From Text, Voice, Photos, and Video with Openai and Gemini

ByDr. Firas @drfiras on n8n.io

This workflow indexes a product brochure PDF into an in-memory vector store and then responds to incoming WhatsApp text, voice, image, and video messages using OpenAI and Google Gemini, with per-customer chat memory and retrieval-augmented answers from the catalogue. Runs…

Event trigger★★★★★ complexityAI-powered34 nodesHTTP RequestIn-Memory Vector StoreOpenAI EmbeddingsDocument Default Data LoaderText Splitter Recursive Character Text SplitterWhatsApp TriggerWhatsAppOpenAI
AI & RAG Trigger: Event Nodes: 34 Complexity: ★★★★★ AI nodes: yes Added:

This workflow corresponds to n8n.io template #17765 — we link there as the canonical source.

This workflow follows the Agent → Documentdefaultdataloader recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "yTbfu1aD4Ibcf72k",
  "meta": {
    "builderVariant": "mcp",
    "aiBuilderAssisted": true
  },
  "name": "Answer WhatsApp text, voice, photo and video messages with an AI sales agent and RAG",
  "tags": [],
  "nodes": [
    {
      "id": "580389d2-da9f-4fc9-906b-5db47aaeabec",
      "name": "Populate Product Catalogue",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1328,
        -608
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e73625ac-e5e5-4e6e-871e-325c72c5bc52",
      "name": "Knowledge Base Settings",
      "type": "n8n-nodes-base.set",
      "position": [
        -1152,
        -608
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "kb-1",
              "name": "product_brochure_url",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Direct URL to your product brochure/catalogue PDF (e.g. https://yoursite.com/catalogue.pdf)__>"
            },
            {
              "id": "kb-2",
              "name": "chunk_size",
              "type": "number",
              "value": 2000
            },
            {
              "id": "kb-3",
              "name": "chunk_overlap",
              "type": "number",
              "value": 200
            },
            {
              "id": "kb-4",
              "name": "vector_store_key",
              "type": "string",
              "value": "product_catalogue"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2fc9b359-8950-4f10-9707-b17e111a01ee",
      "name": "Download Product Brochure",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -960,
        -608
      ],
      "parameters": {
        "url": "={{ $('Knowledge Base Settings').item.json.product_brochure_url }}",
        "options": {}
      },
      "typeVersion": 4.4
    },
    {
      "id": "bd4da07c-5489-4b81-83b3-59e6eeb87e1d",
      "name": "Extract Brochure Text",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -752,
        -608
      ],
      "parameters": {
        "options": {
          "joinPages": true
        },
        "operation": "pdf"
      },
      "typeVersion": 1.1
    },
    {
      "id": "b2e89ab6-7ca1-4ed7-875f-fc37435e9a10",
      "name": "Insert Product Catalogue into Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        -560,
        -608
      ],
      "parameters": {
        "mode": "insert",
        "memoryKey": {
          "__rl": true,
          "mode": "list",
          "value": "product_catalogue",
          "cachedResultName": "product_catalogue"
        },
        "clearStore": true
      },
      "typeVersion": 1.3
    },
    {
      "id": "187619e2-a9b9-4c43-bbfa-57e91f1eb4ad",
      "name": "Embeddings for Indexing",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -560,
        -448
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d12146e2-dbbf-49e3-a873-15f869b9c9ac",
      "name": "Load Brochure Document",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -592,
        -192
      ],
      "parameters": {
        "options": {},
        "jsonData": "={{ $('Extract Brochure Text').item.json.text }}",
        "jsonMode": "expressionData",
        "textSplittingMode": "custom"
      },
      "typeVersion": 1.1
    },
    {
      "id": "8a6dbcf0-8602-4b42-a4fc-6cff65b7b19b",
      "name": "Split Brochure Text",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        -576,
        -32
      ],
      "parameters": {
        "options": {},
        "chunkSize": "={{ $('Knowledge Base Settings').item.json.chunk_size }}",
        "chunkOverlap": "={{ $('Knowledge Base Settings').item.json.chunk_overlap }}"
      },
      "typeVersion": 1
    },
    {
      "id": "2f77f9df-b3cf-48a0-8906-7335555f8cd9",
      "name": "WhatsApp Trigger",
      "type": "n8n-nodes-base.whatsAppTrigger",
      "position": [
        -1504,
        208
      ],
      "parameters": {
        "options": {},
        "updates": [
          "messages"
        ]
      },
      "credentials": {
        "whatsAppTriggerApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "38ea6c92-7f54-4ba7-88a2-591570718774",
      "name": "Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -1264,
        208
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "cfg-1",
              "name": "openai_model",
              "type": "string",
              "value": "gpt-5.4-mini"
            },
            {
              "id": "cfg-2",
              "name": "vision_model",
              "type": "string",
              "value": "gpt-5.4-mini"
            },
            {
              "id": "cfg-3",
              "name": "video_model",
              "type": "string",
              "value": "models/gemini-3.5-flash"
            },
            {
              "id": "cfg-4",
              "name": "memory_context_window",
              "type": "number",
              "value": 10
            },
            {
              "id": "cfg-5",
              "name": "max_reply_length",
              "type": "number",
              "value": 1500
            },
            {
              "id": "cfg-6",
              "name": "vector_store_key",
              "type": "string",
              "value": "product_catalogue"
            },
            {
              "id": "cfg-7",
              "name": "phone_number_id",
              "type": "string",
              "value": "<__PLACEHOLDER_VALUE__Your WhatsApp Business phone number ID (from Meta app dashboard)__>"
            },
            {
              "id": "cfg-8",
              "name": "system_prompt",
              "type": "string",
              "value": "You are a helpful WhatsApp Sales Agent for our company. You help customers navigate our product catalogue for the current year. Your goal is not to force a sale but to answer questions factually using the query_product_catalogue tool. If a customer sends a photo, video, or voice note, its content has already been converted to text for you below - treat it exactly like a normal message. If you do not know the answer or the catalogue tool has no information, say so honestly and direct the customer to a human agent. Keep replies concise and friendly, suitable for WhatsApp."
            },
            {
              "id": "cfg-9",
              "name": "product_catalogue_description",
              "type": "string",
              "value": "Useful for answering questions about our product catalogue: features, prices, colors, sizes and availability. Always use this before answering a product question. Input should be a fully formed question."
            },
            {
              "id": "cfg-10",
              "name": "unsupported_message_text",
              "type": "string",
              "value": "Sorry, I can only understand text, voice notes, photos and videos for now. Could you resend your message in one of these formats?"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "67413a49-163a-416a-b359-68d1fc2f8fcc",
      "name": "Route by Message Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        -1008,
        208
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Audio",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.messages[0].type }}",
                    "rightValue": "audio"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Image",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.messages[0].type }}",
                    "rightValue": "image"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Video",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.messages[0].type }}",
                    "rightValue": "video"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Text",
              "conditions": {
                "options": {
                  "version": 1,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.messages[0].type }}",
                    "rightValue": "text"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra",
          "renameFallbackOutput": "Unsupported"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "b3455578-e1d0-457c-9cab-f42abd1f76ab",
      "name": "Get Audio Media URL",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        -912,
        32
      ],
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $('WhatsApp Trigger').item.json.messages[0].audio.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "bb67906a-8914-46f6-8a6a-d50144e9a1bb",
      "name": "Download Audio File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -416,
        32
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "whatsAppApi"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "7d848d46-44e5-452f-9b5e-32e73495fb50",
      "name": "Transcribe Voice Note",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -176,
        16
      ],
      "parameters": {
        "options": {},
        "resource": "audio",
        "operation": "transcribe"
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "c87f97c0-e5cf-4ac1-bd7c-49bedeee1e18",
      "name": "Prepare Agent Input",
      "type": "n8n-nodes-base.set",
      "position": [
        48,
        32
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "in-1",
              "name": "message_type",
              "type": "string",
              "value": "={{ $('WhatsApp Trigger').item.json.messages[0].type }}"
            },
            {
              "id": "in-2",
              "name": "message_text",
              "type": "string",
              "value": "={{ $json.text ?? $json.content ?? $('WhatsApp Trigger').item.json.messages[0].text?.body ?? '' }}"
            },
            {
              "id": "in-3",
              "name": "message_caption",
              "type": "string",
              "value": "={{ $('WhatsApp Trigger').item.json.messages[0].image?.caption ?? $('WhatsApp Trigger').item.json.messages[0].video?.caption ?? '' }}"
            },
            {
              "id": "in-4",
              "name": "from",
              "type": "string",
              "value": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "a79a628a-238e-4076-9e3e-c42fb5007b9c",
      "name": "Get Image Media URL",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        -752,
        144
      ],
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $('WhatsApp Trigger').item.json.messages[0].image.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "764ccaeb-d147-4956-9646-60d34998c282",
      "name": "Download Image File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -544,
        192
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "whatsAppApi"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "a83ff038-cea1-40e1-9ec0-2daa31202bd5",
      "name": "Analyze Image with GPT Vision",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -272,
        208
      ],
      "parameters": {
        "text": "Describe this image in detail for a sales assistant: product type, color, visible defects, and any text or model number visible. Keep it factual.",
        "images": {
          "values": [
            {}
          ]
        },
        "modelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Configuration').item.json.vision_model }}"
        },
        "options": {},
        "resource": "image",
        "inputType": "base64",
        "operation": "analyze"
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "3784cc04-8f9a-4fb1-87d3-0eeb6dce65e1",
      "name": "Get Video Media URL",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        -752,
        320
      ],
      "parameters": {
        "resource": "media",
        "operation": "mediaUrlGet",
        "mediaGetId": "={{ $('WhatsApp Trigger').item.json.messages[0].video.id }}"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "89f3de8a-4d49-40f4-920b-fe7ef1d22360",
      "name": "Download Video File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -528,
        400
      ],
      "parameters": {
        "url": "={{ $json.url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        },
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "whatsAppApi"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "637e365b-3396-49ca-bb96-2868e14a8217",
      "name": "Describe Video with Gemini",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        -112,
        400
      ],
      "parameters": {
        "text": "Describe what happens in this video for a sales assistant: the product shown, how it is used, and any visible defect. Keep it factual and concise.",
        "modelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Configuration').item.json.video_model }}"
        },
        "options": {},
        "resource": "video",
        "inputType": "binary",
        "operation": "analyze"
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "4c9c2d9b-1432-46a9-9688-195435991c36",
      "name": "Reply Unsupported Message",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        -784,
        512
      ],
      "parameters": {
        "textBody": "={{ $('Configuration').item.json.unsupported_message_text }}",
        "operation": "send",
        "phoneNumberId": "={{ $('Configuration').item.json.phone_number_id }}",
        "additionalFields": {
          "previewUrl": false
        },
        "recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "cc6cbf32-893f-49e9-880c-9d20357d714d",
      "name": "AI Sales Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        208,
        -16
      ],
      "parameters": {
        "text": "=Message type: {{ $json.message_type }}\nCustomer message: {{ $json.message_text }}\nMedia caption (if any): {{ $json.message_caption }}",
        "options": {
          "systemMessage": "={{ $('Configuration').item.json.system_prompt }}",
          "passthroughBinaryImages": false
        },
        "promptType": "define"
      },
      "typeVersion": 3.1
    },
    {
      "id": "e7cdb748-0369-45ab-a2e2-49f8725b988f",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        192,
        208
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Configuration').item.json.openai_model }}"
        },
        "options": {},
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "70efb6a2-0c27-4562-9dde-36391844cb47",
      "name": "Per-Customer Chat Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        352,
        272
      ],
      "parameters": {
        "sessionKey": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}",
        "sessionIdType": "customKey",
        "contextWindowLength": "={{ $('Configuration').item.json.memory_context_window }}"
      },
      "typeVersion": 1.4
    },
    {
      "id": "e15d0c04-8474-4cff-9b45-ef19d966118c",
      "name": "query_product_catalogue",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        688,
        -32
      ],
      "parameters": {
        "description": "={{ $('Configuration').item.json.product_catalogue_description }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "3d8323ab-64ee-41b0-aa13-98c4c86eb6ed",
      "name": "Product Catalogue (Retrieve)",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        528,
        176
      ],
      "parameters": {
        "memoryKey": {
          "__rl": true,
          "mode": "list",
          "value": "product_catalogue",
          "cachedResultName": "product_catalogue"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "d032abd3-5a91-4142-9e2d-e3fb088c5ab4",
      "name": "Embeddings for Retrieval",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        528,
        320
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3a47852d-c497-49fa-a08f-69c7bbad432f",
      "name": "Reply to Customer",
      "type": "n8n-nodes-base.whatsApp",
      "position": [
        448,
        -256
      ],
      "parameters": {
        "textBody": "={{ $json.output.slice(0, $('Configuration').item.json.max_reply_length) }}",
        "operation": "send",
        "phoneNumberId": "={{ $('Configuration').item.json.phone_number_id }}",
        "additionalFields": {
          "previewUrl": false
        },
        "recipientPhoneNumber": "={{ $('Prepare Agent Input').item.json.from }}"
      },
      "credentials": {
        "whatsAppApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "9d905d0d-2edd-4664-98e9-240d94da0956",
      "name": "Sticky Note db06d4c6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2496,
        -608
      ],
      "parameters": {
        "color": 4,
        "width": 900,
        "height": 1756,
        "content": "# Build a WhatsApp Sales Agent that understands text, voice, photos and videos with RAG\n# \ud83d\udce5  [Open full documentation on Notion](https://automatisation.notion.site/Course-Build-a-WhatsApp-Sales-Agent-text-voice-photo-video-with-RAG-39f3d6550fd9819e9103ceb55e1b79f5)\n\n## How it works\n* Part 1 (top branch, Manual Trigger): downloads your product brochure PDF, splits it into chunks and embeds it into an in-memory vector store - your product knowledge base.\n* Part 2 (bottom branch, WhatsApp Trigger): every incoming WhatsApp message is routed by type. Voice notes are transcribed with OpenAI Whisper, photos are described with GPT Vision, and videos are described with Google Gemini. Whatever the format, the result becomes plain text.\n* That text is handed to an AI Sales Agent which can query the product knowledge base (RAG) with the query_product_catalogue tool, remembers the last messages per customer, and replies directly on WhatsApp.\n\n## Setup\n1. Run \"Populate Product Catalogue\" once (or whenever your catalogue changes) after filling the brochure URL in \"Knowledge Base Settings\".\n2. Fill every field in the \"Configuration\" node: your WhatsApp phone number ID, the models to use, and the sales agent system prompt.\n3. Activate the workflow so WhatsApp can reach the trigger.\n\n## Requirements\n* A WhatsApp Business Cloud account and phone number\n* An OpenAI account (Whisper transcription, GPT Vision, GPT chat model, embeddings)\n* A Google Gemini (PaLM) API key for video understanding\n\n## Customization\n* Replace the in-memory vector store with Qdrant or Pinecone for persistence in production.\n* Add more branches (documents, location, contacts) to \"Route by Message Type\" if you need to support them.\n* Tune \"vision_model\" / \"video_model\" / \"openai_model\" directly in the Configuration node - no need to touch any other node.\n\nNeed help customizing?\nContact me for consulting and support : [Linkedin](https://www.linkedin.com/in/doctor-firass/)\n\n# MY NEW YOUTUBE CHANNEL\n\ud83d\udc49 [Subscribe to my new YouTube channel](https://www.youtube.com/@DrFiras_AI). Here I'll share videos and Shorts with practical tutorials and FREE templates for n8n.\n\n[![The AI Doctor](https://www.dr-firas.com/the-ai-doctor.png)](https://www.youtube.com/@DrFiras_AI)"
      },
      "typeVersion": 1
    },
    {
      "id": "d8c87415-2ab5-4237-87b2-ef5722a10be4",
      "name": "Sticky Note 44a50c73",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        -832
      ],
      "parameters": {
        "color": 7,
        "width": 720,
        "height": 400,
        "content": "## 1. Build the product knowledge base\nRun this manually whenever your catalogue changes. Downloads the brochure PDF, splits it, and embeds it into the shared in-memory vector store."
      },
      "typeVersion": 1
    },
    {
      "id": "4ddb4278-4ec4-44c5-a37a-94678ab3ffa0",
      "name": "Sticky Note 7556b9b0",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1568,
        64
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 300,
        "content": "## 2. Receive WhatsApp messages\nCentralize every adjustable setting here: models, phone number ID, system prompt."
      },
      "typeVersion": 1
    },
    {
      "id": "a04969a5-4335-4558-8a9d-4161c8f8dd28",
      "name": "Sticky Note b3e4f762",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1136,
        -368
      ],
      "parameters": {
        "color": 7,
        "width": 900,
        "height": 508,
        "content": "## 3. Understand any message format\nAudio is transcribed with Whisper, images are described with GPT Vision, videos are described with Gemini. Text passes through untouched. Anything else gets a polite \"unsupported format\" reply."
      },
      "typeVersion": 1
    },
    {
      "id": "2df9b2f6-72cf-489e-832b-3be1f12ce95e",
      "name": "Sticky Note 4bf86b24",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        496
      ],
      "parameters": {
        "color": 7,
        "width": 700,
        "height": 260,
        "content": "## 4. AI Sales Agent with RAG + memory\nQueries the product knowledge base built in step 1, remembers the last messages per customer phone number, and replies on WhatsApp."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": true,
    "executionOrder": "v1"
  },
  "versionId": "f982d496-5d11-44f2-bd24-ac615b59410f",
  "nodeGroups": [],
  "connections": {
    "Configuration": {
      "main": [
        [
          {
            "node": "Route by Message Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Sales Agent": {
      "main": [
        [
          {
            "node": "Reply to Customer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WhatsApp Trigger": {
      "main": [
        [
          {
            "node": "Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Sales Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "query_product_catalogue",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Download Audio File": {
      "main": [
        [
          {
            "node": "Transcribe Voice Note",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image File": {
      "main": [
        [
          {
            "node": "Analyze Image with GPT Vision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Video File": {
      "main": [
        [
          {
            "node": "Describe Video with Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Audio Media URL": {
      "main": [
        [
          {
            "node": "Download Audio File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Image Media URL": {
      "main": [
        [
          {
            "node": "Download Image File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Video Media URL": {
      "main": [
        [
          {
            "node": "Download Video File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Agent Input": {
      "main": [
        [
          {
            "node": "AI Sales Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Brochure Text": {
      "ai_textSplitter": [
        [
          {
            "node": "Load Brochure Document",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Extract Brochure Text": {
      "main": [
        [
          {
            "node": "Insert Product Catalogue into Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Message Type": {
      "main": [
        [
          {
            "node": "Get Audio Media URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Image Media URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Video Media URL",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare Agent Input",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Reply Unsupported Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe Voice Note": {
      "main": [
        [
          {
            "node": "Prepare Agent Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load Brochure Document": {
      "ai_document": [
        [
          {
            "node": "Insert Product Catalogue into Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings for Indexing": {
      "ai_embedding": [
        [
          {
            "node": "Insert Product Catalogue into Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Knowledge Base Settings": {
      "main": [
        [
          {
            "node": "Download Product Brochure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "query_product_catalogue": {
      "ai_tool": [
        [
          {
            "node": "AI Sales Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings for Retrieval": {
      "ai_embedding": [
        [
          {
            "node": "Product Catalogue (Retrieve)",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Per-Customer Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Sales Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Download Product Brochure": {
      "main": [
        [
          {
            "node": "Extract Brochure Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Describe Video with Gemini": {
      "main": [
        [
          {
            "node": "Prepare Agent Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Populate Product Catalogue": {
      "main": [
        [
          {
            "node": "Knowledge Base Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Product Catalogue (Retrieve)": {
      "ai_vectorStore": [
        [
          {
            "node": "query_product_catalogue",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Image with GPT Vision": {
      "main": [
        [
          {
            "node": "Prepare Agent Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow indexes a product brochure PDF into an in-memory vector store and then responds to incoming WhatsApp text, voice, image, and video messages using OpenAI and Google Gemini, with per-customer chat memory and retrieval-augmented answers from the catalogue. Runs…

Source: https://n8n.io/workflows/17765/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Inquiry-Agent. Uses @digitalocean/n8n-nodes-digitalocean-gradient-serverless-inference, stopAndError, googleDocs, gmail. Event-driven trigger; 88 nodes.

@Digitalocean/N8N Nodes Digitalocean Gradient Serverless Inference, Stop And Error, Google Docs +12
AI & RAG

📌 Overview

Redis, WhatsApp, OpenAI Chat +12
AI & RAG

Alfred (funcional). Uses gmailTool, googleCalendarTool, gmail, embeddingsOpenAi. Event-driven trigger; 83 nodes.

Gmail Tool, Google Calendar Tool, Gmail +24
AI & RAG

Your AI workforce is ready. Are you?

Google Sheets Tool, Mcp Trigger, Google Drive +29
AI & RAG

Inquiry-Agent. Uses @digitalocean/n8n-nodes-digitalocean-gradient-serverless-inference, stopAndError, googleDocs, gmail. Event-driven trigger; 80 nodes.

@Digitalocean/N8N Nodes Digitalocean Gradient Serverless Inference, Stop And Error, Google Docs +11