Multi-Platform E-Commerce Chat Assistant with GPT-4o, Gemini & RAG - n8n Workflow

Build a sophisticated AI E-commerce Assistant using this advanced n8n workflow. Route customer inquiries for Shopify and WooCommerce, utilize GPT-4o and Gemini, and leverage a Pinecone RAG knowledge base.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

E-commerce store owners running Shopify and/or WooCommerce.
Technical users looking to implement sophisticated AI routing agents in n8n.
Developers needing advanced examples of using LangChain agents and RAG tools within an n8n workflow.
Automation specialists seeking robust n8n templates for customer service automation.

Overview

This comprehensive n8n workflow solves the complexity of managing customer service across multiple e-commerce platforms and knowledge domains simultaneously. By employing an intelligent router powered by GPT-4o, the system dynamically directs incoming chat messages to the appropriate specialized AI agent: the Shopify Assistant, the WooCommerce Assistant, or a General Queries agent.

Each specialized agent is equipped with platform-specific n8n node tools—such as Shopify operations (like Get Order info and GraphQL) or WooCommerce operations (like Fetch Order Details). Furthermore, the General Queries path incorporates a powerful Retrieval-Augmented Generation (RAG) system using Pinecone and AWS Bedrock embeddings, allowing the assistant to answer general questions based on a proprietary knowledge base. This robust n8n workflow ensures quick, accurate, and context-aware responses, drastically improving customer experience and efficiency.

How it Works

The entire process begins with the When chat message received n8n trigger, capturing the user's initial input.


  1. Initial Routing: The message flows to the Initial Query Router Agent, which uses a pre-configured prompt and the Router Model (GPT-4o-mini) to categorize the intent as SHOPIFY, WOOCOMMERCE, or None of them. This smart routing is the core of this n8n workflow.

  2. Category Check: The Check if Its General query n8n node uses an IF condition to determine the next step. If the output is not Shopify or WooCommerce, the flow proceeds to the General Queries RAG path.

  3. Platform Routing: If it is platform-specific, the Route To Shopify or WooCommerce n8n node directs the message to the correct specialized agent.

  4. Specialized Agent Execution:

Shopify Path: The Shopify Assistant Agent utilizes the Shopify Chat Model (Gemini) and the Shopify-specific n8n node tools to fulfill requests like fetching product lists or order details.
WooCommerce Path: The WooCommerce Assistant Agent uses the WooCommerce Chat Model (Gemini) and its dedicated WooCommerce n8n node tools for analogous tasks.
* General Queries (RAG): The General Queries Agent uses the GPT-4o-mini n8n node, leveraging the Pinecone Vector Store tool (fed by AWS Bedrock embeddings) to retrieve contextual knowledge before generating a final response.

  1. Final Merge: Regardless of which path generated the response, the Merge n8n node consolidates the final text output, preparing it to be delivered back to the user via the initial chat connection. This complex architecture demonstrates the power of n8n templates for advanced use cases.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON data and paste it directly into your n8n instance using the 'New' menu > 'Import from JSON'. This imports the complete n8n workflow setup.

  2. Setup E-commerce Credentials:

Configure the Shopify Access Token credentials for the Shopify n8n node tools (Fetch All Products, Get Order info).
Configure the WooCommerce API credentials for the WooCommerce n8n node tools (Fetch All Products2, Fetch Order Details).

  1. Setup AI Credentials:

Provide your OpenAI API credentials for the Router Model and GPT-4o-mini n8n node components.
Provide your Google Gemini API credentials for the Shopify Chat Model and WooCommerce Chat Model n8n node components.

  1. Setup RAG Components (If using RAG):

Configure the Pinecone API credentials for the Pinecone Vector Store n8n node.
Configure the AWS credentials (access key and secret) for the Embeddings AWS Bedrock n8n node, ensuring the required permissions for the Titan embedding model.

  1. Activate the n8n Trigger: Ensure the When chat message received n8n trigger node is active to start monitoring incoming messages and enabling this n8n workflow.

Node Details

When chat message received (n8n trigger): The starting point of the n8n workflow. It is a LangChain chatTrigger that initiates the automation upon receiving a user message, extracting the query and session ID.
Initial Query Router (Agent): Uses GPT-4o-mini to categorize the user intent (SHOPIFY, WOOCOMMERCE, None of them). This key n8n node determines the flow path.
Check if Its General query (IF n8n node): Routes traffic based on the router's classification, separating general inquiries from e-commerce tasks.
Route To Shopify or WooCommerce (IF n8n node): Directs the flow specifically to the Shopify or WooCommerce assistant based on the prior classification.
Shopify Assistant Agent: The specialized agent for Shopify tasks. It uses the Shopify Chat Model (Gemini) and leverages three main n8n node tools: Get Order info, Fetch All Products, and GraphQL for complex querying.
WooCommerce Assistant Agent: The specialized agent for WooCommerce tasks, utilizing the WooCommerce Chat Model (Gemini) and its corresponding n8n node tools: Fetch Order Details and Fetch All Products2.
General Queries (Agent): Handles non-e-commerce questions. Its primary function is to use the Pinecone Vector Store n8n node tool for RAG.
Pinecone Vector Store & Embeddings AWS Bedrock: This combination forms the RAG system. The Embeddings AWS Bedrock n8n node creates the vector representation of the query, which the Pinecone Vector Store n8n node uses to retrieve context from the knowledge base.


  • Merge (n8n node): Gathers the output from all three potential agent paths (Shopify, WooCommerce, General) into a single payload to finalize the n8n workflow execution.

Related n8n Workflows

Free

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

Crafting Intelligent AI Solutions | AI Engineer building the next generation of intelligent workflows on n8n. Automating the complex, one node at a time.

Featured*