Gmail 添付ファイルを AI により名前変更後 Drive に保存

中級

これはAI Summarization, Multimodal AI分野の自動化ワークフローで、10個のノードを含みます。主にSet, Gmail, Merge, GoogleDrive, Agentなどのノードを使用。 GPT-4o を使用して Gmail の添付ファイルの名前を自動のに変更し、Google ドライブに保存します

前提条件
  • Googleアカウント + Gmail API認証情報
  • Google Drive API認証情報
  • OpenAI API Key
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "name": "AI-Renamed Gmail Attachments to Drive",
  "tags": [],
  "nodes": [
    {
      "name": "スケジュールトリガー",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.2,
      "id": "--0"
    },
    {
      "name": "AIエージェント",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1120,
        124
      ],
      "parameters": {
        "text": "=You are an expert content analyser and file naming assistant...\ntext: {{ $json.text }}\ndate: {{ $json.info.CreationDate }}",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2,
      "id": "AI--1"
    },
    {
      "name": "OpenAI チャットモデル",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1192,
        348
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "typeVersion": 1.2,
      "id": "OpenAI--2"
    },
    {
      "name": "ファイルアップロード",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1696,
        0
      ],
      "parameters": {
        "name": "={{ $json.output }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "url",
          "value": ""
        },
        "inputDataFieldName": "attachment_1"
      },
      "typeVersion": 3,
      "id": "--3"
    },
    {
      "name": "メッセージを既読にする",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1920,
        0
      ],
      "parameters": {
        "messageId": "={{ $('Set Required Fields').item.json.id }}",
        "operation": "markAsRead"
      },
      "typeVersion": 2.1,
      "id": "--4"
    },
    {
      "name": "アップロード用データ統合",
      "type": "n8n-nodes-base.merge",
      "position": [
        1472,
        0
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2,
      "id": "--5"
    },
    {
      "name": "添付ファイル付き未読メッセージ取得",
      "type": "n8n-nodes-base.gmail",
      "position": [
        224,
        0
      ],
      "parameters": {
        "filters": {
          "readStatus": "unread"
        },
        "operation": "getAll"
      },
      "typeVersion": 2.1,
      "id": "--6"
    },
    {
      "name": "必須フィールド設定",
      "type": "n8n-nodes-base.set",
      "position": [
        448,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "name": "id",
              "type": "string",
              "value": "={{ $json.id }}"
            },
            {
              "name": "threadId",
              "type": "string",
              "value": "={{ $json.threadId }}"
            },
            {
              "name": "from.value[0].name",
              "type": "string",
              "value": "={{ $json.from.value[0].name }}"
            },
            {
              "name": "date",
              "type": "string",
              "value": "={{ $json.date }}"
            }
          ]
        }
      },
      "typeVersion": 3.4,
      "id": "--7"
    },
    {
      "name": "添付ファイルダウンロード",
      "type": "n8n-nodes-base.gmail",
      "position": [
        672,
        0
      ],
      "parameters": {
        "simple": false,
        "options": {
          "downloadAttachments": true
        },
        "messageId": "={{ $json.id }}",
        "operation": "get"
      },
      "typeVersion": 2.1,
      "id": "--8"
    },
    {
      "name": "添付ファイルから抽出",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        896,
        0
      ],
      "parameters": {
        "options": {},
        "operation": "pdf",
        "binaryPropertyName": "attachment_0"
      },
      "typeVersion": 1,
      "id": "--9"
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "81cda4d6-8828-4b64-8afe-88b302168717",
  "connections": {
    "AI--1": {
      "main": [
        [
          {
            "node": "--5",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "--3": {
      "main": [
        [
          {
            "node": "--4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--0": {
      "main": [
        [
          {
            "node": "--6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI--2": {
      "ai_languageModel": [
        [
          {
            "node": "AI--1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "--7": {
      "main": [
        [
          {
            "node": "--8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--8": {
      "main": [
        [
          {
            "node": "--9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--5": {
      "main": [
        [
          {
            "node": "--3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--9": {
      "main": [
        [
          {
            "node": "AI--1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "--5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "--6": {
      "main": [
        [
          {
            "node": "--7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

中級 - AI要約, マルチモーダルAI

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

ワークフロー情報
難易度
中級
ノード数10
カテゴリー2
ノードタイプ8
難易度説明

経験者向け、6-15ノードの中程度の複雑さのワークフロー

作成者
Matt Chong | n8n Creator

Matt Chong | n8n Creator

@mattxchong

Automation nerd fueled by good coffee, deep curiosity, and clean flows.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34