See llms.txt for all machine-readable content.

MongoDB and WhatsApp Business Cloud integration

Save yourself the work of writing custom integrations for MongoDB and WhatsApp Business Cloud and use n8n instead. Build adaptable and scalable Development, Data & Storage, workflows that work with your technology stack. All within a building experience you will love.

How to connect MongoDB and WhatsApp Business Cloud

Create a new workflow and add the first step

In n8n, click the "Add workflow" button in the Workflows tab to create a new workflow. Add the starting point – a trigger on when your workflow should run: an app event, a schedule, a webhook call, another workflow, an AI chat, or a manual trigger. Sometimes, the HTTP Request node might already serve as your starting point.

MongoDB and WhatsApp Business Cloud integration: Create a new workflow and add the first step

Build a WhatsApp AI shopping bot with virtual try-on using Gemini and GPT

Build a WhatsApp AI shopping bot with virtual try-on using Gemini πŸ“Œ Overview This workflow fully automates your T-shirt store's WhatsApp shopping experience using GPT for intent detection, MongoDB Atlas for vector-based product search, Redis for session management, and Google Gemini for AI-powered virtual try-on. It automatically handles customer messages, finds relevant products, processes orders, and generates realistic try-on images β€” all inside WhatsApp, with no app or website required. Customers can search for T-shirts, place orders, and virtually try on items in a single conversation. Redis ensures fast product caching and session tracking. MongoDB Atlas stores the product catalog and orders. Google Sheets logs every order automatically. Gemini generates realistic try-on images from customer selfies. This workflow eliminates manual order handling, improves customer experience, and gives store owners full visibility into orders and product searches. βš™οΈ How it works This workflow runs automatically when a customer sends a WhatsApp message. πŸ” Product search πŸ’¬ Receives the customer message via WhatsApp Business API 🧠 GPT classifies the intent as product search, recommendation, or general query ⚑ Checks Redis cache for existing results (TTL: 1 hour) πŸ”Ž On a cache miss, runs MongoDB Atlas vector search using OpenAI embeddings πŸ›οΈ Sends matching products as interactive WhatsApp cards with Order Now and Virtual Try-On buttons πŸ›’ Order flow πŸ‘† Triggered when the customer taps the Order Now button πŸ“¦ AI agent fetches product details from MongoDB πŸ—ƒοΈ Creates a new order document in MongoDB πŸ“Š Logs the order to Google Sheets automatically βœ… Sends an order confirmation message to the customer via WhatsApp πŸ‘— Virtual try-on flow πŸ‘† Triggered when the customer taps the Virtual Try-On button πŸ’Ύ Stores the product ID in Redis (TTL: 10 minutes) πŸ“Έ Prompts the customer to send a clear front-facing selfie πŸ” Gemini validates that exactly one real person is in the photo πŸ–ΌοΈ Merges the product image and selfie and generates a realistic try-on image πŸ“© Sends the try-on result back to the customer via WhatsApp πŸ—‘οΈ Clears the Redis context after delivery πŸ›  Setup steps Import this workflow into n8n Connect your WhatsApp Business Cloud API credentials Connect your OpenAI API credentials (for embeddings and GPT model) Connect your Google Gemini API credentials Connect your MongoDB Atlas credentials and create a vector index named ShopingBot on the product collection Connect your Redis credentials Connect your Google Drive service account credentials Connect your Google Sheets service account credentials Import your product catalog with embeddings into the MongoDB product collection Activate the workflow The workflow will run automatically when customers send WhatsApp messages. πŸš€ Features 🧠 AI-powered shopping πŸ€– Automatically classifies customer intent using GPT πŸ”Ž Semantic product search using OpenAI embeddings and MongoDB Atlas vector search ⚑ Redis caching for ultra-fast repeated search results (TTL: 1 hour) πŸ’¬ Interactive WhatsApp product cards with Order Now and Virtual Try-On buttons πŸ”„ Sliding window session memory (last 20 messages per user) πŸ›’ Order management πŸ“¦ Fully automated order creation saved to MongoDB πŸ“Š Automatic order logging to Google Sheets πŸ€– AI agent handles the complete order flow without manual input βœ… Instant order confirmation sent to the customer via WhatsApp πŸ‘— Virtual try-on ✨ AI-powered try-on image generation using Google Gemini πŸ“· Selfie validation ensures exactly one real person is in the photo πŸ–ΌοΈ Product and selfie images resized and merged before generation πŸ“© Try-on result delivered directly in the WhatsApp conversation πŸ—‘οΈ Redis TTL automatically clears try-on context after delivery πŸ” Security and reliability πŸ›‘οΈ Advanced message validation with spam and XSS protection ❌ Unsupported message types rejected with friendly error messages πŸ” Retry logic on critical HTTP request nodes πŸ“¦ Modular workflow architecture for easy customisation and scaling πŸ“‹ Requirements You need the following accounts and credentials: πŸ”§ n8n πŸ“± WhatsApp Business Cloud API πŸ€– OpenAI API (embeddings and GPT model) ✨ Google Gemini API πŸƒ MongoDB Atlas (with vector index named ShoppingBot on the product collection) ⚑ Redis server πŸ“ Google Drive (service account) πŸ“Š Google Sheets (service account) 🎯 Benefits πŸš€ Fully automated WhatsApp shopping experience πŸ™Œ No manual order handling required πŸ‘— Customers can try on products before buying ⚑ Fast product search with Redis caching πŸ“Š All orders automatically tracked in Google Sheets πŸ’Ό Reduces support workload for store owners πŸ• Works 24/7 without human intervention πŸ‘¨β€πŸ’» Author BytezTech Pvt Ltd

