{"product_id":"sync-supabase-storage-to-vector-store-with-openai-n8n","title":"Sync Supabase Storage to Vector Store with OpenAI | n8n","description":"\u003ch3\u003eSync your Supabase Storage files into a vector store—and answer questions with an OpenAI-powered agent in n8n\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow automatically syncs documents from \u003cstrong\u003eSupabase Storage\u003c\/strong\u003e into a \u003cstrong\u003eSupabase vector store\u003c\/strong\u003e using \u003cstrong\u003eOpenAI embeddings\u003c\/strong\u003e, then provides a chat trigger where an AI agent retrieves relevant chunks and responds grounded in your indexed files.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRuns a manual sync\u003c\/strong\u003e when you click \u003cem\u003e“Test workflow”\u003c\/em\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReads what’s already indexed\u003c\/strong\u003e by fetching existing records from the Supabase \u003ccode\u003efiles\u003c\/code\u003e table.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLists objects in Supabase Storage\u003c\/strong\u003e (from the \u003ccode\u003eprivate\u003c\/code\u003e bucket), then \u003cstrong\u003ecompares\u003c\/strong\u003e storage objects to the \u003ccode\u003efiles\u003c\/code\u003e table.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSkips duplicates\u003c\/strong\u003e—it avoids files already indexed and ignores objects matching the \u003ccode\u003e.emptyFolderPlaceholder\u003c\/code\u003e marker.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDownloads new files\u003c\/strong\u003e and \u003cstrong\u003eextracts text\u003c\/strong\u003e (PDFs are parsed; files without an extension are treated as plain text).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCreates\/updates indexing records\u003c\/strong\u003e by inserting a new row into the Supabase \u003ccode\u003efiles\u003c\/code\u003e table with fields like \u003ccode\u003ename\u003c\/code\u003e and \u003ccode\u003estorage_id\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eChunks text\u003c\/strong\u003e and \u003cstrong\u003egenerates embeddings with OpenAI\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eInserts chunks into the Supabase vector table\u003c\/strong\u003e (\u003ccode\u003edocuments\u003c\/code\u003e) so they can be retrieved later.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eResponds to chat\u003c\/strong\u003e: when a chat message is received, an AI agent uses OpenAI plus a Supabase vector search tool (via the required \u003ccode\u003ematch_documents\u003c\/code\u003e function) to retrieve top matches and answer based on the indexed content.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eBuild a \u003cstrong\u003eknowledge base\u003c\/strong\u003e from PDFs and text files stored in Supabase Storage.\u003c\/li\u003e\n  \u003cli\u003eEnable \u003cstrong\u003eretrieval-augmented Q\u0026amp;A\u003c\/strong\u003e for internal docs, product materials, or support assets.\u003c\/li\u003e\n  \u003cli\u003eKeep a \u003cstrong\u003evector index\u003c\/strong\u003e up to date by running sync whenever new documents are uploaded.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eIntegrations: \u003cstrong\u003eSupabase Storage\u003c\/strong\u003e, \u003cstrong\u003eSupabase\u003c\/strong\u003e (tables + vector store), \u003cstrong\u003eOpenAI\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eWorkflow nodes \/ logic: \u003ccode\u003eif\u003c\/code\u003e, \u003ccode\u003emerge\u003c\/code\u003e, \u003ccode\u003eswitch\u003c\/code\u003e, \u003cstrong\u003esupabase\u003c\/strong\u003e, \u003ccode\u003eaggregate\u003c\/code\u003e, plus \u003cstrong\u003eSticky Notes\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eRequired database objects: \u003ccode\u003efiles\u003c\/code\u003e table (at least \u003ccode\u003ename\u003c\/code\u003e, \u003ccode\u003estorage_id\u003c\/code\u003e), \u003ccode\u003edocuments\u003c\/code\u003e vector table, and \u003ccode\u003ematch_documents\u003c\/code\u003e function.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45738443899059,"sku":"N8N-17563","price":73.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/g45fz-SHO1Mg4ThIB4Yfo_MA9weYIh.png?v=1785229305","url":"https:\/\/buyflowscripts.com\/products\/sync-supabase-storage-to-vector-store-with-openai-n8n","provider":"N8N Commerce","version":"1.0","type":"link"}