From d003bbde3801d8c816575ca3549fa3e79f37beac Mon Sep 17 00:00:00 2001 From: nusquama Date: Thu, 13 Nov 2025 14:51:44 +0100 Subject: [PATCH] creation --- ...d_whatsapp_bot_using_google_drive_and_pinecone_vector_db.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 workflows/Create an AI-Powered WhatsApp Bot using Google Drive and Pinecone Vector DB-4838/create_an_ai-powered_whatsapp_bot_using_google_drive_and_pinecone_vector_db.json diff --git a/workflows/Create an AI-Powered WhatsApp Bot using Google Drive and Pinecone Vector DB-4838/create_an_ai-powered_whatsapp_bot_using_google_drive_and_pinecone_vector_db.json b/workflows/Create an AI-Powered WhatsApp Bot using Google Drive and Pinecone Vector DB-4838/create_an_ai-powered_whatsapp_bot_using_google_drive_and_pinecone_vector_db.json new file mode 100644 index 000000000..d340346f6 --- /dev/null +++ b/workflows/Create an AI-Powered WhatsApp Bot using Google Drive and Pinecone Vector DB-4838/create_an_ai-powered_whatsapp_bot_using_google_drive_and_pinecone_vector_db.json @@ -0,0 +1 @@ +{"meta":{"instanceId":"e42ff03bc515cd7f9edc081a89072ca1985132e0d4a1cdabe6c26855a252768f","templateId":"1960","templateCredsSetupCompleted":true},"nodes":[{"id":"1f2bb917-6d65-4cfa-9474-fc3b19a8c3bd","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[60,200],"parameters":{"color":7,"width":1218,"height":627,"content":"## Load Information from a Google Drive File into a Pinecone Vector Database\nFetch the file from Google Drive, split it into chunks, and insert the chunks into a Pinecone index."},"typeVersion":1},{"id":"ab577f4d-8906-4e0c-bc62-e8a4b2610551","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[-500,260],"parameters":{"width":480,"height":145,"content":"## Step 1: Connect Your Google Drive \nFollow the instructions in the official n8n docs to set up your Google Drive credentials: \n๐Ÿ‘‰ [Google Drive Credentials Guide](https://docs.n8n.io/integrations/builtin/credentials/google/)"},"typeVersion":1},{"id":"742beb54-8b89-49a3-afe5-fd7e73b37044","name":"Default Data Loader","type":"@n8n/n8n-nodes-langchain.documentDefaultDataLoader","position":[720,500],"parameters":{"options":{},"dataType":"binary"},"typeVersion":1},{"id":"f75e31e9-f752-45d1-bc44-75097ec85ce6","name":"Recursive Character Text Splitter","type":"@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter","position":[800,620],"parameters":{"options":{},"chunkSize":3000,"chunkOverlap":200},"typeVersion":1},{"id":"bac883c8-4c1f-466b-b20f-d0fdf6acfc42","name":"Embeddings OpenAI","type":"@n8n/n8n-nodes-langchain.embeddingsOpenAi","position":[600,500],"parameters":{"options":{}},"credentials":{"openAiApi":{"id":"wsxLB7on237QOp5h","name":"Open AI credentials"}},"typeVersion":1.2},{"id":"430f667b-9d23-4bb9-b87d-5d9e8ae84df3","name":"Simple Memory","type":"@n8n/n8n-nodes-langchain.memoryBufferWindow","position":[1500,1180],"parameters":{"sessionKey":"={{ $json.fromNumber }}","sessionIdType":"customKey","contextWindowLength":20},"typeVersion":1.3},{"id":"1a2e6717-a220-4f39-8ae9-1921cbff5715","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[1260,1200],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4o-mini"},"options":{}},"credentials":{"openAiApi":{"id":"wsxLB7on237QOp5h","name":"Open AI credentials"}},"typeVersion":1.2},{"id":"7e03e08d-0b61-4054-aa14-8f839d7f0565","name":"Question & Answer","type":"@n8n/n8n-nodes-langchain.agent","position":[1380,960],"parameters":{"text":"=Sender Name: {{ $json.fromName }}\nMessage: {{ $json.textBody }}","options":{"systemMessage":"=Agent Name: Van\nIdentity:\nYou are a friendly AI agent named Van. You are professional digital sales agent for GrayBox, a company specializing in Structural Insulated Panels (SIP) construction. Van immediately identifies as a digital assistant and exists to serve prospective and current customers of GrayBox with accurate, helpful, and engaging information that supports decision-making and promotes trust.\n\nYour Personality & Style\nTone: Clear, concise, professionalโ€”but always friendly and approachable. Talk in first person representing the company.\n\n\nIf user send link don't mention that you cannot read the link. Explain who you are, and ask questions to engage the conversation.. Your goal is to sell our solution. \n\nResponse Style:\n\n\nGreet, answer directly, then offer further help.\nAddress people by their names\n\n\n\nAvoid fluff and unnecessary formalities (unless it's the first message).\n\n\nMaintain consistent use of brand tone: Speed, Quality, Efficiency, Value.\n\n\nBrand Voice Keywords: Speed, Energy Efficiency, Durability, Mold-Free, Earthquake-Resistant, Friendly, Human.\n\n\n\n๐Ÿ” Scope of the Agent (What Van Can Do)\nAnswer questions about pricing, materials, SIP benefits, timeline, logistics, and project experience.\n\n\nExplain how GrayBox SIP construction works (in simple, non-technical language).\n\n\nShare relevant visual or catalog links.\n\n\nGuide users to:\n\n\nSchedule a 15-min discovery call: https://calendar.app.google/gJYWhw3LCJBPywGW6\n\n\nVisit projects like Nuanu City or Luna Beach Club.\n\n\nSubmit project materials via form: https://forms.gle/5AddUQbqveFPsTDQ9\nView portfolio: https://graybox.site/graybox-0-0 \n\n๐Ÿง  Core Behaviors & Instructions\nAlways say cost starts at 3 million IDR/mยฒ for core and shell.\n\n\nPromote:\n\n\n1-month build time (from materials delivery).\n\n\nCost-effectiveness vs. traditional methods (20โ€“30% cheaper, 4x faster).\n\n\nEnergy savings and safety (mold-free, earthquake-resistant).\n\n\nWhen users upload a file/image: respond with a friendly message and prompt them to fill the quotation form.\n\n\nIf asked about pictures, share: https://graybox.site/graybox-0-0\n\n\nFor meetings or calls: Share this link โ†’ https://calendar.app.google/rDzpGdMb3WmGsLFz6\n\n\nFor human contact or visit coordination: Provide Andrea's WhatsApp: +1 650 866 5016\n\n\nIf user says โ€œOK, Iโ€™ll visit,โ€ connect directly to Andrea.\n\n\n\n๐ŸŒ Contact & Location\nOffice: Uluwatu, Bali โ€“ https://maps.app.goo.gl/nT7VDTtLQYSztN7s9\nFactory: Lombok\n\n\nWhatsApp (Andrea): +1 650 866 5016 (only if meeting/human contact requested)\n\n๐Ÿš€ First-Time Message (Greeting Script)\nDiscover GrayBox: Your dream home starts here!\n We deliver core and shell construction in under a month for developers, builders, and DIY home enthusiasts. Save time and money while enjoying a mold-free, energy-efficient, and earthquake-resistant home. All for just 3 million IDR per mยฒ!\n Build smarter with GrayBox today. \n\nNEVER MAKEUP INFORMATION. \nUSE {{ $json.context }} TO ANSWER QUESTIONS"},"promptType":"define"},"typeVersion":1.8},{"id":"56d150ba-9b98-4dbb-9f74-5379344d2257","name":"Respond to Whatsapp Webhook","type":"n8n-nodes-base.respondToWebhook","position":[1720,960],"parameters":{"options":{}},"typeVersion":1.2},{"id":"5d1d4427-bdab-49ef-acbc-084a2d69632f","name":"Prepare chunks","type":"n8n-nodes-base.code","position":[1200,960],"parameters":{"jsCode":"let out = \"\"\nfor (const i in $input.all()) {\n let itemText = \"--- CHUNK \" + i + \" ---\\n\"\n itemText += $input.all()[i].json.document.pageContent + \"\\n\"\n itemText += \"\\n\"\n out += itemText\n}\n\nreturn {\n 'context': out,\n 'textBody': $('Listen to Whatsapp webhook').first().json.body.textBody,\n 'fromNumber': $('Listen to Whatsapp webhook').first().json.body.fromNumber,\n 'fromName': $('Listen to Whatsapp webhook').first().json.body.fromName\n};"},"typeVersion":2},{"id":"eba8eaca-915f-4257-901e-c6f56ddf8f0b","name":"Get top chunks matching query","type":"@n8n/n8n-nodes-langchain.vectorStorePinecone","position":[840,960],"parameters":{"mode":"load","topK":"={{ $json.chunks }}","prompt":"={{ $json.body.textBody }}","options":{},"pineconeIndex":{"__rl":true,"mode":"list","value":"3vansales","cachedResultName":"3vansales"}},"credentials":{"pineconeApi":{"id":"2ZUBIWHNyYqKmASZ","name":"PineconeApi account 2"}},"typeVersion":1},{"id":"afb0bb4f-8370-4a7a-be3c-8449f5b890d5","name":"Set max chunks to send to model","type":"n8n-nodes-base.set","position":[620,960],"parameters":{"options":{},"assignments":{"assignments":[{"id":"33f4addf-72f3-4618-a6ba-5b762257d723","name":"chunks","type":"number","value":4}]},"includeOtherFields":true},"typeVersion":3.4},{"id":"d9aa944d-594f-49ad-a40e-123aa42621e3","name":"Embeddings OpenAI2","type":"@n8n/n8n-nodes-langchain.embeddingsOpenAi","position":[840,1180],"parameters":{"options":{}},"credentials":{"openAiApi":{"id":"wsxLB7on237QOp5h","name":"Open AI credentials"}},"typeVersion":1.2},{"id":"15ff0895-9bb2-47d3-92fb-d0d8d1f4a981","name":"Check for individual or group messages","type":"n8n-nodes-base.if","position":[340,980],"parameters":{"options":{},"conditions":{"options":{"version":2,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"5a946369-3f38-4dcb-b5d9-3d24024d08b0","operator":{"name":"filter.operator.equals","type":"string","operation":"equals"},"leftValue":"={{ $json.body.threadType }}","rightValue":"individual"}]}},"typeVersion":2.2},{"id":"32df5bff-1b09-4f1c-9344-7d9ae748d917","name":"Listen to Whatsapp webhook","type":"n8n-nodes-base.webhook","position":[120,980],"webhookId":"d1629cd7-6e05-413a-bac0-3c435d4e43b9","parameters":{"path":"d1629cd7-6e05-413a-bac0-3c435d4e43b9","options":{},"httpMethod":"POST","responseMode":"responseNode"},"typeVersion":2},{"id":"8b493fb6-8013-453f-8aa5-1ee9c9d06cd9","name":"Sticky Note1","type":"n8n-nodes-base.stickyNote","position":[60,860],"parameters":{"color":7,"width":2034,"height":627,"content":"### Chat with Your Vector Database Using a Custom WhatsApp Webhook (with Group Support)\nThis workflow takes incoming WhatsApp messages, embeds the content, retrieves relevant chunks from your vector store, and passes them to the model to generate a response."},"typeVersion":1},{"id":"d97920ad-6b36-4981-8b9d-9d470b5c769a","name":"Download the file from Google Drive","type":"n8n-nodes-base.googleDrive","position":[360,280],"parameters":{"fileId":{"__rl":true,"mode":"id","value":"={{ $json.id }}"},"options":{},"operation":"download","authentication":"serviceAccount"},"credentials":{"googleApi":{"id":"10HrAmRHIIsSrT6B","name":"Google Drive account"}},"typeVersion":3},{"id":"0a6f8b88-9c62-4e3e-82cb-a7028bdcac45","name":"Index Pinecone Vector Store","type":"@n8n/n8n-nodes-langchain.vectorStorePinecone","position":[620,280],"parameters":{"mode":"insert","options":{"clearNamespace":true},"pineconeIndex":{"__rl":true,"mode":"list","value":"3vansales","cachedResultName":"3vansales"}},"credentials":{"pineconeApi":{"id":"2ZUBIWHNyYqKmASZ","name":"PineconeApi account 2"}},"typeVersion":1},{"id":"34f220a8-12d7-480f-9954-11d777359d27","name":"Every minute check if file is updated","type":"n8n-nodes-base.googleDriveTrigger","position":[140,280],"parameters":{"pollTimes":{"item":[{"mode":"everyMinute"}]},"triggerOn":"specificFile","fileToWatch":{"__rl":true,"mode":"list","value":"1-AZrzOeeZFATUsY-xGD0m_oYkq4ekiSHn3e8Aof9pyU","cachedResultUrl":"https://docs.google.com/document/d/1-AZrzOeeZFATUsY-xGD0m_oYkq4ekiSHn3e8Aof9pyU/edit?usp=drivesdk","cachedResultName":"Knowladge Base FlatPack"},"authentication":"serviceAccount"},"credentials":{"googleApi":{"id":"10HrAmRHIIsSrT6B","name":"Google Drive account"}},"typeVersion":1},{"id":"f9016922-f6a4-417a-8586-bf0647f1e17b","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-500,440],"parameters":{"width":480,"height":325,"content":"## Step 2: Set Up Your Pinecone Vector Database \n1. Log in to your Pinecone account and create an index: \n๐Ÿšจ Dimensions: 1536\n2. In the workflow, make sure to select this index in **both Pinecone nodes**.\n3. Click \"Test Workflow\" to load your data into the vector database.\n4. Modify the connected document to fit your use case.\n\n**Note:** Once the bot is live, the vector database updates automatically every minute when changes are made. You can customize this update frequency if needed."},"typeVersion":1},{"id":"638760a3-51da-4b88-ace5-73e67e6e6e98","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[-500,800],"parameters":{"color":2,"width":480,"height":205,"content":"## Step 3: Request Access to the Custom WhatsApp Webhook\n1. Fill out this form to request access: \n๐Ÿ‘‰ [Request Access](https://docs.google.com/forms/d/e/1FAIpQLSd-bW5tSJu_rRvJ4NmFrxXSAwaNbO7MbGJtUIS-mBA23B7BWQ/viewform?usp=dialog)\n2. Youโ€™ll receive a confirmation message on WhatsApp to verify your connection.\n3. Customize the **AI agent's system prompt** to match your use case."},"typeVersion":1},{"id":"a9092d34-7406-4d7e-8fe4-ce392aae9c5a","name":"Sticky Note5","type":"n8n-nodes-base.stickyNote","position":[-500,1040],"parameters":{"color":2,"width":480,"height":345,"content":"## Step 4: Test the WhatsApp Integration\n#### One-on-One Testing\n1. Use a different WhatsApp number to send a message to the connected number.\n2. You should receive a reply from the AI based on:\n โœ… Your system prompt\n โœ… The content in your vector database\n#### Group Testing\n1. Add the bot to a WhatsApp group. \n2. The bot will only reply when tagged or addressed directly, to avoid responding to every message in the group"},"typeVersion":1},{"id":"8b338d65-cd79-41d5-b4c4-e76534d8b19c","name":"Sticky Note6","type":"n8n-nodes-base.stickyNote","position":[-1160,260],"parameters":{"width":480,"height":645,"content":"## ๐Ÿ”‘ Key Benefits\n#### 1. No Meta Account Needed\n๐Ÿ‘‰ Works with regular WhatsApp numbers โ€” no Facebook Business setup or official API required.\n\n#### 2. Group Chat Support\n๐Ÿ‘‰ Add the bot to any group. It only replies when tagged to avoid cluttering conversations.\n\n#### 3. Custom AI Responses\n๐Ÿ‘‰ Connect your own documents (via Google Drive + Pinecone) to deliver context-aware replies.\n\n#### 4. Auto-Syncing Knowledge Base\n๐Ÿ‘‰ Updates every minute when your source document changes โ€” always fresh, always relevant.\n\n#### Use cases are endless\nโœ… Customer support\nโœ… Internal team assistant\nโœ… Community group bot\nโœ… Personal knowledge brain\n\nAnd so on "},"typeVersion":1}],"pinData":{},"connections":{"Simple Memory":{"ai_memory":[[{"node":"Question & Answer","type":"ai_memory","index":0}]]},"Prepare chunks":{"main":[[{"node":"Question & Answer","type":"main","index":0}]]},"Embeddings OpenAI":{"ai_embedding":[[{"node":"Index Pinecone Vector Store","type":"ai_embedding","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"Question & Answer","type":"ai_languageModel","index":0}]]},"Question & Answer":{"main":[[{"node":"Respond to Whatsapp Webhook","type":"main","index":0}]]},"Embeddings OpenAI2":{"ai_embedding":[[{"node":"Get top chunks matching query","type":"ai_embedding","index":0}]]},"Default Data Loader":{"ai_document":[[{"node":"Index Pinecone Vector Store","type":"ai_document","index":0}]]},"Listen to Whatsapp webhook":{"main":[[{"node":"Check for individual or group messages","type":"main","index":0}]]},"Get top chunks matching query":{"main":[[{"node":"Prepare chunks","type":"main","index":0}]]},"Set max chunks to send to model":{"main":[[{"node":"Get top chunks matching query","type":"main","index":0}]]},"Recursive Character Text Splitter":{"ai_textSplitter":[[{"node":"Default Data Loader","type":"ai_textSplitter","index":0}]]},"Download the file from Google Drive":{"main":[[{"node":"Index Pinecone Vector Store","type":"main","index":0}]]},"Every minute check if file is updated":{"main":[[{"node":"Download the file from Google Drive","type":"main","index":0}]]},"Check for individual or group messages":{"main":[[{"node":"Set max chunks to send to model","type":"main","index":0}]]}}} \ No newline at end of file