Skip to main content

drive-sync

Drive document ingest and targeted refresh. Confirmed runs store the raw blob in Supabase Storage, write/update the documents catalog row, classify by folder ancestry, extract supported document formats, and index chunks into knowledge_chunks.

{ "dryRun": true }
{ "confirm": true, "limit": 50, "folderId": "drive-folder-id" }
{ "confirm": true, "fileIds": ["drive-file-id"] }

{ "dryRun": true, "fullRefresh": true } inspects the recursive corpus; a real full refresh processes one file per Edge invocation (to stay within Supabase Edge worker limits) and Trigger.dev persists Google's opaque nextPageToken between continuations until the whole tree is covered. Workbooks over 750 KB use searchable OOXML text extraction instead of Edge-side row/table expansion; the original blob is still stored and indexed either way.

Currently paused by decision (#217): both of the function's paused branches return before resolving the service account at all, and the sable.drive.refresh schedule that used to call this every six hours was retired rather than waking up to scan zero folders. See the Drive connector page for the full reasoning and how to reverse it.

Where the code lives

  • sable-agents-demo/supabase/functions/drive-sync/index.ts
  • Drive connector page for the service-account and scheduling detail