AutomationFlowsGeneral › Google Drive Workflow with Nested Folder Support

Google Drive Workflow with Nested Folder Support

ByZain Ali @zain104 on n8n.io

Anyone who needs to recursively fetch all files from a specific Google Drive folder, including files inside all its nested (child) folders. Ideal for automation builders, admins, and integrators who want to process, move, list, or report on all files in a complex folder tree.

Event trigger★★★★☆ complexity14 nodesExecute Workflow TriggerGoogle Drive
General Trigger: Event Nodes: 14 Complexity: ★★★★☆ Added:

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

This workflow follows the Execute Workflow Trigger → Google Drive 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": "WyWBYMQWkj2qOEYW",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Get all files inside a GoogleDrive Folder",
  "tags": [],
  "nodes": [
    {
      "id": "7ad58632-aaae-49d1-8a4d-192696ea5fbe",
      "name": "If parent folder has no folder",
      "type": "n8n-nodes-base.if",
      "position": [
        720,
        224
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "e295dc16-bee6-4c2d-a1c4-275c093ee98a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        -304
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "306a72d8-17cb-491e-ab71-563d67033dc4",
      "name": "If parent folder has nested folders or not",
      "type": "n8n-nodes-base.if",
      "position": [
        464,
        96
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "c7066d3c-db7e-4d10-8ea7-844f4a7f92b5",
      "name": "Start Execution",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -16,
        96
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "37ad0017-a81e-4142-a699-5979917d3e3e",
      "name": "Get all folder ids",
      "type": "n8n-nodes-base.code",
      "position": [
        928,
        -32
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "f395e3b0-4010-4ce6-b9e4-d40c38eaf6e2",
      "name": "Return parent folder id",
      "type": "n8n-nodes-base.set",
      "position": [
        928,
        144
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "69349d16-147a-4a53-921f-2afbce976421",
      "name": "Return parent folder id to sub-workflow",
      "type": "n8n-nodes-base.set",
      "position": [
        928,
        304
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "cc185a48-6793-4dea-ab4b-1a4227391552",
      "name": "Start sub-execution",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        720,
        -32
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "97895244-0065-4aa8-b200-87782f6bcf8c",
      "name": "Get children folders from folder id",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        240,
        96
      ],
      "parameters": {},
      "executeOnce": true,
      "typeVersion": 3,
      "alwaysOutputData": true
    },
    {
      "id": "9df3e103-c7a7-41dc-a5e0-0b77b4959a93",
      "name": "Loop Over folder ids",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1600,
        -32
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "15f2bc5a-0c2f-45f8-b7dc-b4775641f6c1",
      "name": "Get all files inside a folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1856,
        192
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "1fe7e380-e5a2-422d-a91f-3c9382fadedf",
      "name": "Return all file ids",
      "type": "n8n-nodes-base.set",
      "position": [
        1856,
        -48
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "c9b24b37-9745-4e4d-b9bc-895765c0b210",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        -128
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "fe94e670-7de0-42ce-889b-d755b4edb5bf",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1424,
        -128
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "49da4933-34df-466f-912e-7bd8f02d0b20",
  "connections": {
    "Start Execution": {
      "main": [
        [
          {
            "node": "Get children folders from folder id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all folder ids": {
      "main": [
        [
          {
            "node": "Loop Over folder ids",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start sub-execution": {
      "main": [
        [
          {
            "node": "Get all folder ids",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over folder ids": {
      "main": [
        [
          {
            "node": "Return all file ids",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get all files inside a folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Return parent folder id": {
      "main": [
        [
          {
            "node": "Loop Over folder ids",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all files inside a folder": {
      "main": [
        [
          {
            "node": "Loop Over folder ids",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If parent folder has no folder": {
      "main": [
        [
          {
            "node": "Return parent folder id",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Return parent folder id to sub-workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get children folders from folder id": {
      "main": [
        [
          {
            "node": "If parent folder has nested folders or not",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Return parent folder id to sub-workflow": {
      "main": [
        []
      ]
    },
    "If parent folder has nested folders or not": {
      "main": [
        [
          {
            "node": "Start sub-execution",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If parent folder has no folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

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

About this workflow

Anyone who needs to recursively fetch all files from a specific Google Drive folder, including files inside all its nested (child) folders. Ideal for automation builders, admins, and integrators who want to process, move, list, or report on all files in a complex folder tree.

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

More General workflows → · Browse all categories →

Related workflows

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

General

Code. Uses manualTrigger, executeWorkflowTrigger, googleDrive, stickyNote. Event-driven trigger; 16 nodes.

Execute Workflow Trigger, Google Drive
General

This workflow creates nested Google Drive folders from a path string (like ). It automatically handles the necessary folder lookups and creation steps required by Google Drive, then outputs the final

Execute Workflow Trigger, Google Drive
General

UpdateGame. Uses limit, executeWorkflowTrigger, googleDrive, convertToFile. Event-driven trigger; 13 nodes.

Execute Workflow Trigger, Google Drive
General

🎯 Purpose: Generate audio files from text scripts stored in Google Drive.

Execute Workflow Trigger, Google Drive, Read Write File +1
General

google-drive. Uses executeWorkflowTrigger, n8n-nodes-evolution-api, googleDrive. Event-driven trigger; 10 nodes.

Execute Workflow Trigger, N8N Nodes Evolution Api, Google Drive