Index WooCommerce products in Pinecone with OpenAI embeddings

Go to Workflow
0 views
Built by Stanislaw Chalupczak Stanislaw Chalupczak
Created on September 29, 2026

Description

Quick overview
This workflow runs on a manual or daily schedule to sync WooCommerce products into Pinecone by fetching changed items, enriching them with variations and reviews, generating OpenAI embeddings, and tracking indexed products in an n8n Data Table for deduplication and deletion handling.

How it works
Runs on a manual trigger or every day at 03:00 to start a WooCommerce-to-Pinecone sync.
Fetches a paginated list of all published WooCommerce products (ID and modified date) and loads previously indexed entries from an n8n Data Table.
Compares WooCommerce products to the Data Table to select a limited batch of new or changed products, then retrieves full product details for that batch in one WooCommerce API request.
Processes each product one by one, fetching variations for variable products and retrieving up to 10 WooCommerce reviews per product.
Builds a clean text representation of the product (details, variants, and selected reviews) and deletes any existing Pinecone vectors for the same product fileId to prevent duplicates.
Splits the text into chunks, generates OpenAI embeddings, and inserts the vectors into a Pinecone index under the configured namespace.
Upserts the product’s latest modified date into the n8n Data Table and also removes Pinecone vectors and table entries for products that no longer exist in WooCommerce.

Setup
Add WooCommerce API credentials with access to the REST API and set your store base URL in the workflow’s settings values.
Add a Pinecone API credential, create or choose a Pinecone index, and fill in the index name, index host, and namespace used for storage.
Add an OpenAI API credential for the embeddings step.
Create an n8n Data Table named indexed_wc_products_v8 (or update the workflow to your table name) to store productId and dateModified for deduplication.
Review and adjust the schedule (cron) and the productBatchSize setting to control how many products each run processes.

Nodes Used (6)

Code
n8n-nodes-base.code
Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader
Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi
HTTP Request
n8n-nodes-base.httpRequest
Pinecone Vector Store
@n8n/n8n-nodes-langchain.vectorStorePinecone
Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter