AutomationFlowsData & Sheets › Automated Document Sync Between Sharepoint and Google Drive with Supabase

Automated Document Sync Between Sharepoint and Google Drive with Supabase

ByDIGITAL BIZ TECH @dbt on n8n.io

This workflow is a multi-system document synchronization pipeline built in n8n, designed to automatically sync and back up files between Microsoft SharePoint, Supabase/Postgres, and Google Drive.

Cron / scheduled trigger★★★★★ complexity30 nodesHTTP RequestSupabasePostgresGoogle Drive
Data & Sheets Trigger: Cron / scheduled Nodes: 30 Complexity: ★★★★★ Added:

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

This workflow follows the Google Drive → HTTP Request 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
{
  "nodes": [
    {
      "id": "2942a203-e59b-4e7e-817d-002885bcd5e5",
      "name": "Loop Over Items2",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -320,
        400
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "52071823-1ab8-41c1-a44c-8d05f18f270f",
      "name": "Microsoft SharePoint HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        640,
        432
      ],
      "parameters": {
        "": "",
        "url": "=https://<your-tenant>.sharepoint.com/sites/<your-site>/_api/web/GetFileByServerRelativeUrl('{{ $('Loop Over Items').item.json.ServerRelativeUrl }}')/$value\n",
        "method": "GET",
        "options": {
          "response": {
            "response": {
              "neverError": false,
              "fullResponse": false,
              "responseFormat": "file",
              "outputPropertyName": "data"
            }
          }
        },
        "sendBody": false,
        "sendQuery": false,
        "curlImport": "",
        "infoMessage": "",
        "sendHeaders": false,
        "authentication": "predefinedCredentialType",
        "httpVariantWarning": "",
        "nodeCredentialType": "microsoftSharePointOAuth2Api",
        "provideSslCertificates": false,
        "preBuiltAgentsCalloutHttpRequest": ""
      },
      "retryOnFail": true,
      "typeVersion": 4.2,
      "extendsCredential": "microsoftSharePointOAuth2Api"
    },
    {
      "id": "8976ad9b-14fc-408b-b995-e4e7bc9cd702",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1360,
        320
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "dae4c9ed-2fa1-43b9-8c96-baacef092b02",
      "name": "Compare Datasets",
      "type": "n8n-nodes-base.compareDatasets",
      "position": [
        -592,
        240
      ],
      "parameters": {
        "options": {},
        "fuzzyCompare": true,
        "mergeByFields": {
          "values": [
            {
              "field1": "sharepoint_file_id",
              "field2": "UniqueId"
            },
            {
              "field1": "Last_modified_date",
              "field2": "TimeLastModified"
            },
            {
              "field1": "Loading Done",
              "field2": "Exists"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "24e543d1-2def-405c-9d59-e3cbd80e87df",
      "name": "Supabase",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -1056,
        160
      ],
      "parameters": {
        "tableId": "n8n_metadata",
        "operation": "getAll",
        "returnAll": true,
        "useCustomSchema": true
      },
      "typeVersion": 1
    },
    {
      "id": "7109b99e-02a9-4b64-b030-71025f6d761c",
      "name": "Supabase1",
      "type": "n8n-nodes-base.supabase",
      "position": [
        -128,
        96
      ],
      "parameters": {
        "filters": {
          "conditions": [
            {
              "keyName": "id",
              "keyValue": "={{ $json.id }}",
              "condition": "eq"
            }
          ]
        },
        "tableId": "n8n_metadata",
        "operation": "delete"
      },
      "credentials": {
        "supabaseApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0fcdc702-66e6-4808-80cf-db3559acd2a2",
      "name": "Insert Document Metadata",
      "type": "n8n-nodes-base.postgres",
      "position": [
        384,
        432
      ],
      "parameters": {
        "table": {
          "__rl": true,
          "mode": "name",
          "value": "=n8n_metadata"
        },
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "columns": {
          "value": {
            "id": "={{ $('Set metadata').item.json.file_id }}",
            "url": "={{ $('Set metadata').item.json.file_url }}",
            "title": "={{ $('Set metadata').item.json.file_title.replaceSpecialChars() }}",
            "Last_modified_date": "={{ $json.last_modified_date }}",
            "sharepoint_file_id": "={{ $json.sharepoint_file_id }}",
            "sharepoint_folder_name": "={{ $json.foldername }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": true,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "url",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "created_at",
              "type": "dateTime",
              "display": true,
              "required": false,
              "displayName": "created_at",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "schema",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "schema",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "Last_modified_date",
              "type": "dateTime",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Last_modified_date",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "sharepoint_file_id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "sharepoint_file_id",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "sharepoint_folder_name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "sharepoint_folder_name",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            },
            {
              "id": "Loading Done",
              "type": "boolean",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Loading Done",
              "defaultMatch": false,
              "canBeUsedToMatch": false
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "upsert"
      },
      "executeOnce": true,
      "typeVersion": 2.5
    },
    {
      "id": "d5d5967d-11e3-4152-9c60-266afd1ef6be",
      "name": "Postgres",
      "type": "n8n-nodes-base.postgres",
      "onError": "continueErrorOutput",
      "position": [
        1488,
        416
      ],
      "parameters": {
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "n8n_metadata",
          "cachedResultName": "n8n_metadata"
        },
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "columns": {
          "value": {
            "id": "={{ $('Insert Document Metadata').item.json.id }}",
            "Loading Done": true
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": true,
              "displayName": "id",
              "defaultMatch": true,
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "created_at",
              "type": "dateTime",
              "display": true,
              "required": false,
              "displayName": "created_at",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "schema",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "schema",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last_modified_date",
              "type": "dateTime",
              "display": true,
              "required": false,
              "displayName": "Last_modified_date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "sharepoint_file_id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "sharepoint_file_id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "sharepoint_folder_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "sharepoint_folder_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Loading Done",
              "type": "boolean",
              "display": true,
              "required": false,
              "displayName": "Loading Done",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update"
      },
      "typeVersion": 2.6
    },
    {
      "id": "d89ee62e-023a-4437-8fd5-6ab82de340dc",
      "name": "Upload file",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1200,
        416
      ],
      "parameters": {
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "root",
          "cachedResultName": "/ (Root folder)"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "ede831b8-8846-4e13-9085-6d8027be9807",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2000,
        64
      ],
      "parameters": {
        "width": 512,
        "height": 496,
        "content": "#  SharePoint Sync Overview\n\n## How it works\nRuns on a schedule, fetches SharePoint folders and files, filters unwanted formats, and syncs metadata into a Postgres/Supabase table.  \nOnly new or modified files are processed.  uploads files to Google Drive for backup so google drive in sync with sharepoint\n\n## Setup steps\n1. Connect **SharePoint**, **Supabase/Postgres**, and **Google Drive** credentials.  \n2. Update folder URL and table name (`n8n_metadata`).  \n3. Adjust excluded extensions in the **Code8** node.  \n4. Set **Schedule Trigger** frequency.  \n5. Run once to verify IDs, URLs, and timestamps.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "946a98ba-2286-4f7c-a565-d54daf60db54",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        320
      ],
      "parameters": {
        "color": 7,
        "width": 176,
        "height": 240,
        "content": "## extract metadata"
      },
      "typeVersion": 1
    },
    {
      "id": "36db62ed-0b95-4ef7-bb5a-30c57cfe3ca4",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        224
      ],
      "parameters": {
        "color": 7,
        "height": 336,
        "content": "## Rename Files\nRenames each downloaded binary file  \nwith its corresponding SharePoint file title before upload.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "fad59bd5-92b6-4b2e-9577-9dfdaf215684",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1392,
        240
      ],
      "parameters": {
        "color": 7,
        "height": 320,
        "content": "## Postgres (Mark Complete)\nMarks entries as processed by setting `Loading Done = true`  \nonce uploads are complete.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "df5061b7-8935-4875-8e76-625994482128",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        224
      ],
      "parameters": {
        "color": 7,
        "height": 336,
        "content": "## Upload file (Google Drive)\nUploads downloaded files to Google Drive for safe storage or cross-system access.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "080ef3bd-a31e-408b-958e-d1f47dbddec5",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        224
      ],
      "parameters": {
        "color": 7,
        "width": 262,
        "height": 352,
        "content": "## Microsoft SharePoint HTTP Request1 (Download)\nDownloads each new or updated file directly from SharePoint using its `ServerRelativeUrl`.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f6649b09-f542-42e1-acfe-7ed1b147de0f",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        224
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 352,
        "content": "## Insert Document Metadata\nUpserts processed SharePoint file data into `n8n_metadata` (Postgres/Supabase).  \nCreates or updates existing records.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "4cdb293d-9ca2-49e1-be0e-3053c8e758bb",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        16
      ],
      "parameters": {
        "color": 7,
        "height": 240,
        "content": "### delete file from supabase (metadata table)"
      },
      "typeVersion": 1
    },
    {
      "id": "e9c869ff-d7b3-4884-8b76-f65f97a27e04",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        336
      ],
      "parameters": {
        "color": 7,
        "width": 192,
        "height": 400,
        "content": "## Filter Files\nFilters out system and temporary files (`~$`, `.db`, `.msg`, `.xlsx`, `.pptx`)  \nand flattens nested folders into a single clean file list.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "0995c238-776e-49b6-9a1f-3ecde5269b87",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -656,
        112
      ],
      "parameters": {
        "color": 7,
        "height": 336,
        "content": "## Compare Datasets\nCompares SharePoint and Supabase data  \nto detect new or updated files and flag records for processing.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b76d59ef-e870-4835-80e2-b402ce313375",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1136,
        336
      ],
      "parameters": {
        "color": 7,
        "height": 400,
        "content": "## Microsoft SharePoint HTTP Request\nRetrieves all folders and files recursively from the specified SharePoint document path.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "352884ed-4bf4-414f-9272-ab689614f9d6",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1120,
        16
      ],
      "parameters": {
        "color": 7,
        "height": 288,
        "content": "## Supabase (Get)\nRetrieves existing records from `n8n_metadata`  \nto check which SharePoint files are already stored.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "8c0bfdeb-23b8-45fe-9fdc-0ab4cdf28706",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1408,
        208
      ],
      "parameters": {
        "color": 7,
        "height": 256,
        "content": "## Schedule Trigger\nTriggers the workflow on a defined schedule \n"
      },
      "typeVersion": 1
    },
    {
      "id": "7cb642b1-049c-4379-a672-061d6bf5e38c",
      "name": "Microsoft SharePoint HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1072,
        544
      ],
      "parameters": {
        "": "",
        "url": "https://<your-tenant>.sharepoint.com/sites/<your-site>/_api/web/GetFolderByServerRelativeUrl('/sites/<your-site>/<document-library>/<subfolders>')?$expand=Files,Folders,Folders/Files,Folders/Folders/Folders/Files,Folders/Folders/Folders/Folders/Files\n",
        "method": "GET",
        "options": {
          "response": {
            "response": {
              "neverError": false,
              "fullResponse": false,
              "responseFormat": "autodetect"
            }
          }
        },
        "sendBody": false,
        "sendQuery": false,
        "curlImport": "",
        "infoMessage": "",
        "sendHeaders": false,
        "authentication": "predefinedCredentialType",
        "httpVariantWarning": "",
        "nodeCredentialType": "microsoftSharePointOAuth2Api",
        "provideSslCertificates": false,
        "preBuiltAgentsCalloutHttpRequest": ""
      },
      "typeVersion": 4.2,
      "extendsCredential": "microsoftSharePointOAuth2Api"
    },
    {
      "id": "1c967ff9-05de-46c9-9e79-1b5e558871da",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        16
      ],
      "parameters": {
        "color": 7,
        "width": 160,
        "height": 288,
        "content": "### standardizes \n`Last_modified_date` "
      },
      "typeVersion": 1
    },
    {
      "id": "69d5f0d5-3a18-4430-a6a2-a8d1e8c70fbc",
      "name": "filter files",
      "type": "n8n-nodes-base.code",
      "position": [
        -832,
        544
      ],
      "parameters": {
        "jsCode": "// This is the final, universal code that will get all your files.\n// It recursively finds all files and filters out temporary/system files.\nconst allFiles = [];\nconst excludedExtensions = ['.db', '.msg', '.xlsx','.xlsm','.pptx']; // <-- UPDATED THIS LINE\n\n/**\n * This function recursively digs through a folder structure to find all files.\n * @param {Object} folder - A folder object that may contain files and other folders.\n */\nfunction findFilesRecursively(folder) {\n  // Safety check to make sure we have a valid folder\n  if (!folder || typeof folder !== 'object') {\n    return;\n  }\n\n  // If there's a 'Files' array, add its contents to our main list\n  if (Array.isArray(folder.Files)) {\n    allFiles.push(...folder.Files);\n  }\n\n  // If there's a 'Folders' array, run this same function on each subfolder\n  if (Array.isArray(folder.Folders)) {\n    for (const subFolder of folder.Folders) {\n      findFilesRecursively(subFolder);\n    }\n  }\n}\n\n// Directly process the first item from the input.\nconst topLevelFolderObject = $input.item.json;\n\n// The data you provided is a single object with a \"Folders\" key at the top.\n// We start the search from this single object.\nfindFilesRecursively(topLevelFolderObject);\n\n// Filter out items based on multiple conditions\nconst filteredFiles = allFiles.filter(item => {\n  // Ensure item.Name exists and is a string before proceeding\n  if (typeof item.Name !== 'string') {\n    return false; // Exclude items that don't have a valid Name property\n  }\n  const fileName = item.Name;\n  const lowerCaseFileName = fileName.toLowerCase();\n\n  // Condition 1: Check if the filename starts with '~$' (Office temporary files)\n  const isTempFile = fileName.startsWith('~$');\n\n  // Condition 2: Check if the filename ends with an excluded extension\n  const hasExcludedExtension = excludedExtensions.some(ext => lowerCaseFileName.endsWith(ext));\n\n  // Keep the file only if it is NOT a temp file AND does NOT have an excluded extension\n  return !isTempFile && !hasExcludedExtension;\n});\n\n\n// Return the final, flattened list of all valid file items.\nreturn filteredFiles.map(file => ({ json: file }));"
      },
      "executeOnce": false,
      "typeVersion": 2
    },
    {
      "id": "c15798ab-a2eb-457c-a6cb-8471ab4427be",
      "name": "normalize last modified date",
      "type": "n8n-nodes-base.set",
      "position": [
        -832,
        160
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4244c0ca-eef1-4674-ae75-8c7f9f06018b",
              "name": "Last_modified_date",
              "type": "string",
              "value": "={{ $json[\"Last_modified_date\"] + \"Z\" }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "2530cd81-1586-4fdb-bafb-5df0723f6d26",
      "name": "get metadata",
      "type": "n8n-nodes-base.code",
      "position": [
        -48,
        432
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\n\nconst outputItems = items.map(item => {\n  const data = item.json;\n  \n  // Use existing LinkingUrl if available\n  if (data.LinkingUrl) {\n    return {\n      json: {\n        ...data,\n        fileUrl: data.LinkingUrl\n      }\n    };\n  }\n  \n  // Construct versioned URL\n  let fileUrl = '';\n  \n  if (data.ServerRelativeUrl && data.UniqueId) {\n    // Base URL with server relative path\n    fileUrl = 'https://nosta.sharepoint.com' + data.ServerRelativeUrl;\n    \n    // Use UniqueId for version parameter (remove hyphens)\n    const versionId = data.UniqueId.replace(/-/g, '');\n    fileUrl += `?d=w${versionId}`;\n  }\n  \n  return {\n    json: {\n      ...data,\n      fileUrl: fileUrl\n    }\n  };\n});\n\nreturn outputItems;"
      },
      "typeVersion": 2
    },
    {
      "id": "bc244e21-105c-4cc1-8ef9-f97965abfe90",
      "name": "Set metadata",
      "type": "n8n-nodes-base.set",
      "position": [
        176,
        432
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "10646eae-ae46-4327-a4dc-9987c2d76173",
              "name": "file_id",
              "type": "string",
              "value": "={{ $json.UniqueId }}"
            },
            {
              "id": "f4536df5-d0b1-4392-bf17-b8137fb31a44",
              "name": "file_type",
              "type": "string",
              "value": "={{ $json.Name.split('.').pop() }}"
            },
            {
              "id": "77d782de-169d-4a46-8a8e-a3831c04d90f",
              "name": "file_title",
              "type": "string",
              "value": "={{ $json.Name }}"
            },
            {
              "id": "9bde4d7f-e4f3-4ebd-9338-dce1350f9eab",
              "name": "file_url",
              "type": "string",
              "value": "={{ $json.fileUrl }}"
            },
            {
              "id": "fae402c8-c486-4b57-8d28-bf669db6b442",
              "name": "last_modified_date",
              "type": "string",
              "value": "={{ $json.TimeLastModified }}"
            },
            {
              "id": "866ce582-16e2-4869-ac77-13f248c187eb",
              "name": "sharepoint_file_id",
              "type": "string",
              "value": "={{ $json.UniqueId }}"
            },
            {
              "id": "cf44a6ba-c561-4656-8bb5-08cea16f0035",
              "name": "foldername",
              "type": "string",
              "value": "={{ JSON.stringify($json['odata.id'].split('(')[1].split('/').slice(5, -1)) }}\n"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e5935403-cf3a-4ee7-9b1a-d1b8b24f9c35",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        304
      ],
      "parameters": {
        "color": 7,
        "height": 256,
        "content": "### loop over newly added or modified files"
      },
      "typeVersion": 1
    },
    {
      "id": "118eacaa-e244-48d9-8b7d-5bbff742a63a",
      "name": "rename files",
      "type": "n8n-nodes-base.code",
      "position": [
        928,
        416
      ],
      "parameters": {
        "jsCode": "$input.item.binary.data.fileName = $input.first().json.title\n\nreturn $input.item;"
      },
      "typeVersion": 2
    }
  ],
  "connections": {
    "Postgres": {
      "main": [
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "Supabase": {
      "main": [
        [
          {
            "node": "normalize last modified date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Supabase1": {
      "main": [
        []
      ]
    },
    "Upload file": {
      "main": [
        [
          {
            "node": "Postgres",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set metadata": {
      "main": [
        [
          {
            "node": "Insert Document Metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "filter files": {
      "main": [
        [
          {
            "node": "Compare Datasets",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "get metadata": {
      "main": [
        [
          {
            "node": "Set metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rename files": {
      "main": [
        [
          {
            "node": "Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compare Datasets": {
      "main": [
        [
          {
            "node": "Supabase1",
            "type": "main",
            "index": 0
          }
        ],
        [],
        [],
        [
          {
            "node": "Loop Over Items2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items2": {
      "main": [
        [],
        [
          {
            "node": "get metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Supabase",
            "type": "main",
            "index": 0
          },
          {
            "node": "Microsoft SharePoint HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert Document Metadata": {
      "main": [
        [
          {
            "node": "Microsoft SharePoint HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "normalize last modified date": {
      "main": [
        [
          {
            "node": "Compare Datasets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Microsoft SharePoint HTTP Request": {
      "main": [
        [
          {
            "node": "filter files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Microsoft SharePoint HTTP Request1": {
      "main": [
        [
          {
            "node": "rename files",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items2",
            "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 workflow is a multi-system document synchronization pipeline built in n8n, designed to automatically sync and back up files between Microsoft SharePoint, Supabase/Postgres, and Google Drive.

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

More Data & Sheets workflows → · Browse all categories →

Related workflows

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

Data & Sheets

Automated Knowledge Management Backup & Recovery. Uses executeCommand, postgres, httpRequest, googleDrive. Scheduled trigger; 30 nodes.

Execute Command, Postgres, HTTP Request +1
Data & Sheets

This workflow acts as a junior finance research analyst for a UK boutique M&A or corporate finance team. It listens for Slack messages, classifies the request, gathers company or market data, and prod

HTTP Request, Google Drive, Google Docs +5
Data & Sheets

Disparador 1.8. Uses itemLists, postgres, emailSend, httpRequest. Scheduled trigger; 85 nodes.

Item Lists, Postgres, Email Send +1
Data & Sheets

공유회_알림톡_크론. Uses postgres, httpRequest, n8n-nodes-solapi. Scheduled trigger; 39 nodes.

Postgres, HTTP Request, N8N Nodes Solapi
Data & Sheets

QuepasaAutomatic. Uses postgres, postgresTrigger, httpRequest. Scheduled trigger; 39 nodes.

Postgres, Postgres Trigger, HTTP Request