Automation library · Data collection

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.

MediumCalls a model: OpenAIRetrieval

17 stepsMedium: a working afternoon
2Branches: places the flow splits
1Loop or waits
3Services it connects to

The flow

Starts it 1Model 4Logic 6Service 6

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

  1. 1Sync DB Schema to Vector StoreManual triggerStarts it
  2. 2Split Schema Text (No Chunking)Text Splitter Recursive Character Text SplitterModel
  3. 3Generate Schema EmbeddingsEmbeddings Open AiModel
  4. 4Load Global ConfigurationSetLogic
  5. 5Prepare Schema DocumentDocument Default Data LoaderModel
  6. 6Insert Schema Vector to PineconeVector Store PineconeModel
  7. 7Fetch All Database TablesMy SqlService
  8. 8Upsert Vector Metadata RecordData TableService
  9. 9Loop Over executable queriesSplit In BatchesLogic
  10. 10Set Table Schema ContextSetLogic
  11. 11Fetch Table Schema DefinitionMy SqlService
  12. 12Generate Schema HashCodeLogic
  13. 13Check Existing Vector MetadataData TableService
  14. 14Vector Exists?IfLogic
  15. 15Schema Changed?IfLogic
  16. 16Delete Existing Vector (Pinecone)Http RequestService
  17. 17Delete Vector Metadata RecordData TableService

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.