# RAG eCommerce chatbot with OpenAI and Gmail: n8n workflow

> Started by another system calling it, and works across Gmail, Qdrant, Redis, Shopify and one other.

Source: https://millionrounds.com/workflow/rag-ecommerce-chatbot-with-openai-and-gmail (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [E-commerce](https://millionrounds.com/workflows?category=E-commerce#library)

# RAG eCommerce chatbot with OpenAI and Gmail

Started by another system calling it, and works across Gmail, Qdrant, Redis, Shopify and one other. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 23 steps, 1 branch: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Frag-ecommerce-chatbot-with-openai-and-gmail)

**23 steps** Large: read it before trusting it with anything live

**1** Branch: places the flow splits

**0** Loops or waits

**5** Services it connects to

## The flow

Starts it 5 Model 7 Logic 6 Service 5

The steps in the order they run, from what starts it.

- 1 **Error Response** Respond To Webhook *Starts it*
- 2 **Generate Response** Open Ai *Model*
- 3 **Webhook Trigger - Chat** Webhook *Starts it*
- 4 **Create Embeddings** Embeddings Open Ai *Model*
- 5 **Manual Trigger - Data Ingestion** Manual trigger *Starts it*
- 6 **Default Data Loader** Document Default Data Loader *Model*
- 7 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 8 **Extract Message** Code *Logic*
- 9 **Store in Vector Database** Vector Store Qdrant *Model*
- 10 **Gmail Messages** Gmail *Service*
- 11 **Shopify Products** Shopify *Service*
- 12 **WooCommerce Products** Woo Commerce *Service*
- 13 **AI Agent** Agent *Model*
- 14 **Get Conversation History** Redis *Service*
- 15 **Retrieve Context** Vector Store Qdrant *Model*
- 16 **Ingestion Complete** If *Logic*
- 17 **Merge All Data** Merge *Logic*
- 18 **Update History** Code *Logic*
- 19 **Prepare Prompt** Code *Logic*
- 20 **Ingestion Response** Respond To Webhook *Starts it*
- 21 **Process Data for Embeddings** Code *Logic*
- 22 **Store History** Redis *Service*
- 23 **Respond to User** Respond To Webhook *Starts it*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 23, with 1 branch
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Qdrant, Redis, Shopify, WooCommerce
- **Model:** OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

An n8n account, plus your own Gmail, Qdrant, Redis, Shopify and WooCommerce accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on another system calling it.

Does it use AI?

Yes. It calls OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 23 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 23 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Frag-ecommerce-chatbot-with-openai-and-gmail)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[Qdrant](https://millionrounds.com/workflows?service=Qdrant#library)[Redis](https://millionrounds.com/workflows?service=Redis#library)[Shopify](https://millionrounds.com/workflows?service=Shopify#library)[WooCommerce](https://millionrounds.com/workflows?service=WooCommerce#library)

## Workflows like it

Also e-commerce, with the same services where possible, closest in size first.

- [**Import Faire products to Shopify with BrowserAct and Gemini** 23 steps · calls a model · Shopify, Telegram](https://millionrounds.com/workflow/import-faire-products-to-shopify-with-browseract-and-gemini)
- [**Shopify orders to NetSuite sales orders / cash sales** 23 steps · Shopify](https://millionrounds.com/workflow/shopify-orders-to-netsuite-sales-orders-cash-sales)
- [**Conversational sales agent for WooCommerce with OpenAI** 24 steps · calls a model · Google Drive, Qdrant](https://millionrounds.com/workflow/conversational-sales-agent-for-woocommerce-with-openai)
- [**Create AI-powered 3D product videos from images with VEO3** 24 steps · calls a model · Discord, Gmail](https://millionrounds.com/workflow/create-ai-powered-3d-product-videos-from-images-with-veo3)
- [**Create WooCommerce products and WordPress posts** 24 steps · calls a model · Telegram, WooCommerce](https://millionrounds.com/workflow/create-woocommerce-products-and-wordpress-posts)
- [**Provide ecommerce support with Qdrant RAG and WooCommerce** 24 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/provide-ecommerce-support-with-qdrant-rag-and-woocommerce)
