Automate WooCommerce Shopping Assistant with OpenAI & RAG in n8n

This automation workflow transforms WooCommerce shopping by combining OpenAI’s intelligent chat with a RAG system to answer store queries and find products in real time. It reduces time spent searching and improves customer experience through AI-driven personalized recommendations.
chatTrigger
agent
wooCommerceTool
+11
Workflow Identifier: 1766
NODES in Use: chatTrigger, set, informationExtractor, agent, wooCommerceTool, toolVectorStore, vectorStoreQdrant, embeddingsOpenAi, googleDrive, httpRequest, memoryBufferWindow, lmChatOpenAi, textSplitterTokenSplitter, documentDefaultDataLoader

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

1. Opening Problem Statement ⚙️

Meet Sara, the owner of Scarperia, a boutique specializing in shoes and accessories, mainly bags. Sara spends hours every day answering repetitive customer questions about product availability, prices, and store info like opening hours or location. On top of that, manually filtering WooCommerce products to find the right match wastes even more of her precious time. Customers often get frustrated waiting for responses, leading to lost sales and diminished satisfaction.

In a busy retail environment, even a small delay or error in providing product info can mean money lost and opportunities missed. Sara needs a smarter, faster way to assist customers through a chat interface that understands their needs deeply and returns personalized, accurate responses instantly.

2. What This Automation Does

This n8n workflow converts customer chat messages into intelligent actions by leveraging OpenAI’s natural language processing combined with a Retrieval-Augmented Generation (RAG) system and WooCommerce product search. When a chat message is received:

  • Extracts intent and details like keywords, price range, SKU, or category from chat using the Information Extractor node.
  • Determines if the query is about a product or general store information using the AI Agent and routes accordingly.
  • Searches WooCommerce products based on extracted parameters (SKU, price range, keyword) when it’s product related.
  • Uses a RAG system backed by documents stored on Google Drive to answer general questions about store hours, address, or policies.
  • Maintains conversation context with a sliding window memory for richer, multi-turn chat interactions.
  • Returns personalized, on-point answers to the user’s chat input, saving Sara hours of manual work daily and boosting customer satisfaction.

3. Prerequisites ⚙️

  • n8n account (Cloud or Self-hosted) 🔌
  • OpenAI account and API key 🔑
  • WooCommerce store with REST API access (WooCommerce API credentials) 📊
  • Google Drive account with documents uploaded about store info 📁
  • Qdrant vector database for RAG system setup (API credentials) ⏱️

4. Step-by-Step Guide ✏️

Step 1: Set up the chat trigger node

In n8n, add the When chat message received (LangChain Chat Trigger) node. This webhook node listens for incoming chat messages, the starting point of the workflow.
Configure it by linking your chat platform or configuring the webhook URL to receive messages directly.

Outcome: The workflow activates whenever a customer sends a chat message.

Step 2: Extract intent and search parameters

Connect to the Information Extractor (LangChain Node). Configure the system prompt that analyzes chat input for product search intent and extracts details. The prompt instructs it to extract keyword, min/max price, SKU, and category if present.
Actual example prompt from this workflow:

You are an intelligent assistant for a shoe and accessories store (mainly bags). Your task is to analyze the input text coming from a chat and determine if the user is looking for a product. If so, extract keyword, min/max price, SKU, and category.

Outcome: You get a structured JSON output telling whether the input is a search query and relevant parameters.

Step 3: Store session variables

The Edit Fields node saves user session ID and chat input into variables for use downstream.
Set assignments with sessionId and chatInput fields that reference the webhook data.

Outcome: Session context is maintained for the current conversation.

Step 4: Use AI Agent for decision making

The AI Agent (LangChain Agent node) uses a system message prompt defining behavior:

  • If the user looks for a product, signal to run the personal shopper node.
  • If asking about store info (hours, location), route to the RAG tool leveraging vector search.

The AI Agent inputs the chat text and outputs JSON deciding the path.

Outcome: Smart routing between product search and info retrieval.

Step 5: Search WooCommerce products

If a product search is needed, the personal_shopper (WooCommerce Tool node) runs. It queries WooCommerce using SKU, keywords, and price filters extracted before.
Configure operation as getAll, with dynamic expressions for sku, search keyword, and price ranges.

Outcome: Returns a filtered list of products matching the customer’s request with availability checked.

Step 6: Retrieve store info with RAG

For general questions, the workflow uses RAG (LangChain VectorStore Tool node) and Qdrant Vector Store nodes. These perform vector similarity search on indexed store documents stored on Google Drive.
The system leverages embedded vectors to respond intelligently on store details.

