Gmail添付ファイルをGoogle Driveにバックアップ
中級
これはIT Ops分野の自動化ワークフローで、8個のノードを含みます。主にCode, Gmail, GoogleDrive, GmailTriggerなどのノードを使用。 Gmail添付ファイルをGoogle Driveへバックアップ
前提条件
- •Googleアカウント + Gmail API認証情報
- •Google Drive API認証情報
カテゴリー
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"meta": {
"instanceId": "7d8066d2f56a07000fe7d753d3eeabf0ecdf68413466f30d10afe0906f058427",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "9b0e3c5c-6f27-4034-b281-960b039b883a",
"name": "Gmail トリガー",
"type": "n8n-nodes-base.gmailTrigger",
"position": [
0,
-20
],
"parameters": {
"filters": {
"sender": "akhilgadiraju@gmail.com"
},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
}
},
"credentials": {
"gmailOAuth2": {
"id": "wqFUFuFpF5eRAp4E",
"name": "Gmail OAuth2 - Akhil"
}
},
"typeVersion": 1.2
},
{
"id": "c68ebbfb-8fad-4f2b-837b-fb8ac0ffe4df",
"name": "Gmail",
"type": "n8n-nodes-base.gmail",
"position": [
220,
-20
],
"webhookId": "2614ede2-d4ce-4490-9792-8157980bece3",
"parameters": {
"simple": false,
"options": {
"downloadAttachments": true,
"dataPropertyAttachmentsPrefixName": "attachment_"
},
"messageId": "={{ $json.id }}",
"operation": "get"
},
"credentials": {
"gmailOAuth2": {
"id": "wqFUFuFpF5eRAp4E",
"name": "Gmail OAuth2 - Akhil"
}
},
"typeVersion": 2.1
},
{
"id": "40b97338-6ffe-4cfd-869e-a50815808a89",
"name": "Replace Me",
"type": "n8n-nodes-base.noOp",
"position": [
800,
-20
],
"parameters": {},
"typeVersion": 1
},
{
"id": "0d4ae5a5-51d5-4917-8a88-7828d2f0e5ea",
"name": "Google ドライブ",
"type": "n8n-nodes-base.googleDrive",
"position": [
620,
-20
],
"parameters": {
"name": "={{ $('Gmail Trigger').item.json.id + \"_\" + $now + \"_\" + \"backup_attachment\" }}",
"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": "1aZmIqT9jG-GqW_OIGT3HWvRb6JalTlBi",
"cachedResultUrl": "https://drive.google.com/drive/folders/1aZmIqT9jG-GqW_OIGT3HWvRb6JalTlBi",
"cachedResultName": "DOcs"
},
"inputDataFieldName": "=data"
},
"credentials": {
"googleDriveOAuth2Api": {
"id": "LxzMJWxwgbnYKUly",
"name": "Google Drive - Akhil"
}
},
"typeVersion": 3
},
{
"id": "3f2bd52a-7637-4b65-bae3-daebc5f664de",
"name": "コード",
"type": "n8n-nodes-base.code",
"position": [
420,
-20
],
"parameters": {
"jsCode": "return Object.entries(items[0].binary).map(([key, value]) => {\n return {\n binary: {\n data: value\n }\n };\n});"
},
"typeVersion": 2
},
{
"id": "c0ae6ad0-7f25-4912-9bbd-7610ef61d6cd",
"name": "付箋",
"type": "n8n-nodes-base.stickyNote",
"position": [
140,
-120
],
"parameters": {
"color": 4,
"width": 260,
"height": 80,
"content": "### Change sender filter\nModify the sender field in the Gmail Trigger node"
},
"typeVersion": 1
},
{
"id": "0552dd8a-341e-4a67-ad12-8bab41371685",
"name": "付箋1",
"type": "n8n-nodes-base.stickyNote",
"position": [
560,
140
],
"parameters": {
"color": 4,
"height": 180,
"content": "### Change destination folder \nUpdate folderId in the Google Drive node\n\n### Modify filename format\nEdit the name expression in the Google Drive node"
},
"typeVersion": 1
},
{
"id": "f19c4cff-b85d-4ac3-99d7-bf70e61fe5bb",
"name": "付箋2",
"type": "n8n-nodes-base.stickyNote",
"position": [
740,
-140
],
"parameters": {
"height": 100,
"content": "### Add post-upload logic\nReplace or extend the Replace Me node with notifications, logs, etc."
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Code": {
"main": [
[
{
"node": "Google Drive",
"type": "main",
"index": 0
}
]
]
},
"c68ebbfb-8fad-4f2b-837b-fb8ac0ffe4df": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"40b97338-6ffe-4cfd-869e-a50815808a89": {
"main": [
[]
]
},
"Google Drive": {
"main": [
[
{
"node": "40b97338-6ffe-4cfd-869e-a50815808a89",
"type": "main",
"index": 0
}
]
]
},
"Gmail Trigger": {
"main": [
[
{
"node": "c68ebbfb-8fad-4f2b-837b-fb8ac0ffe4df",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
中級 - IT運用
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
AI駆動の知識アシスタント
Google Sheets、OpenAI、Supabaseベクトル検索を活用したAIベースの知識アシスタント
Set
Code
Gmail
+
Set
Code
Gmail
14 ノードAkhil Varma Gadiraju
エンジニアリング
[AOE] 受信トレイとカレンダー管理エイジェント
メール、カレンダー管理を Gmail、Google Calendar、GPT-4o AI で自動化
Code
Gmail
Gmail Tool
+
Code
Gmail
Gmail Tool
38 ノードAOE Agent Lab
人工知能
Gmail、OpenAI、Google Driveを使用した請求書と领収書の抽出と分類
Gmail、OpenAI、Google Driveを使用して領収書と伝票を抽出して分類
If
Set
Code
+
If
Set
Code
20 ノードTom
財務
Gmailからベクトル埋込みとPGVector、Ollamaへの変換
PGVectorとOllamaを使用したGmailベクトル埋め込み
If
Set
Code
+
If
Set
Code
20 ノードAlfonso Corretti
サポート
AIメール分诊与GPT-4警报系统及Telegram通知
AIメール分诊与GPT-4警报系统及Telegram通知
If
Set
Gmail
+
If
Set
Gmail
104 ノードPeter Joslyn
サポート
Google Driveファイル権限の審査によるアクセス制御管理
Google Drive ファイルの権限を監査し、アクセス制御管理を実施
Set
Gmail
Filter
+
Set
Gmail
Filter
19 ノードJimleuk
IT運用