# Synchronize MySQL database schemas to Pinecone with OpenAI: n8n workflow

> Started by an event in a connected app, and works across MySQL, Pinecone and n8n data table.

Source: https://millionrounds.com/workflow/synchronize-mysql-database-schemas-to-pinecone-with-openai (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Data collection](https://millionrounds.com/workflows?category=Data+collection#library)

# Synchronize MySQL database schemas to Pinecone with OpenAI

Started by an event in a connected app, and works across MySQL, Pinecone and n8n data table. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 17 steps, 2 branches, 1 loop or waits: a working afternoon to understand properly.

Medium Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fsynchronize-mysql-database-schemas-to-pinecone-with-openai)

**17 steps** Medium: a working afternoon

**2** Branches: places the flow splits

**1** Loop or waits

**3** Services it connects to

## The flow

Starts it 1 Model 4 Logic 6 Service 6

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

- 1 **Sync DB Schema to Vector Store** Manual trigger *Starts it*
- 2 **Split Schema Text (No Chunking)** Text Splitter Recursive Character Text Splitter *Model*
- 3 **Generate Schema Embeddings** Embeddings Open Ai *Model*
- 4 **Load Global Configuration** Set *Logic*
- 5 **Prepare Schema Document** Document Default Data Loader *Model*
- 6 **Insert Schema Vector to Pinecone** Vector Store Pinecone *Model*
- 7 **Fetch All Database Tables** My Sql *Service*
- 8 **Upsert Vector Metadata Record** Data Table *Service*
- 9 **Loop Over executable queries** Split In Batches *Logic*
- 10 **Set Table Schema Context** Set *Logic*
- 11 **Fetch Table Schema Definition** My Sql *Service*
- 12 **Generate Schema Hash** Code *Logic*
- 13 **Check Existing Vector Metadata** Data Table *Service*
- 14 **Vector Exists?** If *Logic*
- 15 **Schema Changed?** If *Logic*
- 16 **Delete Existing Vector (Pinecone)** Http Request *Service*
- 17 **Delete Vector Metadata Record** Data Table *Service*

## How it's built

- **Starts on:** An event in a connected app
- **Steps:** 17, with 2 branches, 1 loop or waits
- **Size:** Medium: a working afternoon
- **Connects to:** MySQL, Pinecone, n8n data table
- **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 MySQL and Pinecone accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an event in a connected app.

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?

Plan an afternoon. 17 steps is enough that you should read each one before running it.

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 17 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%2Fsynchronize-mysql-database-schemas-to-pinecone-with-openai)
- **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.

[MySQL](https://millionrounds.com/workflows?service=MySQL#library)[Pinecone](https://millionrounds.com/workflows?service=Pinecone#library)[n8n data table](https://millionrounds.com/workflows?service=n8n+data+table#library)

## Workflows like it

Also data collection, with the same services where possible, closest in size first.

- [**Create AI-ready vector datasets for LLMs with Bright Data** 16 steps · calls a model · Pinecone](https://millionrounds.com/workflow/create-ai-ready-vector-datasets-for-llms-with-bright-data)
- [**Write weekly AI news digests with Gluecrawl and OpenAI** 18 steps · calls a model · n8n data table](https://millionrounds.com/workflow/write-weekly-ai-news-digests-with-gluecrawl-and-openai)
- [**Collect historical price data** 18 steps · Supabase, n8n data table](https://millionrounds.com/workflow/collect-historical-price-data)
- [**Evaluate and rank supplier bids with MySQL and Groq LLM** 19 steps · calls a model · Gmail, MySQL](https://millionrounds.com/workflow/evaluate-and-rank-supplier-bids-with-mysql-and-groq-llm)
- [**Export WordPress to Pinecone vector store with OpenAI** 19 steps · calls a model · Pinecone](https://millionrounds.com/workflow/export-wordpress-to-pinecone-vector-store-with-openai)
- [**Find and track flaky CI jobs in GitHub Actions with OpenAI** 19 steps · calls a model · GitHub, Slack](https://millionrounds.com/workflow/find-and-track-flaky-ci-jobs-in-github-actions-with-openai)
