Ingest LinkedIn posts from Google Drive into Pinecone with Gemini and Supabase
Quick overview This workflow watches a Google Drive folder for new LinkedIn post screenshots or PDFs, extracts the text (including OCR), uses Groq and Google Gemini to extract reusable writing patterns, embeds the results with Gemini embeddings, stores them in a Pinecone index, and logs processed files in Supabase to avoid duplicates.
How it works Triggers every minute when a new file is created in a specific Google Drive folder. Checks Supabase for an existing ingestion record matching the Google Drive file ID and stops if the file was already processed. Downloads the file from Google Drive and routes processing based on MIME type (PDF vs JPEG image). Extracts text from PDFs directly, or runs Tesseract OCR on images and uses Groq to clean and reconstruct the OCR text. Sends the normalized text to Google Gemini to extract structured writing patterns (hook type, structure, tone, formatting notes, CTA type, and anti-patterns) as JSON. Converts the extracted pattern fields into chunked documents, creates embeddings with Google Gemini, and upserts them into a Pinecone vector index with metadata. Logs the ingestion details (source file ID, file name, and timestamp) back to Supabase so the file is skipped on future runs.
Setup Connect credentials for Google Drive, Supabase, Groq, Google Gemini (chat + embeddings), and Pinecone. In Google Drive Trigger, select the folder to watch (for example, a /reference-content folder). Create the Supabase table reference_ingestions (and index) as shown in the template notes, and ensure the Supabase nodes point to that table. In Pinecone, create or select the target index (for example, linkedin-reference-content) with dimensions compatible with Gemini embeddings. Ensure the incoming files are PDFs or JPEGs, since the workflow routes only those MIME types.
Related Templates
AI Weather Forecasts with MCP Integration
Real-time Weather Forecasts with MCP Tools This n8n workflow demonstrates how to integrate real-time weather intelligen...
Google Sheets UI for n8n Workflow
Google Sheets UI for Workflow Control This n8n template provides a practical and efficient way to manage your n8n workf...
Demo Workflow - How to use workflowStaticData()
This workflow demonstrates how to use the workflowStaticData() function to set any type of variable that will persist wi...
π Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments