Google Drive File Synchronization to Knowledge Graph - n8n Workflow

Automate file uploads from Google Drive folders directly into your InfraNodus knowledge graph. Use this n8n workflow to build a powerful RAG system for document analysis.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Users building Retrieval-Augmented Generation (RAG) systems.

  • Researchers or knowledge managers automating document ingestion.

  • Professionals needing to synchronize documentation stored in Google Drive.

  • Anyone looking for robust n8n templates for complex file processing and API integration.

Overview

This expert n8n workflow solves the challenge of manually transferring and processing documents from cloud storage into specialized knowledge management systems like InfraNodus. By leveraging specialized file handling and extraction n8n node functionality, you can ingest various file types (PDFs, Markdown, text files) seamlessly. This particular n8n workflow is highly valuable for setting up a foundation for advanced AI applications, such as Retrieval-Augmented Generation (RAG), ensuring your InfraNodus graph is consistently populated with the latest information residing in your Google Drive folders. The efficiency of this n8n automation template minimizes manual effort and speeds up the data preparation process.

How it Works

The process initiates using a Manual n8n trigger, labeled 'When clicking ‘Test workflow’.' The execution immediately proceeds to the 'Search Google Drive' n8n node, which is configured to retrieve all files from a pre-defined Google Drive folder (the 'GraphRAG' folder).


  1. Iteration: The 'Loop Over Items' n8n node (Split In Batches) ensures that each file retrieved is processed individually.

  2. Download: The 'Retrieve File' n8n node downloads the binary content of the currently looped item using its unique file ID.

  3. MIME Type Routing: A critical 'Switch' n8n node inspects the downloaded file's MIME type (e.g., application/pdf, text/plain). It directs the flow based on the detected file format.

  4. Content Extraction: Dedicated Extract from File n8n nodes ('Extract from PDF', 'Extract from Text File', 'Extract from Markdown') are used to convert binary file data into clean, readable text. The PDF output is normalized using a 'Set' n8n node ('Map PDF to Text').

  5. Knowledge Base Upload: Finally, the extracted text content is sent via the 'InfraNodus Save to Graph' n8n node (an HTTP Request node). This final n8n node posts the data to the InfraNodus API, creating or updating the specified knowledge graph. Crucially, it assigns the original Google Drive filename as a category for easy source tracking.

Installation Guide

To deploy this n8n workflow, follow these steps:


  1. Import: Copy the provided JSON data and import it into your n8n instance via the 'Workflows' section.

  2. Google Drive Credentials: Locate the 'Search Google Drive' and 'Retrieve File' n8n node. You must set up a credential using Google Drive OAuth2 API that allows n8n access to your Drive files.

  3. InfraNodus Credentials: Locate the 'InfraNodus Save to Graph' n8n node. Configure a new 'HTTP Bearer Auth' credential using your personal InfraNodus API Key.

  4. Folder Configuration: In the 'Search Google Drive' n8n node parameters, ensure you update the 'Folder ID' to point to the specific Google Drive folder containing the files you wish to upload.

  5. Execution: Use the manual n8n trigger to test the workflow. It is recommended to run this n8n workflow once and then deactivate it to prevent content duplication unless specific synchronization logic is added.

Node Details


  • When clicking ‘Test workflow’ (Manual Trigger): Serves as the initial n8n trigger point for the entire automation. This specific n8n trigger is ideal for single-run ingestion tasks.

  • Search Google Drive (Google Drive n8n node): Finds files within a specified source folder ID (e.g., 1ep1yoEl7vxMdrTmvdlDnOXRlXwdxZTzX). Configured to return all file metadata.

  • Loop Over Items (Split In Batches n8n node): Ensures sequential processing of each file retrieved by the Google Drive n8n node.

  • Retrieve File (Google Drive n8n node): Downloads the binary data for the file currently being processed. Uses expression ={{ $json.id }} to dynamically fetch the file ID.

  • Switch (Core Logic n8n node): Routes the flow based on the file's MIME type, using dynamic data $binary["data"].mimeType to determine the correct text extraction path (PDF, Text, Markdown, etc.).

  • Extract from PDF / Extract from Text File / Extract from Markdown (Extract from File n8n nodes): Converts the binary file content into usable plain text.

  • Map PDF to Text (Set n8n node): A normalization step ensuring the extracted PDF text is mapped to a consistent field (data) before the final API call.

  • InfraNodus Save to Graph (HTTP Request n8n node): The final action. Sends a POST request to the InfraNodus API containing the extracted text (={{ $json.data }}). It also defines the graph name and includes the original file name in the categories field, demonstrating robust configuration within this n8n node.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by

I'm Dmitry, the founder of InfraNodus — an AI text network analysis tool. I'm passionate about networks and data visualization and its ability to reveal what everyone else is missing and to highlight different perspectives. I'm sharing the n8n templates that make use of this unique capability of InfraNodus for multiple scenarios.

Featured*