AutomationFlowsWeb Scraping › Sync Google Drive Files to an Infranodus Knowledge Graph

Sync Google Drive Files to an Infranodus Knowledge Graph

ByInfraNodus @infranodus on n8n.io

This template can be used to sync the files in your Google drive to a new or existing InfraNodus knowledge graph.

Event trigger★★★★☆ complexity16 nodesGoogle DriveHTTP RequestGoogle Drive Trigger
Web Scraping Trigger: Event Nodes: 16 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #4495 — we link there as the canonical source.

This workflow follows the Google Drive → Google Drive Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "SMDFq24qv9Xc02SM",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Sync Google Drive files to an InfraNodus Graph",
  "tags": [],
  "nodes": [
    {
      "id": "b3c9c0dd-7f02-42d0-9fd0-bf25319cf0f0",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -220,
        -100
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "a41556ba-b7db-41b5-8213-e1aff3f7fe03",
      "name": "Retrieve File",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        260,
        -180
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "bc74f177-7ff6-4c3b-b63a-6f9f2d11a9b8",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        680,
        -20
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "pdf",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "7b4e792b-ab6d-4b9b-88a1-d8e51bea6853",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{$binary[\"data\"].mimeType}}",
                    "rightValue": "application/pdf"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "text",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "09b7d7c5-5353-4719-b4e2-072e4da39948",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{$binary[\"data\"].mimeType}}",
                    "rightValue": "text/plain"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "md",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "cb2e6726-97d8-4541-8383-deafff9b18e6",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{$binary[\"data\"].mimeType}}",
                    "rightValue": "text/markdown"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "json",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "d2763a45-a592-47c8-868f-59dfcd17a71c",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{$binary[\"data\"].mimeType}}",
                    "rightValue": "application/json"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "docs",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "0d9b561f-89c5-479e-a4e2-1f5f05fa8417",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{$binary[\"data\"].mimeType}}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "csv",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "6b19deed-5d00-4796-bb9d-b4d87564a751",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{$binary[\"data\"].mimeType}}",
                    "rightValue": "csv"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "1844fd33-c4a3-43ef-b945-dcf433f7e424",
      "name": "Extract from PDF",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        920,
        -260
      ],
      "parameters": {
        "options": {},
        "operation": "pdf"
      },
      "typeVersion": 1
    },
    {
      "id": "6da5e064-8ea3-4c2c-9bc9-5c66deb63b3a",
      "name": "Extract from Text File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        920,
        -60
      ],
      "parameters": {
        "options": {},
        "operation": "text"
      },
      "typeVersion": 1
    },
    {
      "id": "6b70f1e5-82ca-4109-8047-7b9491fa7619",
      "name": "Extract from Markdown",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        920,
        140
      ],
      "parameters": {
        "options": {},
        "operation": "text"
      },
      "typeVersion": 1
    },
    {
      "id": "e46d8e8d-72b5-4a57-bb09-6915b4af28e5",
      "name": "InfraNodus Save to Graph",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1580,
        240
      ],
      "parameters": {
        "url": "https://infranodus.com/api/v1/graphAndStatements?doNotSave=false&optimize=develop&includeGraph=false&includeGraphSummary=true&includeGraph=false",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "name",
              "value": "polysingularity_from_google_drive"
            },
            {
              "name": "text",
              "value": "={{ $json.data }}"
            },
            {
              "name": "=categories",
              "value": "=[filename: {{ $('Switch').item.json.name }}]"
            },
            {
              "name": "contextSettings",
              "value": "={{{ \"squareBracketsProcessing\":\"IGNORE_BRACKETS\"} }}"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "cebe84e6-3f9d-4806-b42a-2664717baef1",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -540,
        -360
      ],
      "parameters": {
        "width": 500,
        "height": 520,
        "content": "## 1. Listen to a Google Drive folder / create new file event\n\n### You need to create the folder first and upload the files there. \n\n\ud83d\udea8 Specify the folder you want to use here"
      },
      "typeVersion": 1
    },
    {
      "id": "cff84fdb-9fd1-4600-a436-d452ec73778d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        -360
      ],
      "parameters": {
        "width": 500,
        "height": 520,
        "content": "## 2. Iterate through every file extracted\n\n### We get the ID of the file and iterate through them one by one\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e0e1bab5-e281-4572-8207-227aec2fe4bf",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        -520
      ],
      "parameters": {
        "width": 500,
        "height": 840,
        "content": "## 3. Extract text from the files\n\n### Use the built-in n8n extractor tools to convert different file formats: PDF, txt, or markdown to plain text.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "879324fc-275a-4e5f-b23d-d9a3369d86ac",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        -380
      ],
      "parameters": {
        "width": 500,
        "height": 840,
        "content": "## 4. Save the file to InfraNodus\n\n### Save the text content of the file to the graph, using its name as category (so you can manually delete it after) and additional processing settings (in the `body` field of the POST request.\n\nNote: you can use an existing graph name (the `name` field) or specify a new name and the graph will be created.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "de8c6bde-5576-44d4-9bdf-8e36e22ff00d",
      "name": "Map PDF to Text",
      "type": "n8n-nodes-base.set",
      "position": [
        1240,
        -100
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "fd160009-0b92-46fc-9e34-a1283b810e91",
              "name": "data",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "571a5204-afae-4329-9d87-c0474dadb20b",
      "name": "New File Created in the Google Folder?",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -480,
        -100
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {
          "fileType": "all"
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1NFekB1_H3ADF8C5o4eN_l893d6INbfRA",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1NFekB1_H3ADF8C5o4eN_l893d6INbfRA",
          "cachedResultName": "Polysingularity"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "dda0c5dc-b90f-4ca9-b662-387ee7166985",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1820,
        -380
      ],
      "parameters": {
        "color": 2,
        "width": 500,
        "height": 840,
        "content": "## Optional: Better PDF Conversion\n\n### Standard Map PDF to Text node will split your PDF files into very short chunks, which deteriorates retrieval. \n\nUse can use [ConvertAPI](https://convertapi.com?ref=4l54n) which is a high-quality convertor that will respect the layout of the original document and not cut the paragraphs into short chunks. \n\nHere is an HTTP node that makes a request to their API to convert the PDF into text. If you have a ConvertAPI account, you can replace the \"Map PDF to Text\" node in step 4 with this node. \n"
      },
      "typeVersion": 1
    },
    {
      "id": "a3461e66-7325-47aa-a56a-3cafceb44d15",
      "name": "Convert File to PDF",
      "type": "n8n-nodes-base.httpRequest",
      "disabled": true,
      "position": [
        1880,
        0
      ],
      "parameters": {
        "url": "https://v2.convertapi.com/convert/pdf/to/txt",
        "method": "POST",
        "options": {
          "response": {
            "response": {
              "responseFormat": "text"
            }
          }
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "file",
              "parameterType": "formBinaryData",
              "inputDataFieldName": "data"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Accept",
              "value": "application/octet-stream"
            }
          ]
        }
      },
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.2
    },
    {
      "id": "84c03b58-a47f-4465-a9bc-f7ad050bcdc6",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -540,
        -1420
      ],
      "parameters": {
        "color": 6,
        "width": 1060,
        "height": 980,
        "content": "# Sync Google Drive files to an InfraNodus graph\n\n## This workflow listens to newly added files in the Google Drive folder you specify and automatically uploads it to a new or existing [InfraNodus graph](https://infranodus.com). \n\n### InfraNodus visualizes your text as a knowledge graph, showing the main topics and ideas inside. It also provides API access to your knownledge graphs, so you can use them as \"experts\" for your AI agent n8n workflows.\n\nYou need an [InfraNodus](https://infranodus.com) account to use this workflow.\n\nDetailed tutorial on this workflow: [https://support.noduslabs.com/hc/en-us/articles/20267019838108-Upload-Sync-Your-Google-Drive-Folder-with-InfraNodus-using-n8n](https://support.noduslabs.com/hc/en-us/articles/20267019838108-Upload-Sync-Your-Google-Drive-Folder-with-InfraNodus-using-n8n)\n\n\ud83d\udea8 note that when you delete the file, you'll have to manually remove it from InfraNodus\n\n\n![InfraNodus Graph](https://infranodus.com/images/front/infranodus-overview.jpg)\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "57fa8143-ac10-4655-8fe0-5e046ad022ad",
  "connections": {
    "Switch": {
      "main": [
        [
          {
            "node": "Extract from PDF",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract from Text File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Extract from Markdown",
            "type": "main",
            "index": 0
          }
        ],
        [],
        []
      ]
    },
    "Retrieve File": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Retrieve File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map PDF to Text": {
      "main": [
        [
          {
            "node": "InfraNodus Save to Graph",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from PDF": {
      "main": [
        [
          {
            "node": "Map PDF to Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from Markdown": {
      "main": [
        [
          {
            "node": "InfraNodus Save to Graph",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract from Text File": {
      "main": [
        [
          {
            "node": "InfraNodus Save to Graph",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "InfraNodus Save to Graph": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New File Created in the Google Folder?": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This template can be used to sync the files in your Google drive to a new or existing InfraNodus knowledge graph.

Source: https://n8n.io/workflows/4495/ — original creator credit. Request a take-down →

More Web Scraping workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Web Scraping

Automatically deploy n8n workflows by simply dropping JSON files into a Google Drive folder—this template watches for new exports, cleans and imports them into your n8n instance, applies a tag, and th

HTTP Request, Google Drive, Google Drive Trigger
Web Scraping

This n8n workflow simplifies the process of removing backgrounds from images stored in Google Drive. By leveraging the PhotoRoom API, this template enables automatic background removal, padding adjust

HTTP Request, Google Drive, Edit Image +1
Web Scraping

Stop wasting hours on video captioning. Upload your videos to a Google Drive folder, and ZapCap automatically generates professional subtitles for you. Download the finished video from your Google Dri

Google Drive Trigger, HTTP Request, Google Drive
Web Scraping

Save a .md file to the folder set in the triggers. This workflow will check every hour, convert the md file to HTML, and create a confluence page for it. If the md file is updated or changed in the fo

Google Drive Trigger, Google Drive, HTTP Request
Web Scraping

This n8n workflow automates the process of converting a newly stored PDF file from Google Drive into an HTML file and saving it back to Google Drive. The workflow is triggered whenever a new PDF is up

Google Drive Trigger, HTTP Request, Google Drive