This workflow corresponds to n8n.io template #10033 — we link there as the canonical source.
This workflow follows the Agent → Google Gemini Embeddings 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 →
{
"meta": {
"templateId": "5385"
},
"nodes": [
{
"id": "ca19699e-15fd-4366-8aa0-2f26a8f0b2bb",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
720,
496
],
"parameters": {
"text": "={{ $json.messages[0].text.body }}\n{{ $json.candidates[0].content.parts[0].text }}",
"options": {
"systemMessage": "=You are currently talking to {{ $json.contacts[0].profile.name }}.\n\n***IMMEDIATE AND ABSOLUTE RULES:***\n***1. LANGUAGE: Respond ONLY in English. If the user's input is in English, respond in English.\n***2. RESPONSE START: Your response MUST BEGIN DIRECTLY WITH THE ANSWER OR THE PRODUCT RECOMMENDATION. DO NOT USE ANY FORM OF THANK YOU, GREETING, OR ACKNOWLEDGEMENT OF THE USER'S INPUT AT THE START OF YOUR RESPONSE. THIS IS A CRITICAL PROFESSIONAL REQUIREMENT.***\n\nYou are a friendly and professional virtual receptionist for Superclean Middle East Chemicals & Cleaning Materials L.L.C. Your primary function is to provide information about cleaning and hygiene products, take quote requests, guide customers, and collect essential details. You achieve this by directly responding to inquiries.\n\nYou have been provided with relevant information from our knowledge base/vector store to help you answer the user's question. Use this information directly and integrate it seamlessly into your response. Do not acknowledge the source of this information (e.g., \"based on our product information\" or \"from the knowledge base\").\n\n**Regarding Product Recommendations:**\n* **Prioritize a direct product recommendation immediately.** Do not ask multiple clarifying questions upfront.\n* If multiple products *could* match, provide a brief list of the top 2-3 most relevant options based on the initial query.\n* If absolutely necessary to clarify for a *better* recommendation, ask **only one, most crucial question** after providing an initial recommendation. Do not engage in a back-and-forth questioning session.\n\nAlways maintain a polite, business-casual tone with clarity. If you don\u2019t know an answer, redirect or creatively deflect the question while offering help. If a product-specific question is asked that isn't in your script, offer to pass the inquiry to a specialist. Speak clearly and naturally.\nDon't mention \"based on our product information\" to the user.\n"
},
"promptType": "define"
},
"typeVersion": 2
},
{
"id": "29da8178-4c2b-4da6-87e3-87bbeb51f4d4",
"name": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
656,
736
],
"parameters": {
"options": {}
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "e48c4c7a-6285-497c-8a65-3d7b132cadee",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
784,
736
],
"parameters": {
"sessionKey": "={{ $('WhatsApp Trigger').item.json.contacts[0].wa_id }}",
"sessionIdType": "customKey",
"contextWindowLength": 20
},
"typeVersion": 1.3
},
{
"id": "9b267a71-5eff-4a09-9b00-26c1924d60f2",
"name": "Answer questions with a vector store",
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
"position": [
912,
736
],
"parameters": {
"description": "returns documents related to the companies information, products and services"
},
"typeVersion": 1.1
},
{
"id": "56ee6e8c-2087-4b0a-8182-d4e09ca1070f",
"name": "Pinecone Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
"position": [
816,
944
],
"parameters": {
"options": {},
"pineconeIndex": {
"__rl": true,
"mode": "list",
"value": "superclean",
"cachedResultName": "superclean"
}
},
"credentials": {
"pineconeApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "800013cf-a0fc-4fc9-9aab-e7fca168ce07",
"name": "Google Gemini Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
1104,
944
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.0-flash"
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "5356b124-d55b-4a95-bebf-da34d258e4b5",
"name": "Embeddings Google Gemini",
"type": "@n8n/n8n-nodes-langchain.embeddingsGoogleGemini",
"position": [
896,
1152
],
"parameters": {},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "60bbd3ad-9cc5-4314-accf-63443742566f",
"name": "WhatsApp Trigger",
"type": "n8n-nodes-base.whatsAppTrigger",
"position": [
-880,
480
],
"parameters": {
"options": {},
"updates": [
"messages"
]
},
"credentials": {
"whatsAppTriggerApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "62fbdacb-50a4-4ca2-87e1-ecb4277e13fc",
"name": "Get Audio URL",
"type": "n8n-nodes-base.whatsApp",
"position": [
-464,
304
],
"parameters": {
"resource": "media",
"operation": "mediaUrlGet",
"mediaGetId": "={{ $json.messages[0].audio.id }}"
},
"credentials": {
"whatsAppApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "4e830f8a-a674-4dd7-ad32-39671f5f23cf",
"name": "Audio Download",
"type": "n8n-nodes-base.httpRequest",
"position": [
-240,
304
],
"parameters": {
"url": "={{ $json.url }}",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth"
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "f1d1d1ab-d058-4852-8f74-5ac60a8e49e0",
"name": "Audio Prompt",
"type": "n8n-nodes-base.set",
"position": [
400,
304
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "49a3d92d-3bc6-4856-a15e-2ba2afa0ace8",
"name": "candidates[0].content.parts[0].text",
"type": "string",
"value": "={{ $json.candidates[0].content.parts[0].text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "6de808f7-75a9-4bcf-9bb9-c5cacaa4c128",
"name": "Send message",
"type": "n8n-nodes-base.whatsApp",
"position": [
1312,
496
],
"parameters": {
"textBody": "={{ $json.output }}",
"operation": "send",
"phoneNumberId": "723548604171403",
"additionalFields": {},
"recipientPhoneNumber": "={{ $('WhatsApp Trigger').item.json.messages[0].from }}"
},
"credentials": {
"whatsAppApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "87c6c269-cf17-4645-ac05-0c8872895d00",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1200,
320
],
"parameters": {
"color": 4,
"width": 256,
"height": 384,
"content": "\n\ud83d\udcac Workflow Overview\nThis workflow acts as an AI-powered WhatsApp agent that can handle both text and voice messages.\nWhen a customer sends a message, it automatically detects the type, processes it, and responds using an integrated AI model.\n\nFor text queries, it directly uses the AI Agent.\nFor voice messages, it first transcribes the audio using Google Gemini, then passes the transcription to the AI for understanding and response."
},
"typeVersion": 1
},
{
"id": "17502cf4-64bc-4726-83ce-351af9b487b3",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-240,
-48
],
"parameters": {
"color": 3,
"width": 528,
"height": 272,
"content": "\ud83c\udfa7 Voice Message Handling\nWhen a customer sends a voice note, the workflow:\n\nRetrieves the audio file from WhatsApp.\n\nConverts it to Base64 format.\n\nSends it to Google Gemini\u2019s API for transcription.\n\nUses the transcribed text as input for the AI Agent.\n\nThis allows the bot to understand and reply to spoken questions just like regular text."
},
"typeVersion": 1
},
{
"id": "a018416b-d5fe-4509-b5c0-920282eef62d",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
704,
176
],
"parameters": {
"color": 5,
"width": 368,
"height": 224,
"content": "\ud83e\udde0 AI Agent + Knowledge Base\nThe AI Agent is connected to Google Gemini and a Pinecone vector database that stores company product and service information.\nIt uses this data to answer questions accurately, make recommendations, or handle quote requests.\n\nThe AI remembers recent messages using the Memory node, allowing for context-aware, human-like conversations."
},
"typeVersion": 1
},
{
"id": "b47ef7d2-6885-42e5-a37c-b8e1c3d5ecb1",
"name": "Audio/Message",
"type": "n8n-nodes-base.switch",
"position": [
-688,
480
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Audio",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "5acd4de2-655d-4978-af3a-814f4201c651",
"operator": {
"type": "object",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.messages[0].audio }}",
"rightValue": ""
}
]
},
"renameOutput": true
},
{
"outputKey": "Text",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "94d38699-c1b5-4051-b630-a460edaf4259",
"operator": {
"type": "object",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.messages[0].text }}",
"rightValue": ""
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "d2038571-24f9-42d7-9412-09c6ad12efa9",
"name": "Audio Convert",
"type": "n8n-nodes-base.code",
"position": [
0,
304
],
"parameters": {
"jsCode": "const binaryKey = 'data'; // from your node, it's named \"data\"\nconst binaryData = items[0].binary[binaryKey].data;\nconst mimeType = items[0].binary[binaryKey].mimeType || 'audio/ogg';\n\nreturn [\n {\n json: {\n base64Audio: binaryData,\n mimeType\n }\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "2d5a44f6-7fe5-4363-966f-f8bfb7ad9db4",
"name": "Gemini speech to text",
"type": "n8n-nodes-base.httpRequest",
"position": [
208,
304
],
"parameters": {
"method": "POST",
"options": {},
"jsonBody": "={\n \"contents\": [\n {\n \"parts\": [\n {\n \"inlineData\": {\n \"mimeType\": \"{{ $json.mimeType }}\",\n \"data\": \"{{ $json.base64Audio }}\"\n }\n },\n {\n \"text\": \"Transcribe this audio and return only the plain spoken words.\"\n }\n ]\n }\n ]\n}\n",
"sendBody": true,
"specifyBody": "json"
},
"typeVersion": 4.2
}
],
"connections": {
"AI Agent": {
"main": [
[
{
"node": "Send message",
"type": "main",
"index": 0
}
]
]
},
"Audio Prompt": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Audio Convert": {
"main": [
[
{
"node": "Gemini speech to text",
"type": "main",
"index": 0
}
]
]
},
"Audio/Message": {
"main": [
[
{
"node": "Get Audio URL",
"type": "main",
"index": 0
}
],
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Get Audio URL": {
"main": [
[
{
"node": "Audio Download",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Audio Download": {
"main": [
[
{
"node": "Audio Convert",
"type": "main",
"index": 0
}
]
]
},
"WhatsApp Trigger": {
"main": [
[
{
"node": "Audio/Message",
"type": "main",
"index": 0
}
]
]
},
"Gemini speech to text": {
"main": [
[
{
"node": "Audio Prompt",
"type": "main",
"index": 0
}
]
]
},
"Pinecone Vector Store": {
"ai_vectorStore": [
[
{
"node": "Answer questions with a vector store",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"Embeddings Google Gemini": {
"ai_embedding": [
[
{
"node": "Pinecone Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Google Gemini Chat Model1": {
"ai_languageModel": [
[
{
"node": "Answer questions with a vector store",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Answer questions with a vector store": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"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.
googlePalmApihttpHeaderAuthpineconeApiwhatsAppApiwhatsAppTriggerApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This project is an AI-powered WhatsApp virtual agent built using n8n, designed to handle both text and voice-based customer messages automatically. The workflow integrates Google Gemini, Pinecone, and the WhatsApp Business API to provide intelligent, context-aware responses that…
Source: https://n8n.io/workflows/10033/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
The "WhatsApp Productivity Assistant with Memory and AI Imaging" is a comprehensive n8n workflow that transforms your WhatsApp into a powerful, multi-talented AI assistant. It's designed to handle a w
Building Your First Whatsapp Chatbot. Uses whatsAppTrigger, lmChatOpenAi, memoryBufferWindow, toolVectorStore. Event-driven trigger; 28 nodes.
This n8n template builds a simple WhatsApp chabot acting as a Sales Agent. The Agent is backed by a product catalog vector store to better answer user's questions.
WhatsApp Agent. Uses whatsAppTrigger, agent, memoryBufferWindow, whatsApp. Event-driven trigger; 27 nodes.
This workflow turns your WhatsApp number into an intelligent AI-powered Sales Agent that answers product queries using real data extracted from a PDF brochure. It loads a product brochure via HTTP Req