n8n

How to Sync Google Sheets to MySQL and Pinecone Search?

Get faster answers from your tech catalog by turning one Google Sheet into a live database and a searchable knowledge base. A single chat API decides if a question should query MySQL or look up context from documents, then returns a clear answer. This suits IT and engineering teams that need quick, trusted results from both tables and unstructured notes.

Here is how it works. A scheduled job clears and reloads a MySQL table from a Google Sheet, keeping fields like name, ring, quadrant, and status in sync. In parallel, rows are formatted into clean paragraphs in a Google Doc. When that doc changes, the flow downloads the file, splits the text, creates embeddings with Google Gemini, and stores vectors in Pinecone. The webhook receives chat questions, uses an AI router to choose SQL or RAG, runs the right subflow, applies an output guardrail, and sends a final response.

Setup needs Google accounts, a MySQL database, a Pinecone index, and a Google Gemini API key. Expect less manual copy and paste, faster data refresh, and more accurate answers. Use this for tech radars, policy catalogs, or product glossaries where both facts and narrative matter.

What are the key features?

  • Webhook chat endpoint that receives user questions and returns final answers.
  • AI input router that decides between SQL lookup and document retrieval.
  • Monthly schedule to clear and reload a MySQL table from Google Sheets.
  • Code node that formats sheet rows into simple paragraphs for clean ingestion.
  • Google Docs update and Google Drive file update trigger to track content changes.
  • Text splitting and embeddings with Google Gemini for accurate vector search.
  • Pinecone vector store to index and retrieve document knowledge.
  • Database agent with schema discovery and safe query execution on MySQL.
  • Output guardrail with conversation history to validate and refine responses.

What are the benefits?

  • Reduce manual syncing from 2 hours to 5 minutes by automating sheet to database loads.
  • Keep knowledge fresh as document edits instantly update the vector store.
  • Improve answer accuracy by combining SQL facts with document context in one API.
  • Connect Google Drive, Google Docs, Google Sheets, MySQL, and Pinecone seamlessly.
  • Handle growth by supporting thousands of rows and large documents without extra effort.
  • Cut duplicate work by routing each question to the best source automatically.

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Google Drive, Google Docs, Google Sheets, MySQL, Pinecone, Google Gemini, Anthropic and Groq. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, create Google Sheets OAuth2 and connect your Google account. Open the Google Sheets nodes and select the spreadsheet and sheet name.
  4. Add Google Drive OAuth2 credentials. In the Google Drive trigger node, choose the folder or document you want to watch for updates.
  5. For Google Docs, use OAuth2 or a Service Account. If using a Service Account, share the target doc with the service account email so it can write updates.
  6. Create Google Gemini credentials in n8n. Get the API key from Google AI Studio, then paste it into the Google Gemini credential form.
  7. Create a Pinecone API credential with your API key and environment. In the vector store nodes, set your index name.
  8. Add MySQL credentials with host, port, database, user, and password. Ensure the table exists and matches the mapped columns shown in the insert node.
  9. Open the Code and Google Docs nodes that build the paragraph output. Confirm the fields map correctly from the sheet to the text block.
  10. Test the database path: run the schedule branch manually. Check your MySQL table to confirm rows were inserted without errors.
  11. Test the vector path: run the Google Docs update from sheet, then make a small edit in the doc to trigger the Drive event. Confirm new vectors appear in your Pinecone index.
  12. Open the webhook node, copy the test URL, and send a sample POST with a chatInput field. Review the router choice, final answer, and logs. If access errors occur, verify document sharing and MySQL permissions.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Anthropic

Sign up

Pay-as-you-go: Claude 3 Haiku at $0.25 per 1M input tokens and $1.25 per 1M output tokens

Google Docs

Sign up

Free: $0, Google Docs API usage at no additional cost (quota limits apply)

Google Drive

Sign up

Drive API: $0 (no additional cost; quota-limited)

Google Gemini

Sign up

Free tier: $0 via Gemini API; e.g., Gemini 2.5 Flash-Lite free limits 1,000 requests/day (15 RPM, 250k TPM). Paid from $0.10/1M input tokens and $0.40/1M output tokens.

Google Sheets

Sign up

Free: $0 (Google Sheets API usage has no additional cost; quota limits apply)

Free tier: $0, API key usable via API (rate‑limited)

MySQL

Sign up

MySQL Community Edition (GPL) – Free ($0)

Pinecone

Sign up

Starter (Free): $0 / mo; includes 2 GB storage, 2M write units / mo, 1M read units / mo, up to 5 indexes; API access.

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.