{"product_id":"reset-postgres-tables-download-google-drive-docs-in-n8n","title":"Reset Postgres Tables \u0026 Download Google Drive Docs in n8n","description":"\u003ch3\u003eReset your PostgreSQL tables and queue Google Drive docs for download in n8n\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow clears specific PostgreSQL tables (so you start fresh) and then scans a designated Google Drive folder to download each document by file ID—ready for your downstream processing.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cp\u003eBuilt for clean re-runs and repeatable document ingestion, the workflow performs these steps:\u003c\/p\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDeletes existing PostgreSQL vector data\u003c\/strong\u003e by removing the \u003ccode\u003en8n_vectors\u003c\/code\u003e table (in the \u003ccode\u003epublic\u003c\/code\u003e schema) to clear previously stored vector records.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eClears previous scrape results\u003c\/strong\u003e by deleting the \u003ccode\u003escraped_pages\u003c\/code\u003e table (in \u003ccode\u003epublic\u003c\/code\u003e) so old page data doesn’t carry over.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eScans a specific Google Drive folder\u003c\/strong\u003e and returns each file’s \u003cem\u003eID\u003c\/em\u003e, \u003cem\u003ename\u003c\/em\u003e, and \u003cem\u003ewebViewLink\u003c\/em\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDownloads each Google Drive document\u003c\/strong\u003e using its file ID so the files can be used in subsequent steps.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRe-ingesting a content library\u003c\/strong\u003e: when your Google Drive folder changes and you want a clean refresh of stored results.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRecovering from partial runs\u003c\/strong\u003e: if a previous n8n run was interrupted, reset the PostgreSQL state and re-download documents.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePeriodic maintenance\u003c\/strong\u003e for SaaS operators managing document ingestion pipelines and avoiding stale data.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePostgreSQL\u003c\/strong\u003e: requires credentials with permission to delete tables; targets \u003ccode\u003epublic.n8n_vectors\u003c\/code\u003e and \u003ccode\u003epublic.scraped_pages\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGoogle Drive\u003c\/strong\u003e: OAuth2 connection to list files in a folder and download documents by file ID.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWorkflow logic \/ nodes\u003c\/strong\u003e: uses \u003ccode\u003eif\u003c\/code\u003e, \u003ccode\u003eset\u003c\/code\u003e, \u003ccode\u003ecode\u003c\/code\u003e, \u003ccode\u003ehtml\u003c\/code\u003e, \u003ccode\u003efilter\u003c\/code\u003e, and \u003ccode\u003eswitch\u003c\/code\u003e to control execution and prepare data for downstream steps.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eSetup checklist\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eConfirm your PostgreSQL environment matches the \u003ccode\u003epublic.n8n_vectors\u003c\/code\u003e and \u003ccode\u003epublic.scraped_pages\u003c\/code\u003e tables.\u003c\/li\u003e\n  \u003cli\u003eAdd a Google Drive OAuth2 connection with access to the target folder and its files.\u003c\/li\u003e\n  \u003cli\u003eUpdate the Google Drive folder URL\/ID in the folder scan step to point to your source directory.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45974320349363,"sku":"N8N-19287","price":22.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/1htOSUZ42SV0fl411C8Wq_EDoYhYix.png?v=1788772390","url":"https:\/\/buyflowscripts.com\/products\/reset-postgres-tables-download-google-drive-docs-in-n8n","provider":"N8N Commerce","version":"1.0","type":"link"}