Classification automatique de la boîte de réception personnelle

Avancé

Ceci est unPersonal Productivity, Multimodal AIworkflow d'automatisation du domainecontenant 18 nœuds.Utilise principalement des nœuds comme Set, Code, Gmail, Notion, Aggregate. Automatisation de la classification et des résumés des e-mails via Gmail, GPT-4o-mini et Notion

Prérequis
  • Compte Google et informations d'identification Gmail API
  • Clé API Notion
  • 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
{
  "id": "RGhw0UmEtucowCuk",
  "meta": {
    "instanceId": "8443f10082278c46aa5cf3acf8ff0f70061a2c58bce76efac814b16290845177",
    "templateCredsSetupCompleted": true
  },
  "name": "Auto-Triage Personal Inbox",
  "tags": [],
  "nodes": [
    {
      "id": "cba3ea9b-89d2-4ef4-a5fd-6cd4c06fd71c",
      "name": "Obtenir les e-mails non lus",
      "type": "n8n-nodes-base.gmail",
      "position": [
        48,
        -32
      ],
      "parameters": {
        "resource": "message",
        "operation": "getAll",
        "additionalFields": {
          "labelIds": [
            "UNREAD",
            "INBOX"
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "RchiXdmY8WaQhOSJ",
          "name": "Gmail account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cb5df628-43a2-4946-8227-3597ce9a85a3",
      "name": "Diviser les e-mails",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        272,
        -32
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "abc26329-6683-4e9a-a1f7-c95e104d051d",
      "name": "Formater le résumé",
      "type": "n8n-nodes-base.code",
      "position": [
        1120,
        -32
      ],
      "parameters": {
        "jsCode": "// Get the AI classification output (e.g., \"Important\")\nconst classification = $input.first().json.text.trim();\n\n// Get original email data from the \"Split Emails\" node\nconst email = $('Split Emails').first().json;\n\n// Fallbacks in case fields are missing\nconst subject = email.headers?.subject || email.subject || \"No Subject\";\nconst from = email.headers?.from || email.from || \"Unknown Sender\";\n\n// Build the summary line\nconst summary = `**${classification}**: ${subject} (from: ${from})`;\n\n// Return the structured result\nreturn [{\n  json: {\n    classification,\n    subject,\n    from,\n    summary\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "84ca122e-fcf1-4a84-89dc-b486d8f001b2",
      "name": "Agréger le résumé",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1344,
        -32
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "b2ca17b9-343c-4a90-99da-b0abcb54e492",
      "name": "Chaîne LLM de base",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        720,
        -32
      ],
      "parameters": {
        "text": "=Email Details:\n{{ $json.Subject }}\n{{ $json.From }}\nSnippet: {{ $json.Text }}\n\nClassify this email into one of the following:\nImportant, Ignore, Delegate, or Reply Later.\n\nRespond with only one word.",
        "batching": {},
        "messages": {
          "messageValues": [
            {
              "message": "=You are an intelligent email assistant trained to triage emails into four categories:\n\n1. Important – Action required soon or time-sensitive  \n2. Ignore – Irrelevant, spam, or low-priority  \n3. Delegate – Should be forwarded to someone else  \n4. Reply Later – Requires a thoughtful or delayed response  \n\nBe concise. Respond with **only one word**: Important, Ignore, Delegate, or Reply Later."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "2706328f-d171-429b-9352-b29dc493fb42",
      "name": "Azure OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        816,
        192
      ],
      "parameters": {
        "model": "gpt-4o-mini",
        "options": {}
      },
      "credentials": {
        "azureOpenAiApi": {
          "id": "C3WzT18XqF8OdVM6",
          "name": "Azure Open AI account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "61f74b7f-dd74-44ab-bb31-8e460098d7a1",
      "name": "Lors du clic sur 'Exécuter le workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -176,
        -32
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "bb021292-df71-4e01-a7de-2650a6444347",
      "name": "Envoyer vers Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        1584,
        -32
      ],
      "parameters": {
        "title": "=Inbox Digest - {{ $now.format('D HH:mm') }} {{ $json.data[0].classification }}",
        "pageId": {
          "__rl": true,
          "mode": "url",
          "value": "https://www.notion.so/Welcome-to-Notion-248f839f1184803d9846ce0ace27c700"
        },
        "blockUi": {
          "blockValues": [
            {
              "textContent": "={{ $json.data[0].summary }}"
            }
          ]
        },
        "options": {}
      },
      "credentials": {
        "notionApi": {
          "id": "zQhzvWiFBMYHHCj2",
          "name": "Notion account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "16aa3045-abeb-49c6-be2a-a2c9b802f92b",
      "name": "Modifier les champs",
      "type": "n8n-nodes-base.set",
      "position": [
        496,
        -32
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b86137b4-b6f4-42f5-957d-a37ba2c5d056",
              "name": "Subject",
              "type": "string",
              "value": "={{ $json.headers.subject }}"
            },
            {
              "id": "33d19af9-5def-4fa2-8b8c-bcbec69bbb28",
              "name": "=From",
              "type": "string",
              "value": "={{ $json.headers.from }}"
            },
            {
              "id": "bc276088-30e2-4494-baae-93c810dc8002",
              "name": "=Text",
              "type": "string",
              "value": "={{ $json.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1c75cd51-b5ce-43bf-88f0-d1bef310917a",
      "name": "Note adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        -288
      ],
      "parameters": {
        "height": 256,
        "content": "🚀 WORKFLOW INITIATOR\n\nPurpose: Manually starts the email processing and analysis workflow.\n\nFunction: Triggers the automated email retrieval and AI processing pipeline.\n\nCritical: Entry point for testing workflow functionality and on-demand execution."
      },
      "typeVersion": 1
    },
    {
      "id": "7e9c4c9f-3254-4e98-ad38-82a675926aaa",
      "name": "Note adhésive1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1088,
        -416
      ],
      "parameters": {
        "color": 6,
        "height": 352,
        "content": "📊 INSIGHT FORMATTER\n\nPurpose: Transforms AI analysis into structured, actionable summary format\n\nFunction: Creates professional email summaries with key points and recommendations.\n\nCritical: Converts raw AI output into user-friendly, business-ready insights.\n\nOutput: Standardized format suitable for reporting and decision-making."
      },
      "typeVersion": 1
    },
    {
      "id": "779afae0-f16d-4478-8398-089da6229916",
      "name": "Note adhésive2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -416
      ],
      "parameters": {
        "color": 5,
        "height": 368,
        "content": "🤖 AI EMAIL ANALYZER\n\nPurpose: Processes email content using advanced language model analysis.\n\nFunction: Extracts insights, sentiment, key topics, and actionable information.\n\nCritical: Core intelligence engine - transforms raw email into structured insights.\n\nModel: Configured for email content analysis, summarization, and categorization."
      },
      "typeVersion": 1
    },
    {
      "id": "b6ae2c79-b46d-425e-94b1-0583a11e244f",
      "name": "Note adhésive3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        -400
      ],
      "parameters": {
        "color": 4,
        "height": 352,
        "content": "✏️ DATA STRUCTURE OPTIMIZER\n\nPurpose: Standardizes and cleans email data fields for AI processing\n\nFunction: Formats email content, extracts key metadata, removes unnecessary fields\n\nCritical: Prepares clean, structured data input for LLM analysis\nEnhancement: Ensures consistent data format across different email sources"
      },
      "typeVersion": 1
    },
    {
      "id": "e37b3942-dce1-4cd7-94fa-72daab915960",
      "name": "Note adhésive4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        -368
      ],
      "parameters": {
        "color": 3,
        "height": 320,
        "content": "🔄 EMAIL BATCH PROCESSOR\n\nPurpose: Separates bulk email retrieval into individual email items\nFunction: Converts email array into separate workflow items for parallel processing\n\nCritical: Enables individual email analysis and prevents batch processing bottlenecks\n\nOptimization: Allows concurrent processing of multiple emails simultaneously"
      },
      "typeVersion": 1
    },
    {
      "id": "fc4e9bbc-76fd-4d28-8834-b891f122a48d",
      "name": "Note adhésive5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        -368
      ],
      "parameters": {
        "color": 2,
        "height": 320,
        "content": "📧 EMAIL RETRIEVAL ENGINE\n\nPurpose: Fetches unread emails from Gmail inbox using Gmail API\nFunction: Retrieves email metadata, content, attachments, and sender information.\n\nCritical: Primary data source - ensures all unread emails are captured for processing.\n\nConfiguration: Set appropriate filters and limits to prevent API overload."
      },
      "typeVersion": 1
    },
    {
      "id": "1aa60f5e-187d-42c9-b824-ea3478e42d1b",
      "name": "Note adhésive6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        -416
      ],
      "parameters": {
        "color": 7,
        "height": 352,
        "content": "📈 INTELLIGENCE CONSOLIDATOR\n\nPurpose: Combines individual email summaries into comprehensive batch report.\n\nFunction: Merges multiple email insights, identifies patterns, creates overview dashboard.\n\nCritical: Provides holistic view of email communications and trending topics.\n\nAnalytics: Generates metrics on email volume, sentiment trends, and priority items."
      },
      "typeVersion": 1
    },
    {
      "id": "a51c16db-0caa-47ad-b7df-0df25e1f7558",
      "name": "Note adhésive7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        240
      ],
      "parameters": {
        "color": 5,
        "height": 368,
        "content": "🧠 ENTERPRISE AI ENGINE\n\nPurpose: Powers the LLM Chain with Azure OpenAI's advanced language capabilities.\n\nFunction: Provides natural language understanding, content analysis, and generation.\n\nCritical: Ensures high-quality, consistent AI processing with enterprise-grade reliability.\n\nConfiguration: Optimized for email content analysis and business communication patterns"
      },
      "typeVersion": 1
    },
    {
      "id": "bb3b9be7-7154-4070-8616-c8a16c6e43f7",
      "name": "Note adhésive8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1664,
        -416
      ],
      "parameters": {
        "color": 2,
        "height": 368,
        "content": "📝 KNOWLEDGE BASE INTEGRATION\n\nPurpose: Archives processed email insights into Notion workspace.\n\nFunction: Creates searchable database entries with structured email intelligence.\n\nCritical: Ensures long-term storage and retrieval of email insights for reference.\n\nOrganization: Maintains historical records and enables trend analysis over time."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "026fe437-68d1-4647-9f04-9543c2e04a8d",
  "connections": {
    "16aa3045-abeb-49c6-be2a-a2c9b802f92b": {
      "main": [
        [
          {
            "node": "b2ca17b9-343c-4a90-99da-b0abcb54e492",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cb5df628-43a2-4946-8227-3597ce9a85a3": {
      "main": [
        [],
        [
          {
            "node": "16aa3045-abeb-49c6-be2a-a2c9b802f92b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "abc26329-6683-4e9a-a1f7-c95e104d051d": {
      "main": [
        [
          {
            "node": "84ca122e-fcf1-4a84-89dc-b486d8f001b2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "bb021292-df71-4e01-a7de-2650a6444347": {
      "main": [
        [
          {
            "node": "cb5df628-43a2-4946-8227-3597ce9a85a3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b2ca17b9-343c-4a90-99da-b0abcb54e492": {
      "main": [
        [
          {
            "node": "abc26329-6683-4e9a-a1f7-c95e104d051d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "84ca122e-fcf1-4a84-89dc-b486d8f001b2": {
      "main": [
        [
          {
            "node": "bb021292-df71-4e01-a7de-2650a6444347",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cba3ea9b-89d2-4ef4-a5fd-6cd4c06fd71c": {
      "main": [
        [
          {
            "node": "cb5df628-43a2-4946-8227-3597ce9a85a3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2706328f-d171-429b-9352-b29dc493fb42": {
      "ai_languageModel": [
        [
          {
            "node": "b2ca17b9-343c-4a90-99da-b0abcb54e492",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "61f74b7f-dd74-44ab-bb31-8e460098d7a1": {
      "main": [
        [
          {
            "node": "cba3ea9b-89d2-4ef4-a5fd-6cd4c06fd71c",
            "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é ?

Avancé - Productivité personnelle, 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é
Avancé
Nombre de nœuds18
Catégorie2
Types de nœuds10
Description de la difficulté

Adapté aux utilisateurs avancés, avec des workflows complexes contenant 16+ nœuds

Auteur
Rahul Joshi

Rahul Joshi

@rahul08

Rahul 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.

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34