AutomationFlowsWeb Scraping › Drive Root Cleanup → Move to @n8n_note_manuscripts/_inbox

Drive Root Cleanup → Move to @n8n_note_manuscripts/_inbox

Drive root cleanup → move to @n8n_note_manuscripts/_inbox. Uses httpRequest. Event-driven trigger; 11 nodes.

Event trigger★★★★☆ complexity11 nodesHTTP Request
Web Scraping Trigger: Event Nodes: 11 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
{
  "name": "Drive root cleanup \u2192 move to @n8n_note_manuscripts/_inbox",
  "nodes": [
    {
      "parameters": {},
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -560,
        0
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "allowedRootId",
              "value": "1t9Ska_gyWSupdTpLY-j7H-U8wjsSX4hd"
            }
          ]
        },
        "options": {}
      },
      "name": "Set allowedRootId",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [
        -360,
        0
      ]
    },
    {
      "parameters": {
        "url": "https://www.googleapis.com/drive/v3/files",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleApi",
        "sendQuery": true,
        "options": {},
        "queryParametersUi": {
          "parameter": [
            {
              "name": "q",
              "value": "={{\"name = '_inbox' and mimeType = 'application/vnd.google-apps.folder' and trashed = false and '\" + ($json.allowedRootId || $item('Set allowedRootId',0).json.allowedRootId) + \"' in parents\"}}"
            },
            {
              "name": "fields",
              "value": "files(id,name,parents)"
            },
            {
              "name": "pageSize",
              "value": "1"
            },
            {
              "name": "spaces",
              "value": "drive"
            }
          ]
        }
      },
      "name": "Search _inbox (HTTP)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        -140,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "boolean": [],
          "string": [
            {
              "value1": "={{ Array.isArray($json.files) && $json.files.length > 0 ? 'yes' : '' }}",
              "operation": "isEmpty"
            }
          ]
        }
      },
      "name": "IF _inbox exists?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        80,
        0
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "inboxId",
              "value": "={{$json.files[0].id}}"
            }
          ]
        },
        "options": {}
      },
      "name": "Set inboxId (reuse)",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [
        300,
        -120
      ]
    },
    {
      "parameters": {
        "url": "https://www.googleapis.com/drive/v3/files",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleApi",
        "sendBody": true,
        "jsonParameters": true,
        "options": {},
        "bodyParametersJson": "={{ JSON.stringify({ name: '_inbox', mimeType: 'application/vnd.google-apps.folder', parents: [ $item('Set allowedRootId',0).json.allowedRootId ] }) }}"
      },
      "name": "Create folder _inbox (HTTP)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        300,
        120
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "inboxId",
              "value": "={{$json.id}}"
            }
          ]
        },
        "options": {}
      },
      "name": "Set inboxId (created)",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [
        540,
        120
      ]
    },
    {
      "parameters": {
        "url": "https://www.googleapis.com/drive/v3/files",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleApi",
        "sendQuery": true,
        "options": {},
        "queryParametersUi": {
          "parameter": [
            {
              "name": "q",
              "value": "={{\"trashed = false and 'root' in parents and mimeType != 'application/vnd.google-apps.folder'\"}}"
            },
            {
              "name": "fields",
              "value": "files(id,name,parents,mimeType)"
            },
            {
              "name": "pageSize",
              "value": "100"
            },
            {
              "name": "spaces",
              "value": "drive"
            }
          ]
        }
      },
      "name": "Search root stray files (HTTP)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        760,
        0
      ]
    },
    {
      "parameters": {
        "functionCode": "const files = Array.isArray($json.files) ? $json.files : [];\nreturn files.map(f => ({ json: f }));"
      },
      "name": "Expand files \u2192 items",
      "type": "n8n-nodes-base.function",
      "typeVersion": 2,
      "position": [
        980,
        0
      ]
    },
    {
      "parameters": {
        "amount": 1,
        "unit": "seconds"
      },
      "name": "Wait 1s",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        1180,
        0
      ]
    },
    {
      "parameters": {
        "url": "={{'https://www.googleapis.com/drive/v3/files/' + $json.id}}",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "googleApi",
        "sendQuery": true,
        "options": {},
        "queryParametersUi": {
          "parameter": [
            {
              "name": "addParents",
              "value": "={{ $item(\"Set inboxId (reuse)\",0).$json.inboxId || $item(\"Set inboxId (created)\",0).$json.inboxId }}"
            },
            {
              "name": "removeParents",
              "value": "={{ ($json.parents && $json.parents[0]) || 'root' }}"
            },
            {
              "name": "fields",
              "value": "id,parents"
            }
          ]
        },
        "method": "PATCH"
      },
      "name": "Move file \u2192 _inbox (HTTP)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 3,
      "position": [
        1380,
        0
      ]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Set allowedRootId",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set allowedRootId": {
      "main": [
        [
          {
            "node": "Search _inbox (HTTP)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search _inbox (HTTP)": {
      "main": [
        [
          {
            "node": "IF _inbox exists?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF _inbox exists?": {
      "main": [
        [
          {
            "node": "Set inboxId (reuse)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create folder _inbox (HTTP)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create folder _inbox (HTTP)": {
      "main": [
        [
          {
            "node": "Set inboxId (created)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set inboxId (reuse)": {
      "main": [
        [
          {
            "node": "Search root stray files (HTTP)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set inboxId (created)": {
      "main": [
        [
          {
            "node": "Search root stray files (HTTP)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search root stray files (HTTP)": {
      "main": [
        [
          {
            "node": "Expand files \u2192 items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Expand files \u2192 items": {
      "main": [
        [
          {
            "node": "Wait 1s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 1s": {
      "main": [
        [
          {
            "node": "Move file \u2192 _inbox (HTTP)",
            "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

Drive root cleanup → move to @n8n_note_manuscripts/_inbox. Uses httpRequest. Event-driven trigger; 11 nodes.

Source: https://gist.github.com/mo666-med/c57bf13e0c741b400f3adb1dc73d0341 — 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

This workflow listens for an “Approved” label on a Trello card, reads the AI draft bookkeeping JSON from card comments, and posts the corresponding transaction to Xero. It then adds a Xero deep link b

Trello Trigger, HTTP Request
Web Scraping

02_LLM_Pipeline v1.0. Uses executeWorkflowTrigger, httpRequest, seaTable. Event-driven trigger; 65 nodes.

Execute Workflow Trigger, HTTP Request, Sea Table
Web Scraping

This workflow allows you to import any workflow from a file or another n8n instance and map the credentials easily. A multi-form setup guides you through the entire process At the beginning you have t

Execute Command, Read Write File, HTTP Request +3
Web Scraping

[n8n] Advanced URL Parsing and Shortening Workflow - Switchy.io Integration. Uses splitInBatches, stickyNote, httpRequest, html. Event-driven trigger; 56 nodes.

HTTP Request, GitHub, Stop And Error +1
Web Scraping

[](https://youtu.be/c7yCZhmMjtI)

HTTP Request, GitHub, Stop And Error +1