AutomationFlowsGeneral › Upload File to Google Drive via Webhook

Upload File to Google Drive via Webhook

Original n8n title: Upload File to Drive

Upload-File-To-Drive. Uses googleDrive. Webhook trigger; 8 nodes.

Webhook trigger★★★★☆ complexity8 nodesGoogle Drive
General Trigger: Webhook Nodes: 8 Complexity: ★★★★☆ Added:

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": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "upload-file-to-drive",
        "responseMode": "responseNode",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -3392,
        1760
      ],
      "id": "abe50d7f-13df-44bc-8023-55e29899ab33",
      "name": "Webhook - Upload File"
    },
    {
      "parameters": {
        "name": "={{ $('Set Variables6').item.json.fileName }}",
        "driveId": {
          "__rl": true,
          "value": "My Drive",
          "mode": "list",
          "cachedResultName": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive"
        },
        "folderId": {
          "__rl": true,
          "value": "={{ $('Set Variables6').item.json.folderId }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        -2768,
        1776
      ],
      "id": "6b256608-7f70-42ea-a006-28e8d1692417",
      "name": "Upload to Google Drive",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "continueOnFail": true,
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "success",
              "value": "=true",
              "type": "boolean"
            },
            {
              "id": "2",
              "name": "drive_file_id",
              "value": "={{ $json.id }}",
              "type": "string"
            },
            {
              "id": "3",
              "name": "drive_file_url",
              "value": "=https://drive.google.com/file/d/{{ $json.id }}/view",
              "type": "string"
            },
            {
              "id": "4",
              "name": "file_name",
              "value": "={{ $json.name }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -2544,
        1760
      ],
      "id": "a315d382-f676-4d4a-9dd4-7d2df7d8755c",
      "name": "Format Response"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "success",
              "value": "=false",
              "type": "boolean"
            },
            {
              "id": "2",
              "name": "error",
              "value": "={{ $json.error?.message || $json.message || 'Error uploading file to Google Drive' }}",
              "type": "string"
            },
            {
              "id": "3",
              "name": "error_details",
              "value": "={{ $json.error?.description || $json.description || 'Unknown error' }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -2544,
        1952
      ],
      "id": "61cdfb1f-ba4f-4693-9891-8c1d58c507a1",
      "name": "Format Error"
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ $json }}",
        "options": {
          "responseCode": 500
        }
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        -2288,
        1952
      ],
      "id": "e4c7506e-9370-47fc-bae4-c2c8b7db5fa8",
      "name": "Respond Error"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1",
              "name": "fileName",
              "value": "={{ $json.body.fileName }}",
              "type": "string"
            },
            {
              "id": "2",
              "name": "folderId",
              "value": "={{ $json.body.folderId }}",
              "type": "string"
            },
            {
              "id": "3",
              "name": "fileContent",
              "value": "={{ $json.body.fileContent }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -3168,
        1760
      ],
      "id": "144dc59d-5238-490d-8672-0d856e54900e",
      "name": "Set Variables6"
    },
    {
      "parameters": {
        "options": {
          "fileName": "={{ $json.fileName }}"
        }
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        -2960,
        1760
      ],
      "id": "e0ef6492-bc01-4e7e-a48d-3916b03a6c82",
      "name": "Convert to File"
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ $json }}",
        "options": {}
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        -2288,
        1760
      ],
      "id": "6ffcb655-bf2b-4017-b6f7-41045d94405e",
      "name": "Respond Success6"
    }
  ],
  "connections": {
    "Webhook - Upload File": {
      "main": [
        [
          {
            "node": "Set Variables6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Google Drive": {
      "main": [
        [
          {
            "node": "Format Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Response": {
      "main": [
        [
          {
            "node": "Respond Success6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Error": {
      "main": [
        [
          {
            "node": "Respond Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Variables6": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Upload to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  }
}

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

Upload-File-To-Drive. Uses googleDrive. Webhook trigger; 8 nodes.

Source: https://github.com/JuanCruzRobledo/correccion-automatica-ia/blob/05462dfdd3157dfdcbd79990214a5501c52fa938/n8n-workflows/upload-file-to-drive.json — 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

Automate Video Upload → Auto-Thumbnail → Google Drive. Uses writeBinaryFile, executeCommand, readBinaryFile, googleDrive. Webhook trigger; 9 nodes.

Write Binary File, Execute Command, Read Binary File +1
General

This workflow accepts a video via HTTP upload, verifies it’s a valid video, extracts a thumbnail frame at the 5-second mark using FFmpeg (auto-installs a static build if missing), uploads the image to

Write Binary File, Execute Command, Read Binary File +1
General

This workflow enables seamless, privacy-first capture of meeting notes from your iPhone. It pairs with an iOS Shortcut that leverages Apple’s on-device transcription from the Voice Memos app and optio

Google Drive
General

Blotato-Api. Uses @blotato/n8n-nodes-blotato. Webhook trigger; 53 nodes.

@Blotato/N8N Nodes Blotato
General

Back up n8n workflows to Google Drive automatically This workflow provides a robust solution for backing up your n8n workflows to Google Drive. It is designed to handle backups for multiple n8n instan

Execute Workflow Trigger, n8n, Google Drive