⚑n8n Workflow
Advanced

Google Drive Bulk File Uploader with Folder Management

Automate bulk file uploads to Google Drive via a simple web form. This workflow automatically creates folders if they don't exist and organizes your files seamlessly.

Overview

Streamlines batch file uploads to Google Drive, automatically creating destination folders as needed via a public web form.

πŸ—‚οΈ Description & Use Case

This workflow provides a powerful solution for bulk uploading files to Google Drive through a simple web form. It intelligently checks if a specified folder exists, creates it if it doesn't, and then uploads all the files, saving you time and ensuring your Drive stays organized.

πŸ”„ How It Works:

  1. Trigger with a Form: The workflow starts when a user submits the On form submission trigger. This public form allows users to upload multiple files and enter a desired folderName.

  2. Search for Folder: The Search specific folder node uses the Google Drive API to look for a folder matching the name provided in the form. The node is configured to always output data, which is crucial for the next step.

  3. Conditional Check: The Folder found ? If node checks the output from the search step.

    • If a folder was found (TRUE path), the workflow proceeds to upload files to the existing folder.
    • If no folder was found (FALSE path), it first creates the folder.
  4. Create Folder (If Needed): On the FALSE path, the Create Folder node generates a new folder in Google Drive with the specified name.

  5. Prepare and Upload Files:

    • The Code nodes (Prepare Files for Upload and Prepare Files for New Folder) process the form's binary data, splitting the batch of files into individual items that can be uploaded one by one.
    • The Google Drive nodes (Upload Files and Upload to New Folder) then take these individual files and upload them to the correct destination folderβ€”either the one that was found or the one that was just created.

βœ… Real-World Use Cases:

  • Team Collaboration: Create a central, easy-to-use form for team members to submit project files (e.g., marketing assets, design mockups, reports) to a shared Google Drive structure without needing direct access or complex instructions.
  • Client Submissions: Provide clients with a simple link to upload required documents (e.g., invoices, contracts, project briefs) directly into a designated, organized folder.
  • Data Collection: Use it as a backend for collecting user-generated content, event photos, or application documents from a large group of people.
  • Personal Organization: A quick way to batch upload personal files (like photos, scans, or documents) into neatly organized folders on your own Google Drive without manual folder creation and file moving.

Instructions

Basic steps

  1. Download workflow JSON
  2. Import into n8n
  3. Configure node parameters as needed
  4. Test and enable the workflow

πŸ’‘ Tips

After importing, verify all connectors and credentials match your environment.

Preview

Workflow Visualization

13 nodes
100%
On form submissionformTriggerGet Folder NamesetSearch specific foldergoogleDriveFolder found ?ifCreate FoldergoogleDriveUpload FilesgoogleDrivePrepare Files for UploadcodePrepare Files for New FoldercodeUpload to New FoldergoogleDriveSticky NotestickyNoteSticky Note1stickyNoteSticky Note2stickyNoteSticky Note4stickyNote

Nodes

1

On form submission

formTrigger

v2.2
2

Get Folder Name

set

v3.4
3

Search specific folder

googleDrive

v3
4

Folder found ?

if

v2.2
5

Create Folder

googleDrive

v3
6

Upload Files

googleDrive

v3
7

Prepare Files for Upload

code

v2
8

Prepare Files for New Folder

code

v2
9

Upload to New Folder

googleDrive

v3
10

Sticky Note

stickyNote

v1
11

Sticky Note1

stickyNote

v1
12

Sticky Note2

stickyNote

v1
13

Sticky Note4

stickyNote

v1

Statistics