Popular ways to use the MongoDB and WhatsApp Business Cloud integration

Build your own MongoDB and WhatsApp Business Cloud integration

Create custom MongoDB and WhatsApp Business Cloud workflows by choosing triggers and actions. Nodes come with global operations and settings, as well as app-specific parameters that can be configured. You can also use the HTTP Request node to query data from any app or service with a REST API.

MongoDB supported actions

WhatsApp Business Cloud supported actions

MongoDB and WhatsApp Business Cloud integration details

MongoDB

MongoDB is a data platform for developers that serves as a document-oriented database. It is a document data model that maps they way you code and think. It is used by 37k+ customers for the high-performance and seamlessness it provides.

WhatsApp Business Cloud

The cloud-based version of WhatsApp Business API, WhatsApp Cloud API enables companies and developers to build applications on top of WhatsApp to personalize user experiences and quickly and easily respond to customers.

Save engineering resources

Reduce time spent on customer integrations, engineer faster POCs, keep your customer-specific functionality separate from product all without having to code.

Learn more

FAQ about MongoDB integrations

Need help setting up your MongoDB and WhatsApp Business Cloud integration?

Discover our latest community's recommendations and join the discussions about MongoDB and WhatsApp Business Cloud integration.

  • JoΓ£o Textor

    MongoDB update / find and update running but not working for me

    JoΓ£o Textor

    Describe the problem/error/question I have a workflow in which I use MongoDB Find to get all entries in my collection. I Edit one of the fields using β€œEdit Fields”, and then I iterate a loop to Update that field on Mongo…

    Open topic
  • Manas Gupta

    Ai Agent parsing issue with mongodb tool

    Manas Gupta

    Describe the problem/error/question Hi Folks, I am learning n8n flows. I stuck to store the object in the mongodb through ai agent tool. What is the error message (if any)? There is no error message but the output is no…

    Open topic

Looking to integrate Slack and VirusTotal in your company?

Three colleagues talking around laptops at a shared desk

Trusted by teams building smarter workflows.

Why

Why use n8n to integrate MongoDB with WhatsApp Business Cloud

Handle branching, merging and iteration easily. Pause your workflow to wait for external events.

Re-run single steps to test changes in no time. And pin your data to avoid generating trigger events every time you execute.

Your data is displayed alongside your settings, making edge cases easy to track down.

Use 1000+ workflow templates available from our core team and our community.

Copy and paste, easily import and export workflows.

Simple enough to 
understand + sophisticated 
enough to ship

Man in a brown jacket working at his desk by a window