Use this robust n8n workflow to automatically synchronize documents from Google Drive into your OpenAI Assistant vector store. Keep your RAG knowledge base updated using this n8n template.
Download this n8n workflow template and start using it instantly.
AI Developers and ML Engineers who need to maintain up-to-date RAG knowledge bases.
Users relying on OpenAI Assistants who source their files from Google Drive.
Anyone seeking a powerful, scheduled synchronization solution built with an n8n workflow.
Automation enthusiasts looking for advanced n8n templates for complex file operations.
Maintaining consistency between source documents (like those stored in Google Drive) and external AI knowledge bases (like OpenAI Vector Stores) is critical for accurate Retrieval-Augmented Generation (RAG). Manually tracking changes, additions, and deletions is tedious and prone to error. This sophisticated n8n workflow solves this problem entirely. By using the Compare Datasets n8n node, the workflow intelligently determines which files are new, updated, or deleted, and executes the necessary API calls to the OpenAI platform. This n8n template ensures your AI knowledge base is perpetually accurate without any manual intervention, triggered reliably by an n8n trigger.
This automation begins with a scheduled n8n trigger (Schedule trigger) or manual execution ("Test workflow" clicked).
List vector store files [OpenAI]).Compare Google Drive files with vector store files n8n node, which classifies items into four categories: files to Create (new), files to Update (modified), files to Delete (removed from GDrive), or files to Ignore (already synchronized).Loop over files).Upload new or updated file) to stage the file, and then uses a subsequent httpRequest n8n node (Add uploaded file to vector store [OpenAI]) to link the uploaded file ID to the specific vector store.httpRequest n8n node (Delete outdated file or previous version) removes the file reference from the OpenAI vector store, ensuring data cleanup.To deploy this powerful n8n template, follow these steps:
Upload new or updated file n8n node and permissions to manage Vector Stores via HTTP Requests.List files from folder Google Drive n8n node, specify the ID of the Google Drive folder you wish to synchronize.List vector store files [OpenAI]), ensure the necessary Vector Store ID is correctly configured in the URL and parameters.scheduleTrigger. Schedule trigger / Manual Trigger: The starting n8n trigger for the automation. Allows for periodic or manual execution of the n8n workflow.
Google Drive Node (List files from folder): Fetches metadata (like IDs and last modified times) for all files in the specified Google Drive folder.
HTTP Request Node (List vector store files [OpenAI]): Communicates with the OpenAI API to retrieve a list of existing file IDs and metadata within the designated vector store.
Compare Datasets Node: A crucial n8n node that compares the Google Drive list against the OpenAI list based on unique identifiers (likely file names or custom metadata) and modification timestamps, classifying the required action (Create, Update, Delete, Ignore).
Merge Node / Set Nodes: These n8n nodes handle the routing and preparation of data for the main processing loop.
Filter Node: Ensures only actionable files (non-ignored) proceed to the core loop in the n8n workflow.
Loop over files (Split In Batches Node): Iterates through each file that requires action (creation, update, or deletion).
Google Drive Node (Download new or updated file): Downloads the actual binary content of the file from Google Drive.
OpenAI Node (Upload new or updated file): This dedicated n8n node uploads the downloaded file to the OpenAI API file endpoint.
HTTP Request Node (Add uploaded file to vector store [OpenAI]): Links the uploaded OpenAI file ID to the target Vector Store ID using the OpenAI Assistant API endpoint.
Automate file synchronization from Google Drive directly into an InfraNodus knowledge graph. This expert n8n workflow handles PDF, Markdown, and text files using the n8n trigger and advanced data processing nodes.

Automate daily task creation by syncing Google Calendar events to Trello cards using this powerful n8n workflow. Filter recurring meetings and ensure essential tasks are captured.

Archive Gmail emails to PostgreSQL and backup attachments to S3/MinIO automatically. Use this reliable n8n workflow template for data compliance and searchability.

Automate contact synchronization from Google Sheets to SeaTable using this powerful n8n workflow. Implement smart upsert logic (create or update) ensuring your contact database is always current.

Automation consultant helping teams eliminate repetitive work. Successfully implemented n8n within an ISO27001-certified environment. Available for consulting on custom implementations, particularly around AI integrations.







































