Google Drive への日次ワーキングフローの自動バックアップとクリーンアップ
上級
これは自動化ワークフローで、32個のノードを含みます。主にN8n, Filter, GoogleDrive, ConvertToFile, SplitInBatchesなどのノードを使用。 Google Drive への毎日のワークフロー バックアップとクリーンアップを自動化
前提条件
- •Google Drive API認証情報
カテゴリー
-
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"meta": {
"instanceId": "7de9c03c5df732f2294cfa53379db42b70689739afb5ed84c40dd844fed72f02",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "9a8eb9c2-a0c9-4f80-9c6c-5774802edc14",
"name": "付箋3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-80,
-1168
],
"parameters": {
"width": 352,
"height": 636,
"content": "## 🔄 Procesamiento por Lotes\n\n**Loop Over Items** itera sobre cada workflow obtenido de n8n.\n\nCada workflow pasa por dos rutas:\n1. **Ruta superior:** Limpieza de carpetas antiguas\n2. **Ruta inferior:** Conversión y guardado del backup"
},
"typeVersion": 1
},
{
"id": "080b0687-a519-41c7-8cee-55ca311c5522",
"name": "付箋4",
"type": "n8n-nodes-base.stickyNote",
"position": [
288,
-720
],
"parameters": {
"width": 300,
"height": 432,
"content": "## 📄 Conversión y Guardado\n\n**Convert to File:** Convierte cada workflow a formato JSON con formato legible.\n\n**Google Drive:** Guarda el archivo JSON en la carpeta de backup creada.\n\nEl nombre del archivo será: `[nombre-del-workflow].json`"
},
"typeVersion": 1
},
{
"id": "e804abef-76e2-400c-a216-c6ed051a548e",
"name": "付箋5",
"type": "n8n-nodes-base.stickyNote",
"position": [
336,
-1216
],
"parameters": {
"width": 340,
"height": 464,
"content": "## 🧹 Limpieza de Backups Antiguos\n\n**Get folders:** Obtiene todas las carpetas de backup existentes.\n\n**Filter:** Excluye la carpeta actual (recién creada).\n\n**Delete folder:** Elimina permanentemente las carpetas antiguas para ahorrar espacio.\n\n⚠️ **Nota:** Los backups antiguos se eliminan automáticamente."
},
"typeVersion": 1
},
{
"id": "88016564-b3a2-4619-8804-94fd5a8cef19",
"name": "n8n1",
"type": "n8n-nodes-base.n8n",
"position": [
-464,
-720
],
"parameters": {
"filters": {},
"requestOptions": {}
},
"credentials": {
"n8nApi": {
"id": "LpZFBbXA3FYzNTY8",
"name": "n8n account"
}
},
"retryOnFail": true,
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "db19b42f-6573-4d18-821d-d9ae63a4fe1d",
"name": "ループ処理1",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-48,
-720
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "5d4fc25e-d535-4b4b-8c5d-890ce53e2684",
"name": "create new folder1",
"type": "n8n-nodes-base.googleDrive",
"position": [
-752,
-720
],
"parameters": {
"name": "=Workflow Backups {{ $now.format('cccc t dd-MM-yyyy') }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultUrl": "https://drive.google.com/drive/folders/1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultName": "N8N"
},
"resource": "folder"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "bC9XIOLdXmo67x1E",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "93ba9bf9-7232-4247-bb69-9bc643ce43e3",
"name": "ファイルに変換1",
"type": "n8n-nodes-base.convertToFile",
"position": [
144,
-704
],
"parameters": {
"options": {
"format": true,
"fileName": "={{ $json.name + \".json\" }} "
},
"operation": "toJson"
},
"typeVersion": 1.1
},
{
"id": "44b739ab-cb61-4729-b49f-aaed42ddec4a",
"name": "Google ドライブ1",
"type": "n8n-nodes-base.googleDrive",
"position": [
384,
-448
],
"parameters": {
"name": "={{ $('Loop Over Items1').item.json.name + \".json\" }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "id",
"value": "={{ $('create new folder1').item.json.id }}"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "bC9XIOLdXmo67x1E",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "9b6bb07c-30e1-4649-acb6-f886ad65c288",
"name": "スケジュールトリガー1",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-1040,
-656
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 4
}
]
}
},
"typeVersion": 1.2
},
{
"id": "6d801bc0-93f6-4181-88bf-2f8e0135d0e6",
"name": "フィルター1",
"type": "n8n-nodes-base.filter",
"position": [
368,
-896
],
"parameters": {
"options": {
"ignoreCase": true
},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": false,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "538fc29d-2693-4c62-9848-bdcaf8566909",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.id }}",
"rightValue": "={{ $('create new folder1').item.json.id }}"
}
]
},
"looseTypeValidation": true
},
"typeVersion": 2.2
},
{
"id": "699773cd-698c-4615-9903-848f5f9f3fa7",
"name": "delete folder1",
"type": "n8n-nodes-base.googleDrive",
"onError": "continueRegularOutput",
"position": [
560,
-896
],
"parameters": {
"options": {
"deletePermanently": true
},
"resource": "folder",
"operation": "deleteFolder",
"folderNoRootId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "LyM4iZs87sZ5FP8C",
"name": "HTA"
}
},
"typeVersion": 3
},
{
"id": "eb1ead32-9668-4fb6-862b-1ab72247daae",
"name": "Get folders1",
"type": "n8n-nodes-base.googleDrive",
"position": [
144,
-896
],
"parameters": {
"filter": {
"folderId": {
"__rl": true,
"mode": "list",
"value": "1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultUrl": "https://drive.google.com/drive/folders/1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultName": "N8N"
},
"whatToSearch": "folders"
},
"options": {
"fields": [
"id"
]
},
"resource": "fileFolder"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "bC9XIOLdXmo67x1E",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "a4f48d76-3f4a-4f18-9c91-d1acdb528996",
"name": "付箋7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1184,
-864
],
"parameters": {
"width": 280,
"height": 344,
"content": "## ⏰ Trigger Automático\n\n**Se activa todos los días a las 4:00 AM**\n\nPuedes modificar la hora según tus necesidades en la configuración del Schedule Trigger."
},
"typeVersion": 1
},
{
"id": "dfd9be89-436e-4479-99d6-7deedb5db9c0",
"name": "付箋8",
"type": "n8n-nodes-base.stickyNote",
"position": [
-848,
-1024
],
"parameters": {
"width": 300,
"height": 480,
"content": "## 📁 Creación de Carpeta de Backup\n\n**Crea una carpeta nueva** en Google Drive con el formato:\n`Workflow Backups [día] [hora] [fecha]`\n\nEsta carpeta contendrá todos los workflows respaldados."
},
"typeVersion": 1
},
{
"id": "59023d6c-d08e-4d3d-999c-3ba67e2e15f4",
"name": "付箋9",
"type": "n8n-nodes-base.stickyNote",
"position": [
-528,
-1104
],
"parameters": {
"height": 532,
"content": "## 🔌 Conexión con n8n API\n\n**IMPORTANTE:** Para configurar las credenciales correctamente:\n\n- La URL debe ser: `Tu-URL/api/v1`\n- Ejemplo: `https://tu-instancia.n8n.io/api/v1`\n- Al crear las credenciales, verás el ejemplo exacto\n\n**Este nodo obtiene todos los workflows** de tu instancia de n8n."
},
"typeVersion": 1
},
{
"id": "56e3c0ce-d77d-4b2d-bbba-93637fa98aed",
"name": "n8n2",
"type": "n8n-nodes-base.n8n",
"position": [
2160,
-816
],
"parameters": {
"filters": {},
"requestOptions": {}
},
"credentials": {
"n8nApi": {
"id": "LpZFBbXA3FYzNTY8",
"name": "n8n account"
}
},
"retryOnFail": true,
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "997369a0-e77b-4cc8-bf12-8ab7eb1b3e8f",
"name": "ループ処理2",
"type": "n8n-nodes-base.splitInBatches",
"position": [
2496,
-816
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "85d5f584-a0c6-48b1-93f4-6c5ba5dc7d40",
"name": "create new folder2",
"type": "n8n-nodes-base.googleDrive",
"position": [
1888,
-816
],
"parameters": {
"name": "=Workflow Backups {{ $now.format('cccc t dd-MM-yyyy') }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultUrl": "https://drive.google.com/drive/folders/1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultName": "N8N"
},
"resource": "folder"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "bC9XIOLdXmo67x1E",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "887aee74-330f-4170-93f2-0ddda5d52704",
"name": "ファイルに変換2",
"type": "n8n-nodes-base.convertToFile",
"position": [
2720,
-816
],
"parameters": {
"options": {
"format": true,
"fileName": "={{ $json.name + \".json\" }} "
},
"operation": "toJson"
},
"typeVersion": 1.1
},
{
"id": "2d57c096-2d05-477c-bea8-aeb3aedbdfcb",
"name": "Google ドライブ2",
"type": "n8n-nodes-base.googleDrive",
"position": [
2944,
-528
],
"parameters": {
"name": "={{ $('Loop Over Items2').item.json.name + \".json\" }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "https://drive.google.com/drive/my-drive",
"cachedResultName": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "id",
"value": "={{ $('create new folder2').item.json.id }}"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "bC9XIOLdXmo67x1E",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "a3f33a72-7376-4a1e-8585-e0bc052c401b",
"name": "スケジュールトリガー2",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
1616,
-736
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 4
}
]
}
},
"typeVersion": 1.2
},
{
"id": "d995f52f-d70f-49ad-b467-2da9b343e275",
"name": "フィルター2",
"type": "n8n-nodes-base.filter",
"position": [
2944,
-1008
],
"parameters": {
"options": {
"ignoreCase": true
},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": false,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "538fc29d-2693-4c62-9848-bdcaf8566909",
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json.id }}",
"rightValue": "={{ $('create new folder2').item.json.id }}"
}
]
},
"looseTypeValidation": true
},
"typeVersion": 2.2
},
{
"id": "b7a7f2b6-68d1-48b1-aed9-c008c655d087",
"name": "delete folder2",
"type": "n8n-nodes-base.googleDrive",
"onError": "continueRegularOutput",
"position": [
3152,
-1008
],
"parameters": {
"options": {
"deletePermanently": true
},
"resource": "folder",
"operation": "deleteFolder",
"folderNoRootId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "LyM4iZs87sZ5FP8C",
"name": "HTA"
}
},
"typeVersion": 3
},
{
"id": "9d40c609-886f-404c-8b43-f1909174d09f",
"name": "Get folders2",
"type": "n8n-nodes-base.googleDrive",
"position": [
2720,
-1008
],
"parameters": {
"filter": {
"folderId": {
"__rl": true,
"mode": "list",
"value": "1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultUrl": "https://drive.google.com/drive/folders/1dCNZ_oYzukeFsaKWhukX1l_Hsi57ns9m",
"cachedResultName": "N8N"
},
"whatToSearch": "folders"
},
"options": {
"fields": [
"id"
]
},
"resource": "fileFolder"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "bC9XIOLdXmo67x1E",
"name": "Google Drive account"
}
},
"typeVersion": 3
},
{
"id": "2cfae624-9916-4aa7-ac7a-fc4e726139c2",
"name": "付箋10",
"type": "n8n-nodes-base.stickyNote",
"position": [
1472,
-912
],
"parameters": {
"width": 280,
"height": 312,
"content": "## ⏰ Automatic Trigger\n\n**Runs every day at 4:00 AM**\n\nYou can modify the time according to your needs in the Schedule Trigger configuration."
},
"typeVersion": 1
},
{
"id": "538c9518-1ce8-4997-9bc8-e4e570c596e3",
"name": "付箋11",
"type": "n8n-nodes-base.stickyNote",
"position": [
1776,
-1152
],
"parameters": {
"width": 300,
"height": 544,
"content": "## 📁 Backup Folder Creation\n\n**Creates a new folder** in Google Drive with the format:\n`Workflow Backups [day] [time] [date]`\n\nThis folder will contain all backed up workflows."
},
"typeVersion": 1
},
{
"id": "2a5683a7-2340-497b-85a8-fc10c84f77d7",
"name": "付箋12",
"type": "n8n-nodes-base.stickyNote",
"position": [
2096,
-1216
],
"parameters": {
"width": 224,
"height": 596,
"content": "## 🔌 n8n API Connection\n\n**IMPORTANT:** To configure credentials correctly:\n\n- URL must be: `Your-URL/api/v1`\n- Example: `https://your-instance.n8n.io/api/v1`\n- When creating credentials, you'll see the exact example\n\n**This node fetches all workflows** from your n8n instance."
},
"typeVersion": 1
},
{
"id": "d0e33a4e-294b-4c7f-a476-61b93a16de5f",
"name": "付箋13",
"type": "n8n-nodes-base.stickyNote",
"position": [
2464,
-1280
],
"parameters": {
"width": 400,
"height": 652,
"content": "## 🔄 Batch Processing\n\n**Loop Over Items** iterates through each workflow obtained from n8n.\n\nEach workflow goes through two paths:\n1. **Upper path:** Old folder cleanup\n2. **Lower path:** Backup conversion and saving"
},
"typeVersion": 1
},
{
"id": "d2419fcd-cb46-4cfe-920e-56b82a1cc02d",
"name": "付箋14",
"type": "n8n-nodes-base.stickyNote",
"position": [
2896,
-816
],
"parameters": {
"width": 300,
"height": 416,
"content": "## 📄 Conversion and Saving\n\n**Convert to File:** Converts each workflow to JSON format with readable formatting.\n\n**Google Drive:** Saves the JSON file to the created backup folder.\n\nFile name will be: `[workflow-name].json`"
},
"typeVersion": 1
},
{
"id": "a6b308ed-af2b-437a-8e22-07ffc5d535d9",
"name": "付箋15",
"type": "n8n-nodes-base.stickyNote",
"position": [
2928,
-1296
],
"parameters": {
"width": 340,
"height": 464,
"content": "## 🧹 Old Backup Cleanup\n\n**Get folders:** Retrieves all existing backup folders.\n\n**Filter:** Excludes the current folder (newly created).\n\n**Delete folder:** Permanently deletes old folders to save space.\n\n⚠️ **Note:** Old backups are automatically deleted."
},
"typeVersion": 1
},
{
"id": "5c59ff97-5705-4746-91dc-8da0b0ccf997",
"name": "付箋",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1184,
-1536
],
"parameters": {
"color": 3,
"width": 1936,
"height": 1312,
"content": "# Español"
},
"typeVersion": 1
},
{
"id": "f477459f-73de-4390-8c36-4f5251fdaec0",
"name": "付箋1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1392,
-1536
],
"parameters": {
"color": 3,
"width": 2080,
"height": 1312,
"content": "# English"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"88016564-b3a2-4619-8804-94fd5a8cef19": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"56e3c0ce-d77d-4b2d-bbba-93637fa98aed": {
"main": [
[
{
"node": "Loop Over Items2",
"type": "main",
"index": 0
}
]
]
},
"Filter1": {
"main": [
[
{
"node": "699773cd-698c-4615-9903-848f5f9f3fa7",
"type": "main",
"index": 0
}
]
]
},
"Filter2": {
"main": [
[
{
"node": "b7a7f2b6-68d1-48b1-aed9-c008c655d087",
"type": "main",
"index": 0
}
]
]
},
"eb1ead32-9668-4fb6-862b-1ab72247daae": {
"main": [
[
{
"node": "Filter1",
"type": "main",
"index": 0
}
]
]
},
"9d40c609-886f-404c-8b43-f1909174d09f": {
"main": [
[
{
"node": "Filter2",
"type": "main",
"index": 0
}
]
]
},
"Google Drive1": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"Google Drive2": {
"main": [
[
{
"node": "Loop Over Items2",
"type": "main",
"index": 0
}
]
]
},
"Convert to File1": {
"main": [
[
{
"node": "Google Drive1",
"type": "main",
"index": 0
}
]
]
},
"Convert to File2": {
"main": [
[
{
"node": "Google Drive2",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items1": {
"main": [
[
{
"node": "eb1ead32-9668-4fb6-862b-1ab72247daae",
"type": "main",
"index": 0
}
],
[
{
"node": "Convert to File1",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items2": {
"main": [
[
{
"node": "9d40c609-886f-404c-8b43-f1909174d09f",
"type": "main",
"index": 0
}
],
[
{
"node": "Convert to File2",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger1": {
"main": [
[
{
"node": "5d4fc25e-d535-4b4b-8c5d-890ce53e2684",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger2": {
"main": [
[
{
"node": "85d5f584-a0c6-48b1-93f4-6c5ba5dc7d40",
"type": "main",
"index": 0
}
]
]
},
"5d4fc25e-d535-4b4b-8c5d-890ce53e2684": {
"main": [
[
{
"node": "88016564-b3a2-4619-8804-94fd5a8cef19",
"type": "main",
"index": 0
}
]
]
},
"85d5f584-a0c6-48b1-93f4-6c5ba5dc7d40": {
"main": [
[
{
"node": "56e3c0ce-d77d-4b2d-bbba-93637fa98aed",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
上級
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
ワークフローのバックアップコピー
ワークフローをGoogle Driveに自動バックアップ - すべてのワークフローを自動エクスポート
N8n
Limit
Filter
+
N8n
Limit
Filter
12 ノードLukaszB
エンジニアリング
[テンプレート] AIペットショップ v8
AIペットショップアシスタント - GPT-4o、Googleカレンダー、WhatsApp/Instagram/Facebookを統合
If
N8n
Set
+
If
N8n
Set
244 ノードAmanda Benks
営業
AI エージェント レストラン [テンプレート]
🤖 WhatsApp、Instagram、MessengerのAIレストランアシスタント
If
N8n
Set
+
If
N8n
Set
239 ノードAmanda Benks
その他
WordPressブログの自動化プロフェッショナル版(先端研究)v2.1マーケットプラグイン
GPT-4o、Perplexity AI、そして多言語対応を使ったSEO最適化ブログ作成の自動化
If
Set
Xml
+
If
Set
Xml
125 ノードDaniel Ng
コンテンツ作成
LinkedInおよびXウイルスのなコンテンツ自動エンジン
AIを使ってLinkedInとXにウイルスのなコンテンツを自動生成して公開する
If
Set
Wait
+
If
Set
Wait
156 ノードDiptamoy Barman
コンテンツ作成
Google Drive、GitHub、メッセージ アラートを使用した自動作業フロー バックアップシステム
Google Drive、GitHub、そしてメッセージアラートを使用した自動化ワークフローバックアップシステム
If
N8n
Set
+
If
N8n
Set
20 ノードKhairul Muhtadin
コンテンツ作成