ファイルを自動のに移動する
上級
これはFile Management分野の自動化ワークフローで、19個のノードを含みます。主にIf, GoogleDrive, ManualTrigger, SplitInBatchesなどのノードを使用。 Google Drive自動ファイル整理:PDF・画像・ドキュメントをタイプ別に分類
前提条件
- •Google Drive API認証情報
カテゴリー
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"id": "Kg8UgSiA0utYWQ0J",
"meta": {
"instanceId": "8443f10082278c46aa5cf3acf8ff0f70061a2c58bce76efac814b16290845177",
"templateCredsSetupCompleted": true
},
"name": "Auto move files",
"tags": [],
"nodes": [
{
"id": "ebf3a973-602f-4a01-8a74-6df55ad6d113",
"name": "画像の場合",
"type": "n8n-nodes-base.if",
"notes": "🖼️ IMAGE FILE DETECTION\n\nChecks if the uploaded file is an image:\n\n• Examines the file's MIME type\n• Looks for 'image/' in the MIME type\n• Supports: JPG, PNG, GIF, WebP, SVG, etc.\n• TRUE path: Routes to 'Move to Images'\n• FALSE path: File continues to next filter\n\nExample MIME types: image/jpeg, image/png",
"position": [
400,
976
],
"parameters": {
"options": {
"ignoreCase": true,
"looseTypeValidation": false
},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": false,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "3e4622cc-91f0-4cbd-bd55-e3ad4e28f32b",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{$binary.data.mimeType}}",
"rightValue": "image/jpeg"
}
]
}
},
"typeVersion": 2,
"alwaysOutputData": true
},
{
"id": "13e7f0a2-8dde-4e42-a94f-1f81353c95e9",
"name": "PDFの場合",
"type": "n8n-nodes-base.if",
"notes": "📄 PDF FILE DETECTION\n\nChecks if the uploaded file is a PDF document:\n\n• Looks for exact MIME type 'application/pdf'\n• Only matches PDF files\n• TRUE path: Routes to 'Move to PDFs'\n• FALSE path: File continues to next filter\n\nThis ensures only genuine PDF files are moved to the PDF folder.",
"position": [
256,
576
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "18052dba-fa6b-4fd4-ac5f-f6abb10575b9",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{$binary.data.mimeType}}",
"rightValue": "application/pdf"
}
]
}
},
"typeVersion": 2
},
{
"id": "e5331e89-34c7-4e63-b542-0d44b7e1aa42",
"name": "画像フォルダへ移動",
"type": "n8n-nodes-base.googleDrive",
"notes": "📁 MOVE IMAGE FILES\n\nMoves detected image files to the Images folder:\n\n• Uses the file ID from the trigger\n• Moves file to designated Images folder\n• Maintains file properties and permissions\n• Removes file from upload folder\n\nReplace 'YOUR_FOLDER_ID_IMAGES' with your actual Images folder ID.",
"position": [
672,
1328
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json['id'] }}"
},
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"folderId": {
"__rl": true,
"mode": "list",
"value": "1_ecL9heszdG2vACtpfHsVEe4OAs89DzM",
"cachedResultUrl": "https://drive.google.com/drive/folders/1_ecL9heszdG2vACtpfHsVEe4OAs89DzM",
"cachedResultName": "images_check"
},
"operation": "move"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "gQtjXVGUgZru29qC",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "d456c42b-604e-4a1d-ac7b-cea42c35a004",
"name": "PDFフォルダへ移動",
"type": "n8n-nodes-base.googleDrive",
"notes": "📄 MOVE PDF FILES\n\nMoves detected PDF files to the PDFs folder:\n\n• Uses the file ID from the trigger\n• Moves file to designated PDFs folder\n• Maintains file properties and permissions\n• Removes file from upload folder\n\nReplace 'YOUR_FOLDER_ID_PDFS' with your actual PDFs folder ID.",
"position": [
608,
752
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json['id'] }}"
},
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"folderId": {
"__rl": true,
"mode": "list",
"value": "1dHG2GI5WF3bg-Bw9ydD5fC_P5GqvdBFG",
"cachedResultUrl": "https://drive.google.com/drive/folders/1dHG2GI5WF3bg-Bw9ydD5fC_P5GqvdBFG",
"cachedResultName": "pdf_check"
},
"operation": "move"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "gQtjXVGUgZru29qC",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "49fdce70-3f51-4edd-81fd-7c6f655b6c62",
"name": "ドキュメントの場合",
"type": "n8n-nodes-base.if",
"notes": "📋 DOCUMENT FILE DETECTION\n\nChecks if the uploaded file is a document:\n\n• Looks for 'application/' OR 'text/' MIME types\n• Catches: Word docs, Excel, PowerPoint, text files\n• Excludes PDFs (handled separately)\n• TRUE path: Routes to 'Move to Documents'\n• FALSE path: File stays in upload folder\n\nExamples: .docx, .xlsx, .pptx, .txt, .rtf",
"position": [
-48,
304
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "5ed7c752-f41d-496d-a003-56c95572b629",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{$binary.data.mimeType}}",
"rightValue": "application/json"
}
]
}
},
"typeVersion": 2
},
{
"id": "6b1feaf3-4e3b-427c-9e82-7e5df72f284c",
"name": "ドキュメントフォルダへ移動",
"type": "n8n-nodes-base.googleDrive",
"notes": "📋 MOVE DOCUMENT FILES\n\nMoves detected document files to the Documents folder:\n\n• Uses the file ID from the trigger\n• Moves file to designated Documents folder\n• Handles Word, Excel, PowerPoint, text files\n• Maintains file properties and permissions\n\nReplace 'YOUR_FOLDER_ID_DOCUMENTS' with your actual Documents folder ID.",
"position": [
528,
288
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json['id'] }}"
},
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"folderId": {
"__rl": true,
"mode": "list",
"value": "1KUO_jw0WCQR1lDwlkvTk1XP_0PoLb3RR",
"cachedResultUrl": "https://drive.google.com/drive/folders/1KUO_jw0WCQR1lDwlkvTk1XP_0PoLb3RR",
"cachedResultName": "json_check"
},
"operation": "move"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "gQtjXVGUgZru29qC",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "35df71bd-e674-4dc6-bbac-4ca6ae319d04",
"name": "ファイルをダウンロード",
"type": "n8n-nodes-base.googleDrive",
"position": [
-512,
304
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{$json['id']}}"
},
"options": {},
"operation": "download"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "gQtjXVGUgZru29qC",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "358f6aba-5ac4-48c3-980a-296a75cae6fd",
"name": "アイテムをループ処理",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-496,
912
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "42c75b0e-47eb-442a-a842-e3e2fbe75d71",
"name": "'ワークフロー実行'クリック時",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-944,
912
],
"parameters": {},
"typeVersion": 1
},
{
"id": "fb6d583c-79e8-433e-916c-e71da9352e4b",
"name": "ファイルとフォルダを検索",
"type": "n8n-nodes-base.googleDrive",
"position": [
-720,
912
],
"parameters": {
"filter": {
"folderId": {
"__rl": true,
"mode": "list",
"value": "1CcHp9tPoC-f7-umMjLdUU-Y7GedKLQkx",
"cachedResultUrl": "https://drive.google.com/drive/folders/1CcHp9tPoC-f7-umMjLdUU-Y7GedKLQkx",
"cachedResultName": "Indore"
}
},
"options": {},
"resource": "fileFolder",
"returnAll": true
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "gQtjXVGUgZru29qC",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "c7a7346e-0529-4191-a7cb-c56f02781d2a",
"name": "付箋",
"type": "n8n-nodes-base.stickyNote",
"position": [
-832,
672
],
"parameters": {
"height": 224,
"content": " Search files and folders (Google Drive)\n\nPurpose: Finds all files in a specific Google Drive folder\nFunction: Searches the \"Particular\" folder (ID:) for files to process\n\nOutput: Returns a list of all files found in that folder"
},
"typeVersion": 1
},
{
"id": "ed19e989-a464-48cd-9b27-43d9850df4de",
"name": "付箋1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-496,
704
],
"parameters": {
"color": 3,
"width": 272,
"height": 192,
"content": "Loop Over Items (Split in Batches)\n\nPurpose: Processes files one by one\nFunction: Takes the list of files and processes each file individually through the workflow\n\nFlow: Creates a loop that continues until all files are processed"
},
"typeVersion": 1
},
{
"id": "107bb7f1-ff82-4b04-8e4b-9beea97d479a",
"name": "付箋2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-752,
48
],
"parameters": {
"color": 2,
"width": 272,
"height": 224,
"content": "Download file (Google Drive)\n\nPurpose: Downloads file metadata and binary data\n\nFunction: Retrieves the file's MIME type and other properties needed for classification\nCritical: This step gets the file information needed for the conditional nodes"
},
"typeVersion": 1
},
{
"id": "57ee82da-1948-4185-abf4-dc8bd251c125",
"name": "付箋3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-144,
-16
],
"parameters": {
"color": 4,
"width": 304,
"height": 288,
"content": " If Document (Conditional Node)\n\nPurpose: Detects JSON document files\n\nLogic: Checks if MIME type equals \"application/json\"\nTrue Path: Routes to \"Move to Documents\"\n\nFalse Path: Continues to next filter (PDF check)\n\nNote: Despite the name, this specifically looks for JSON files"
},
"typeVersion": 1
},
{
"id": "775c6f0f-3dbc-4e29-a7a3-97fd13a08afd",
"name": "付箋4",
"type": "n8n-nodes-base.stickyNote",
"position": [
432,
16
],
"parameters": {
"color": 6,
"height": 240,
"content": "Move to Documents (Google Drive)\n\nPurpose: Relocates JSON files to Documents folder\nTarget Folder: \"Your folder\" folder (ID:)\n\nAction: Moves file from source location to Documents folder\nAfter Move: Returns to loop for next file"
},
"typeVersion": 1
},
{
"id": "e96270c2-507a-4ac7-aa62-0aaf28ed3c2c",
"name": "付箋5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-32,
608
],
"parameters": {
"color": 5,
"height": 304,
"content": "If PDF (Conditional Node)\n\nPurpose: Detects PDF files\n\nLogic: Checks if MIME type exactly equals \"application/pdf\"\n\nTrue Path: Routes to \"Move to PDFs\"\n\nFalse Path: Continues to image check\n\nPrecision: Only matches genuine PDF files"
},
"typeVersion": 1
},
{
"id": "f92b7dcb-e767-42da-899d-2bff7130b60e",
"name": "付箋6",
"type": "n8n-nodes-base.stickyNote",
"position": [
720,
512
],
"parameters": {
"color": 3,
"height": 272,
"content": "Move to PDFs (Google Drive)\n\nPurpose: Relocates PDF files to PDFs folder\n\nTarget Folder: \"Your folder\" folder (ID:)\n\nAction: Moves file from source location to PDFs folder\n\nAfter Move: Returns to loop for next file"
},
"typeVersion": 1
},
{
"id": "17fd8e38-d636-496f-a1d7-ec413148a2bc",
"name": "付箋7",
"type": "n8n-nodes-base.stickyNote",
"position": [
240,
1120
],
"parameters": {
"color": 7,
"height": 368,
"content": "If Image (Conditional Node)\n\nPurpose: Detects image files\n\nLogic: Checks if MIME type equals \"image/jpeg\" (though notes suggest broader image support)\n\nTrue Path: Routes to \"Move to Images\"\n\nFalse Path: File remains unprocessed\n\nCoverage: Handles JPG files (could be expanded for PNG, GIF, etc.)"
},
"typeVersion": 1
},
{
"id": "8c58f9d7-5c77-4d2a-83f9-061c2ac30810",
"name": "付箋8",
"type": "n8n-nodes-base.stickyNote",
"position": [
832,
1312
],
"parameters": {
"color": 5,
"height": 272,
"content": "Move to Images (Google Drive)\n\nPurpose: Relocates image files to Images folder\n\nTarget Folder: \"Your folder\" folder (ID:)\n\nAction: Moves file from source location to Images folder\n\nAfter Move: Returns to loop for next file"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "d08c53f6-2f34-4ffb-acb7-02d2fa36e73b",
"connections": {
"13e7f0a2-8dde-4e42-a94f-1f81353c95e9": {
"main": [
[
{
"node": "d456c42b-604e-4a1d-ac7b-cea42c35a004",
"type": "main",
"index": 0
}
],
[
{
"node": "ebf3a973-602f-4a01-8a74-6df55ad6d113",
"type": "main",
"index": 0
}
]
]
},
"ebf3a973-602f-4a01-8a74-6df55ad6d113": {
"main": [
[
{
"node": "e5331e89-34c7-4e63-b542-0d44b7e1aa42",
"type": "main",
"index": 0
}
],
[]
]
},
"49fdce70-3f51-4edd-81fd-7c6f655b6c62": {
"main": [
[
{
"node": "6b1feaf3-4e3b-427c-9e82-7e5df72f284c",
"type": "main",
"index": 0
}
],
[
{
"node": "13e7f0a2-8dde-4e42-a94f-1f81353c95e9",
"type": "main",
"index": 0
}
]
]
},
"d456c42b-604e-4a1d-ac7b-cea42c35a004": {
"main": [
[
{
"node": "358f6aba-5ac4-48c3-980a-296a75cae6fd",
"type": "main",
"index": 0
}
]
]
},
"35df71bd-e674-4dc6-bbac-4ca6ae319d04": {
"main": [
[
{
"node": "49fdce70-3f51-4edd-81fd-7c6f655b6c62",
"type": "main",
"index": 0
}
]
]
},
"e5331e89-34c7-4e63-b542-0d44b7e1aa42": {
"main": [
[
{
"node": "358f6aba-5ac4-48c3-980a-296a75cae6fd",
"type": "main",
"index": 0
}
]
]
},
"358f6aba-5ac4-48c3-980a-296a75cae6fd": {
"main": [
[],
[
{
"node": "35df71bd-e674-4dc6-bbac-4ca6ae319d04",
"type": "main",
"index": 0
}
]
]
},
"6b1feaf3-4e3b-427c-9e82-7e5df72f284c": {
"main": [
[
{
"node": "358f6aba-5ac4-48c3-980a-296a75cae6fd",
"type": "main",
"index": 0
}
]
]
},
"fb6d583c-79e8-433e-916c-e71da9352e4b": {
"main": [
[
{
"node": "358f6aba-5ac4-48c3-980a-296a75cae6fd",
"type": "main",
"index": 0
}
]
]
},
"42c75b0e-47eb-442a-a842-e3e2fbe75d71": {
"main": [
[
{
"node": "fb6d583c-79e8-433e-916c-e71da9352e4b",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
上級 - ファイル管理
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
JSONフォルダ分離
Google スプレッドシートからバッチで JSON ファイルをローカルフォルダにダウンロード
Code
Http Request
Google Sheets
+
Code
Http Request
Google Sheets
16 ノードRahul Joshi
ファイル管理
イベント管理工作フロー
Jira、Slack、Google Sheets、Drive を使ったインシデント対応の自動化
If
Set
Code
+
If
Set
Code
23 ノードRahul Joshi
DevOps
Stripe、Google Drive、Google Sheetsを使用した支払い領収書のアーカイブ
支払い確実書の自動化:StripeとGoogle Workspaceを使用したメール送信、書類保存、追跡
If
Gmail
Split Out
+
If
Gmail
Split Out
21 ノードRahul Joshi
コンテンツ作成
自動テストの実行とステータス更新
Google Drive、スプレッドシート、ClickUp 結果記録を統合した自動化ワークフロー テスト ランナー
If
Set
Code
+
If
Set
Code
27 ノードRahul Joshi
インボイス分類機
GPT-4o を使用して Google Drive で請求書を分類し、自動のに整理する
Switch
Google Drive
Manual Trigger
+
Switch
Google Drive
Manual Trigger
18 ノードRahul Joshi
請求書処理
提案生成_草稿保存の自動化
Azure GPT-4o を使ってビジネスプレゼンションを生成して Sheets から Gmail ダスクトに保存
If
Code
Gmail
+
If
Code
Gmail
16 ノードRahul Joshi
顧客管理
ワークフロー情報
難易度
上級
ノード数19
カテゴリー1
ノードタイプ5
作成者
Rahul Joshi
@rahul08Rahul Joshi is a seasoned technology leader specializing in the n8n automation tool and AI-driven workflow automation. With deep expertise in building open-source workflow automation and self-hosted automation platforms, he helps organizations eliminate manual processes through intelligent n8n ai agent automation solutions.
外部リンク
n8n.ioで表示 →
このワークフローを共有