Total nodes:13
Disabled nodes:0
Node types:6
Connections:7
View full JSON structure
{
  "nodes": [
    {
      "id": "9252c041-d6b2-49fe-8edb-8d8cb8a1341d",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        240,
        0
      ],
      "webhookId": "0c5c8b39-06a7-4d07-95be-b729d2a9eb6f",
      "parameters": {
        "options": {},
        "formTitle": "Batch File Upload to Google Drive",
        "formFields": {
          "values": [
            {
              "fieldType": "file",
              "fieldLabel": "file",
              "requiredField": true
            },
            {
              "fieldLabel": "folderName",
              "requiredField": true
            }
          ]
        },
        "formDescription": "Use this form to upload multiple files to a specific Google Drive folder. Simply select your files and specify your target folder name. If the folder doesn't exist yet, we'll create it automatically for you. This streamlined process allows you to organize and store multiple files in one go, saving you time and effort."
      },
      "typeVersion": 2.2
    },
    {
      "id": "e27712ac-238d-4b45-b842-a044dc40dccd",
      "name": "Get Folder Name",
      "type": "n8n-nodes-base.set",
      "position": [
        560,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "1b997842-86f3-4bce-b8d2-e8d73387dae1",
              "name": "folderName",
              "type": "string",
              "value": "={{ $json.folderName }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "555e761a-ea79-40eb-b36f-72fbcc642fda",
      "name": "Search specific folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        800,
        0
      ],
      "parameters": {
        "filter": {},
        "options": {},
        "resource": "fileFolder",
        "queryString": "=mimeType='application/vnd.google-apps.folder' and name = '{{ $json.folderName }}' and '<folderId>' in parents\n",
        "searchMethod": "query"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "2SIFnsVfdw9nx9I4",
          "name": "Google Drive account"
        }
      },
      "executeOnce": false,
      "typeVersion": 3,
      "alwaysOutputData": true
    },
    {
      "id": "2a92c031-44e5-4e07-89ff-058251c43027",
      "name": "Folder found ?",
      "type": "n8n-nodes-base.if",
      "position": [
        1280,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "11abd7e3-d90b-4bb1-a8ba-d3cbc4333d8f",
              "operator": {
                "type": "object",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e413cdc8-8424-41d3-8791-e036392a16ac",
      "name": "Create Folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1680,
        100
      ],
      "parameters": {
        "name": "={{ $('On form submission').item.json.folderName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "17sGS9HdmAtgpd5rC1sVuiIUGyw2hq9IY",
          "cachedResultUrl": "https://drive.google.com/drive/folders/17sGS9HdmAtgpd5rC1sVuiIUGyw2hq9IY",
          "cachedResultName": "n8n"
        },
        "resource": "folder"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "2SIFnsVfdw9nx9I4",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "aada549c-3bbd-453b-9d48-4ab25446d8ce",
      "name": "Upload Files",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2180,
        -100
      ],
      "parameters": {
        "name": "={{ $json.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Search specific folder').item.json.id }}"
        },
        "inputDataFieldName": "=data"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "2SIFnsVfdw9nx9I4",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "7b4bcb6e-3b63-4243-8f38-a18f3d5d44f2",
      "name": "Prepare Files for Upload",
      "type": "n8n-nodes-base.code",
      "position": [
        1920,
        -100
      ],
      "parameters": {
        "jsCode": "let results = [];\nconst items = $(\"On form submission\").all()\n\nfor (item of items) {\n    for (key of Object.keys(item.binary)) {\n        results.push({\n            json: {\n                fileName: item.binary[key].fileName\n            },\n            binary: {\n                data: item.binary[key],\n            }\n        });\n    }\n}\n\nreturn results;"
      },
      "typeVersion": 2
    },
    {
      "id": "1d08ef78-68e7-4901-80fc-17923344fee3",
      "name": "Prepare Files for New Folder",
      "type": "n8n-nodes-base.code",
      "position": [
        1920,
        100
      ],
      "parameters": {
        "jsCode": "let results = [];\nconst items = $(\"On form submission\").all()\n\nfor (item of items) {\n    for (key of Object.keys(item.binary)) {\n        results.push({\n            json: {\n                fileName: item.binary[key].fileName\n            },\n            binary: {\n                data: item.binary[key],\n            }\n        });\n    }\n}\n\nreturn results;"
      },
      "typeVersion": 2
    },
    {
      "id": "557d2c63-7bbb-4280-b16e-71c6d900973b",
      "name": "Upload to New Folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2180,
        100
      ],
      "parameters": {
        "name": "={{ $json.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create Folder').item.json.id }}"
        },
        "inputDataFieldName": "=data"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "2SIFnsVfdw9nx9I4",
          "name": "Google Drive account"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "e90ccfb0-cf21-45d2-860e-bc2049ed9682",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -200
      ],
      "parameters": {
        "color": 5,
        "width": 520,
        "height": 520,
        "content": "# πŸ—‚οΈ Bulk File Upload to Google Drive with Folder Management\n\n## Overview\nThis workflow processes a form submission that accepts:\n- Multiple file uploads (any format)\n- Target folder name input\n\nThe workflow automatically:\n- Checks if the specified folder exists in Google Drive\n- Creates the folder if it doesn't exist\n- Uploads all files to the correct folder\n- Maintains original file names and structure\n\nPerfect for batch uploading files while keeping your Drive organized!\n"
      },
      "typeVersion": 1
    },
    {
      "id": "cd00c8a3-42e3-44f4-89b3-663da809346c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1100,
        -440
      ],
      "parameters": {
        "color": 5,
        "width": 460,
        "height": 380,
        "content": "## πŸ”„ Decision Point: Folder Check\nThe workflow splits into two paths based on folder existence:\n- βœ… TRUE: Use existing folder path\n- πŸ†• FALSE: Create new folder path\n\n## πŸ—‚οΈ Existing Folder Path (Upper)\n1. Prepare Files for Upload: Splits files for individual processing\n2. Upload Files: Uploads to existing folder maintaining structure\n\n## πŸ“ New Folder Path (Lower)\n1. Create Folder: Generates new folder in Drive\n2. Prepare Files for New Folder: Splits files for individual processing\n3. Upload to New Folder: Uploads to newly created folder"
      },
      "typeVersion": 1
    },
    {
      "id": "a0b1ff8a-3308-41da-bb4b-01b50cccc456",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1920,
        -340
      ],
      "parameters": {
        "color": 5,
        "width": 360,
        "height": 200,
        "content": "## βš™οΈ File Processing Notes\n- All binary files are split individually for proper upload handling\n- Original file names and structure are preserved\n- Both paths ensure identical file organization\n\nalso see https://n8n.io/workflows/1621-split-out-binary-data/"
      },
      "typeVersion": 1
    },
    {
      "id": "c16b2105-638d-4d48-b39d-ff8772375674",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -340
      ],
      "parameters": {
        "color": 5,
        "width": 660,
        "height": 280,
        "content": "## πŸ” Search Query Pattern\n\nThe following search pattern looks for a folder with the specified name in a particular parent folder:\nMake sure to replace <folderId>\n\n```javascript\nmimeType='application/vnd.google-apps.folder' and name = '{{ $json.folderName }}' and '<folderId>' in parents\n```\n\n**Important**: Marl Always Output Data so you can check also if nothing found."
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Create Folder": {
      "main": [
        [
          {
            "node": "Prepare Files for New Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Folder found ?": {
      "main": [
        [
          {
            "node": "Prepare Files for Upload",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Folder Name": {
      "main": [
        [
          {
            "node": "Search specific folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Get Folder Name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search specific folder": {
      "main": [
        [
          {
            "node": "Folder found ?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Files for Upload": {
      "main": [
        [
          {
            "node": "Upload Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Files for New Folder": {
      "main": [
        [
          {
            "node": "Upload to New Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Actions

Share
Categories:
Tags:
ifsetstickynotecodegoogledriveformtrigger

Technical Specs

Complexity:
Advanced
Node Count:
13 nodes
Published:11 months ago
Updated:10 days ago

Compatibility

Platform:
N8N Cloud & Self-hosted
Min Version:
N8N v1.0.0+
Supports cloud and self-hosted deployment

License

This workflow template follows MIT license, you can freely use, modify and distribute.

Please comply with relevant third-party service terms when using.

Related Workflows