WooCommerce Post-Sales Support Chatbot using GPT-4o, RAG, and Telegram - n8n Workflow

Build a powerful WooCommerce support AI chatbot using n8n and GPT-4o. This n8n workflow handles order tracking, identity verification, RAG knowledge, and Telegram escalation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • E-commerce managers needing to automate Level 1 customer support inquiries.

  • Developers looking for complex n8n templates integrating AI agents, RAG, and external APIs (WooCommerce).

  • Businesses requiring secure, verified access to customer data (WooCommerce orders) via an automated chatbot.

  • n8n users interested in applying LangChain components and Qdrant vector databases.

Overview

This advanced n8n workflow solves the critical challenge of providing scalable, secure, and accurate post-sales support in an e-commerce environment. By leveraging a LangChain-based AI Agent within n8n, this system connects directly to your WooCommerce data for real-time order status and tracking information. Crucially, it implements strict identity verification rules (matching order number and email) before disclosing sensitive details, ensuring maximum data security. Furthermore, using a Google Drive-backed RAG (Retrieval-Augmented Generation) knowledge base stored in Qdrant, the chatbot answers policy questions accurately. This comprehensive n8n solution drastically reduces human support load while providing instant, high-quality responses. This is one of the most powerful n8n templates available for e-commerce automation.

How it Works

This n8n workflow operates in two main phases: Knowledge Base Preparation and Live Chat Execution.

1. Knowledge Base Preparation (RAG Setup)


  1. The process is manually started using the When clicking ‘Test workflow’ n8n trigger to manage the knowledge base.

  2. It uses Create collection and Refresh collection HTTP Request n8n nodes to initialize and clear the Qdrant vector database collection.

  3. The Get folder n8n node retrieves policy documents (Terms and Conditions, shipping details) from a specified Google Drive folder.

  4. The documents are downloaded, processed by the Default Data Loader n8n node, and chunked by the Token Splitter n8n node.

  5. OpenAI Embeddings OpenAI1 generates vector representations, which are stored in the Qdrant Vector Store n8n node, making the information retrievable for RAG queries.

2. Live Chat Execution


  1. Conversation begins when a user sends a message, activating the When chat message received n8n trigger (a LangChain ChatTrigger n8n node).

  2. The message enters the Post-Sales Agent n8n node. This agent utilizes the GPT 4o-mini language model and Simple Memory n8n node to maintain conversational context across messages.

  3. The agent dynamically selects one of its available tools, following the strict instructions defined in its system prompt:

WooCommerce Tools: Uses dedicated WooCommerce n8n nodes (getorder, getorders, or getuser) for secure customer/order lookup. The AI logic ensures verification via email matching before releasing order details.
Tracking Tool: The get
tracking n8n node calls a separate utility n8n workflow via the Tool Workflow n8n node to retrieve tracking codes via the WooCommerce API.
RAG Tool: The ToS n8n node leverages the pre-loaded Qdrant RAG store to answer policy questions (Terms of Service, Shipping details).
Escalation: If the request is too complex or unresolvable, the human_assistance n8n node sends the conversation summary to a specific Telegram chat ID for seamless human intervention. This ensures every customer query handled by this n8n workflow is resolved.

Installation Guide

To deploy this comprehensive n8n workflow, follow these setup and configuration steps:


  1. Import the n8n template: Copy and paste the provided n8n workflow JSON into your n8n instance using the "Import from JSON" function.

  2. Credential Setup: This n8n workflow requires multiple connections. Configure the following credentials:

OpenAI: Set up credentials for the OpenAi account used in both the Agent and the Embeddings n8n nodes.
Qdrant: Configure the QdrantApi account credentials for vector storage access.
WooCommerce: Set up the WooCommerce API credentials for accessing order and customer data.
Google Drive: Configure Google Drive OAuth2 Api credentials for the RAG document ingestion phase.
Telegram: Set up Telegram API credentials for the humanassistance n8n node.
WooCommerce HTTP Basic Auth: Set up HTTP Basic Authentication for the Get tracking n8n node to connect to the dedicated tracking endpoint (/wp-json/wc/v3/orders/).

  1. RAG Knowledge Base Configuration (Prerequisite):

Update the Create collection and Refresh collection HTTP Request n8n nodes with your specific QDRANTURL and COLLECTION name.
Ensure the Get folder n8n node points to the correct Google Drive folder ID containing your policy documents.
* Execute the Data Preparation section (starting with When clicking ‘Test workflow’) once to populate the Qdrant vector database.

  1. Tracking Sub-Workflow Configuration: Update the URL in the Get tracking HTTP Request n8n node within the dedicated tracking path to match your WooCommerce shop URL.

  2. Agent Customization: In the humanassistance Telegram n8n node, replace CHAT_ID with the Telegram ID where human escalation messages should be sent.

Node Details

When chat message received (n8n trigger): The entry point for the live chatbot. This LangChain ChatTrigger n8n node listens for incoming chat messages, initiating the main execution path of the n8n workflow.
Post-Sales Agent (n8n node): The core intelligence of this n8n workflow. It orchestrates various tools and uses the GPT 4o-mini language model. Its detailed system prompt enforces strict identity verification and dictates tool usage for tracking, lookup, and RAG queries.
GPT 4o-mini (n8n node): Serves as the primary Large Language Model (LLM) for the Agent, responsible for reasoning, determining tool use, and generating natural language responses within the n8n workflow.
Simple Memory (n8n node): A crucial LangChain n8n node for maintaining conversational history within the current chat session, ensuring the Agent has context for follow-up questions.
WooCommerce Tools (n8n nodes): Includes getorder, getorders, and getuser. These n8n nodes are essential tools for the Agent to interact with the WooCommerce API for real-time customer data retrieval.
ToS (Tool Vector Store n8n node): This tool provides the RAG capabilities, connecting the Agent to the Qdrant Vector Store and OpenAI Chat Model to answer policy-related queries using the loaded documents, extending the knowledge of the primary Agent.
gettracking (Tool Workflow n8n node): This n8n node is configured as a callable tool, delegating the specific task of retrieving a tracking number to a dedicated n8n workflow path, often used for modularity and external service calls.
Qdrant Vector Store1 (n8n node): Used during the manual setup phase to insert the document embeddings generated by the Embeddings OpenAI1 n8n node into the Qdrant database. This establishes the knowledge base for the RAG component of the overall n8n workflow.


  • human_assistance (Telegram Tool n8n node): The designated tool for human handoff. When the Agent cannot resolve a complex query, this n8n node sends an escalation message to a designated Telegram chat, ensuring continuous support coverage.

Related n8n Workflows

Free

Nodes: 19 Nodes
Updated: December 26 2025
View all
Created by

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at [email protected] or add me on Linkedin.com/in/davideboizza

Featured*