Outcome: Quick, context-aware answers from internal store knowledge base.

Step 7: Maintain conversational memory

The Window Buffer Memory (LangChain Memory BufferWindow node) keeps track of recent chat history for richer AI responses across multiple exchanges.
Configure session keys dynamically linked to user sessions.

Outcome: Personalized chat that remembers context, improving user experience.

Step 8: Use OpenAI Chat Models

Multiple OpenAI Chat Model (LangChain LMChatOpenAI nodes) appear at different points to generate responses, handle conversation management, and embeddings.
Supply your OpenAI API credentials for authentication.

Outcome: Fluent, natural language responses tailored for chat and RAG.

Step 9: Embed documents for RAG

Using the Embeddings OpenAI (LangChain EmbeddingsOpenAI node), documents from Google Drive are embedded into vectors stored in Qdrant, allowing semantic search and retrieval.
The Google Drive nodes handle file listing and downloading.

Outcome: A searchable knowledge base that upgrades your store chat’s intelligence.

Step 10: Test and deploy

Run manual triggers and send sample messages to verify flow. Monitor data passing through nodes and confirm expected outputs.

Outcome: A fully functional AI-powered shopping assistant chatbot connected to WooCommerce and enriched with store knowledge.

5. Customizations ✏️

  • Change product categories: In the Information Extractor node, modify the system prompt to focus on different product categories beyond shoes and bags, tailoring it to your WooCommerce catalog.
  • Adjust price filtering: Modify the expressions in the personal_shopper node to include/exclude price filters or add more detailed stock status options.
  • Expand knowledge base: Add more documents to Google Drive and update the Qdrant collection via the Google Drive and Qdrant nodes to enhance general queries handling.
  • Switch AI model parameters: In OpenAI Chat Model nodes, tweak parameters like temperature or max tokens to change response creativity and length.
  • Enable multi-language support: Customize prompts and text processing nodes to handle languages other than English and Italian.

6. Troubleshooting 🔧

Problem: “No products returned from WooCommerce search”

Cause: Incorrect SKU, keyword, or price parameters passed from Information Extractor or AI Agent.

Solution: Review JSON output from Information Extractor node for correctness. Use debug mode in n8n to inspect variables. Adjust prompt or input values accordingly.

Problem: “RAG returns irrelevant answers”

Cause: Qdrant collection not properly indexed or insufficient documents uploaded.

Solution: Verify Google Drive integration and ensure documents are uploaded. Re-embed and re-index using Embeddings OpenAI and Qdrant Vector Store nodes.

Problem: “OpenAI API key errors or rate limits”

Cause: API keys invalid or usage limit reached.

Solution: Check OpenAI account and API keys in credentials. Monitor usage and upgrade plan if needed.

7. Pre-Production Checklist ✅

  • Verify all API credentials (OpenAI, WooCommerce, Google Drive, Qdrant) are correctly set and tested.
  • Send test chat messages containing product queries and general store questions to validate branching behavior.
  • Confirm Google Drive documents exist and are accessible for RAG.
  • Ensure session IDs are uniquely tracked in Window Buffer Memory.
  • Backup Qdrant vector data before bulk updates.

8. Deployment Guide

Activate the workflow by switching it to ‘active’ status in n8n. Set your chat platform integration to send live messages to the chat trigger webhook URL.
Monitor workflow executions in n8n dashboard for any errors or latency.
This chatbot can run entirely on cloud-hosted n8n or a self-hosted instance for control and compliance. For self-hosting, consider providers like Hostinger.

This approach enables Sara’s store to handle more customers simultaneously with immediate, accurate answers, boosting sales and satisfaction without increasing staff workload.

9. FAQs

  • Can I use a different chatbot platform? Yes, as long as the platform can send webhook messages that n8n can receive.
  • Does this workflow consume many OpenAI credits? It uses multiple OpenAI API calls per chat but is optimized by session memory reuse.
  • Is my store data secure? All credentials are stored securely within n8n. You retain full control over your data.
  • Can it scale for hundreds of concurrent users? Yes, n8n and WooCommerce API can handle high volume with proper infrastructure.

10. Conclusion

By building this unique n8n workflow, you have automated a powerful AI personal shopper chatbot that integrates OpenAI’s language models, a RAG knowledge base, and WooCommerce product search. Sara’s store now answers customer queries instantly and accurately.

This workflow saves hours daily in manual customer support and improves shopping experience by delivering personalized recommendations. Next steps could include adding voice chat support, integrating payment options via WooCommerce, or expanding the RAG knowledge base with customer feedback documents.

Ready to transform your WooCommerce customer support with smart AI? Let’s get started!

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free