Renommer automatiquement les pièces jointes Gmail avec l'IA et les enregistrer sur Drive

Intermédiaire

Ceci est unAI Summarization, Multimodal AIworkflow d'automatisation du domainecontenant 10 nœuds.Utilise principalement des nœuds comme Set, Gmail, Merge, GoogleDrive, Agent. Renommer automatiquement les pièces jointes Gmail et les sauvegarder dans Google Drive avec GPT-4o

Prérequis
  • Compte Google et informations d'identification Gmail API
  • Informations d'identification Google Drive API
  • Clé API OpenAI
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "name": "AI-Renamed Gmail Attachments to Drive",
  "tags": [],
  "nodes": [
    {
      "name": "Déclencheur planifié",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.2,
      "id": "D-clencheur-planifi--0"
    },
    {
      "name": "Agent IA",
      "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": "Agent-IA-1"
    },
    {
      "name": "Modèle de chat 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": "Mod-le-de-chat-OpenAI-2"
    },
    {
      "name": "Upload file",
      "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": "Upload-file-3"
    },
    {
      "name": "Mark message as read",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1920,
        0
      ],
      "parameters": {
        "messageId": "={{ $('Set Required Fields').item.json.id }}",
        "operation": "markAsRead"
      },
      "typeVersion": 2.1,
      "id": "Mark-message-as-read-4"
    },
    {
      "name": "Fusionner Data for Upload",
      "type": "n8n-nodes-base.merge",
      "position": [
        1472,
        0
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineByPosition"
      },
      "typeVersion": 3.2,
      "id": "Fusionner-Data-for-Upload-5"
    },
    {
      "name": "Get Unread Messages with Attachments",
      "type": "n8n-nodes-base.gmail",
      "position": [
        224,
        0
      ],
      "parameters": {
        "filters": {
          "readStatus": "unread"
        },
        "operation": "getAll"
      },
      "typeVersion": 2.1,
      "id": "Get-Unread-Messages-with-Attachments-6"
    },
    {
      "name": "Définir Required Fields",
      "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": "D-finir-Required-Fields-7"
    },
    {
      "name": "Download Attachments",
      "type": "n8n-nodes-base.gmail",
      "position": [
        672,
        0
      ],
      "parameters": {
        "simple": false,
        "options": {
          "downloadAttachments": true
        },
        "messageId": "={{ $json.id }}",
        "operation": "get"
      },
      "typeVersion": 2.1,
      "id": "Download-Attachments-8"
    },
    {
      "name": "Extract from Attachments",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        896,
        0
      ],
      "parameters": {
        "options": {},
        "operation": "pdf",
        "binaryPropertyName": "attachment_0"
      },
      "typeVersion": 1,
      "id": "Extract-from-Attachments-9"
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "81cda4d6-8828-4b64-8afe-88b302168717",
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Merge Data for Upload",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Upload-file-3": {
      "main": [
        [
          {
            "node": "Mark-message-as-read-4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get-Unread-Messages-with-Attachments-6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Set Required Fields": {
      "main": [
        [
          {
            "node": "Download-Attachments-8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download-Attachments-8": {
      "main": [
        [
          {
            "node": "Extract-from-Attachments-9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Data for Upload": {
      "main": [
        [
          {
            "node": "Upload-file-3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract-from-Attachments-9": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge Data for Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get-Unread-Messages-with-Attachments-6": {
      "main": [
        [
          {
            "node": "Set Required Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Intermédiaire - Résumé IA, IA Multimodale

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Intermédiaire
Nombre de nœuds10
Catégorie2
Types de nœuds8
Description de la difficulté

Adapté aux utilisateurs expérimentés, avec des workflows de complexité moyenne contenant 6-15 nœuds

Auteur
Matt Chong | n8n Creator

Matt Chong | n8n Creator

@mattxchong

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

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34