This workflow corresponds to n8n.io template #17459 — we link there as the canonical source.
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 →
{
"id": "tte6V9wTbfG7Kpge",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Split Drive Images Into Article Folders",
"tags": [],
"nodes": [
{
"id": "d7734baf-1394-44bd-b317-ad7300da94dc",
"name": "When clicking \u2018Execute workflow\u2019",
"type": "n8n-nodes-base.manualTrigger",
"position": [
1056,
640
],
"parameters": {},
"typeVersion": 1
},
{
"id": "0e03a5f5-f931-45a4-9c04-a557c1f6b7c9",
"name": "Config \u2013 Set Your Folders & Batch Size",
"type": "n8n-nodes-base.set",
"position": [
1280,
640
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "a1",
"name": "sourceFolderName",
"type": "string",
"value": "eyebrow tattooing"
},
{
"id": "a2",
"name": "destinationParentFolderId",
"type": "string",
"value": "1pLR4akliULXTDJ5vlduWGZN3bjdQUjFy"
},
{
"id": "a3",
"name": "batchNamePrefix",
"type": "string",
"value": "eyebrow_tattooing"
},
{
"id": "a4",
"name": "batchSize",
"type": "number",
"value": 8
}
]
}
},
"typeVersion": 3.4
},
{
"id": "c518772a-3c6e-42bd-ba54-29eaad91f7cc",
"name": "Find Source Folder",
"type": "n8n-nodes-base.googleDrive",
"position": [
1504,
640
],
"parameters": {
"filter": {},
"options": {},
"resource": "fileFolder",
"returnAll": true,
"queryString": "={{ \"mimeType='application/vnd.google-apps.folder' and name='\" + $json.sourceFolderName + \"'\" }}",
"searchMethod": "query"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "5e782657-dde1-455c-a25e-a39c1a665184",
"name": "Get Images In Source Folder",
"type": "n8n-nodes-base.googleDrive",
"position": [
1728,
640
],
"parameters": {
"filter": {},
"options": {},
"resource": "fileFolder",
"returnAll": true,
"queryString": "={{ \"'\" + $json.id + \"' in parents and mimeType contains 'image/'\" }}",
"searchMethod": "query"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "86ef5ca5-e134-4c48-bb76-a9d6785cf6ea",
"name": "Split Images Into Batches",
"type": "n8n-nodes-base.code",
"position": [
1952,
640
],
"parameters": {
"jsCode": "const files = items\n .map(item => item.json)\n .filter(file => file.id && file.name);\n\nconst config = $('Config \u2013 Set Your Folders & Batch Size').first().json;\nconst groupSize = config.batchSize;\nconst prefix = config.batchNamePrefix;\n\nconst out = [];\n\nfor (let i = 0; i < files.length; i += groupSize) {\n const group = files.slice(i, i + groupSize);\n\n if (group.length < groupSize) {\n continue;\n }\n\n const folderNumber = Math.floor(i / groupSize) + 1;\n\n out.push({\n json: {\n folderName: `${prefix}-${String(folderNumber).padStart(3, '0')}`,\n files: group.map(file => ({\n id: file.id,\n name: file.name,\n mimeType: file.mimeType\n }))\n }\n });\n}\n\nreturn out;"
},
"typeVersion": 2
},
{
"id": "874b3580-959f-43c0-a6a6-9affef779428",
"name": "Create Batch Folder",
"type": "n8n-nodes-base.googleDrive",
"position": [
2400,
560
],
"parameters": {
"name": "={{ $json.folderName }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "id",
"value": "={{ $('Config \u2013 Set Your Folders & Batch Size').first().json.destinationParentFolderId }}"
},
"resource": "folder"
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "1c222c98-38a3-4a71-aa94-ddc3a5318b9f",
"name": "Copy Image To Batch Folder",
"type": "n8n-nodes-base.googleDrive",
"position": [
2848,
640
],
"parameters": {
"name": "={{ $json.fileName }}",
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.fileId }}"
},
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.targetFolderId }}"
},
"operation": "copy",
"sameFolder": false
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "31b96cbc-6e27-4b94-86d3-0fcc4e46aeab",
"name": "Sticky Note - Overview",
"type": "n8n-nodes-base.stickyNote",
"position": [
272,
-32
],
"parameters": {
"color": 4,
"width": 900,
"height": 548,
"content": "## Organize images in Google Drive into numbered batch folders\n\nThis workflow takes all images from a Google Drive folder and copies them into new subfolders in fixed batches (8 photos per folder).\nThis is useful for bulk SEO article posting where a specific number of photos is required.\n\n### How it works:\n\nThe system locates the folder by name, generates a list of images, distributes them into groups, creates a separate folder for each group, and copies the corresponding images into it.\n\n### Setup:\n\nOpen the \"Config \u2013 Set Your Folders & Batch Size\" node and specify the name of the source folder, the ID of the destination folder where the photo folders will be moved, and the quantity (8).\n\nAfter that, connect your Google Drive credentials in each of the corresponding nodes.\n\n### What is needed for the job:\n\nThe Google Drive account is connected via OAuth2, and the source folder already contains images.\n"
},
"typeVersion": 1
},
{
"id": "f9038543-4d81-4d75-ac75-eb3a601f501c",
"name": "Sticky Note - Step 1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1296,
256
],
"parameters": {
"color": 7,
"width": 680,
"height": 372,
"content": "### Step 1: Configure & find images\n\nSpecify the source folder name and the ID of the destination folder (where you want to move the photos) in the `Config` node.\nThe workflow will then locate the specified folder and list all the images contained within it.\n\nsourceFolderName \u2013 name of the folder from which images are retrieved\n\ndestinationParentFolderId \u2013 ID of the folder where new batches will be stored\n\nbatchNamePrefix \u2013 prefix for the names of new folders\n\nbatchSize \u2013 number of images per batch"
},
"typeVersion": 1
},
{
"id": "caac91c2-5048-40e1-a328-e95d43042b87",
"name": "Sticky Note - Step 2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1984,
448
],
"parameters": {
"color": 7,
"width": 440,
"height": 180,
"content": "### Step 2: Split into batches\n\nImages are grouped into fixed-size batches.\nOnly complete batches are stored; remaining images insufficient to form a full batch are discarded."
},
"typeVersion": 1
},
{
"id": "c0ea8084-af4a-4eac-84fa-8eb17e15c468",
"name": "Sticky Note - Step 3",
"type": "n8n-nodes-base.stickyNote",
"position": [
2432,
256
],
"parameters": {
"color": 7,
"width": 660,
"height": 180,
"content": "### Step 3: Create folder & copy files\n\nFor each batch of photos, a folder is created in the destination folder, and the images from that batch are copied into it."
},
"typeVersion": 1
},
{
"id": "aa7528ef-b718-4ade-9ee4-908590176a80",
"name": "Loop Over Items1",
"type": "n8n-nodes-base.splitInBatches",
"position": [
2176,
640
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "622210f4-1d00-4594-a57c-3e399c9c4734",
"name": "Prepare Files For Current Folder1",
"type": "n8n-nodes-base.code",
"position": [
2624,
560
],
"parameters": {
"jsCode": "const group = $('Loop Over Items1').item.json;\nconst createdFolder = $json;\n\nreturn group.files.map(file => ({\n json: {\n fileId: file.id,\n fileName: file.name,\n targetFolderId: createdFolder.id,\n targetFolderName: group.folderName\n }\n}));"
},
"typeVersion": 2
}
],
"active": false,
"settings": {
"binaryMode": "separate",
"executionOrder": "v1"
},
"versionId": "20449ef7-64f4-4c90-85b9-e886231b48cb",
"nodeGroups": [],
"connections": {
"Loop Over Items1": {
"main": [
[],
[
{
"node": "Create Batch Folder",
"type": "main",
"index": 0
}
]
]
},
"Find Source Folder": {
"main": [
[
{
"node": "Get Images In Source Folder",
"type": "main",
"index": 0
}
]
]
},
"Create Batch Folder": {
"main": [
[
{
"node": "Prepare Files For Current Folder1",
"type": "main",
"index": 0
}
]
]
},
"Split Images Into Batches": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"Copy Image To Batch Folder": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"Get Images In Source Folder": {
"main": [
[
{
"node": "Split Images Into Batches",
"type": "main",
"index": 0
}
]
]
},
"Prepare Files For Current Folder1": {
"main": [
[
{
"node": "Copy Image To Batch Folder",
"type": "main",
"index": 0
}
]
]
},
"When clicking \u2018Execute workflow\u2019": {
"main": [
[
{
"node": "Config \u2013 Set Your Folders & Batch Size",
"type": "main",
"index": 0
}
]
]
},
"Config \u2013 Set Your Folders & Batch Size": {
"main": [
[
{
"node": "Find Source Folder",
"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.
googleDriveOAuth2Api
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow organizes Google Drive images by copying them from a named source folder into newly created, numbered batch subfolders under a destination parent folder, using a configurable batch size and folder-name prefix. Runs when you manually execute the workflow in n8n.…
Source: https://n8n.io/workflows/17459/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
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
Description:
Batch watermark every image in a Google Drive folder and save the results to a separate destination folder — fully automated, no code required, and no external tools or APIs needed.
This workflow is perfect for technical writers, content creators, marketers, and developers who write in Markdown but need to collaborate or publish using Google Docs format. Ideal for teams that want
Export Markdown Content do Google Docs Document. Uses googleDrive. Event-driven trigger; 11 nodes.