Agent de gestion de la boîte de réception

Intermédiaire

Ceci est unAI Summarization, Multimodal AIworkflow d'automatisation du domainecontenant 8 nœuds.Utilise principalement des nœuds comme Gmail, GmailTrigger, LmChatOpenAi, TextClassifier. Étiqueter automatiquement les e-mails Gmail à l'aide de la classification GPT-5

Prérequis
  • Compte Google et informations d'identification Gmail 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
{
  "id": "iPhhNVPzleZr44YK",
  "meta": {
    "instanceId": "cbbe3d07d282d90d2165a7ab7800571be416166e6eb660e7a28cfe9b84473f49",
    "templateCredsSetupCompleted": true
  },
  "name": "Inbox Management Agent",
  "tags": [],
  "nodes": [
    {
      "id": "240f8e93-87f3-4185-bc12-9b82ab43ce9c",
      "name": "Déclencheur Gmail",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -336,
        -128
      ],
      "parameters": {
        "simple": false,
        "filters": {},
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "VI8hpbWunRMMvR6a",
          "name": "Gmail account"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "c6b683ca-49c4-41b2-aace-9cc434164460",
      "name": "Classificateur de texte",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "position": [
        -112,
        -128
      ],
      "parameters": {
        "options": {},
        "inputText": "={{ $json.text }}",
        "categories": {
          "categories": [
            {
              "category": "High Priority",
              "description": "Emails that require immediate attention or quick response, often from executives, key clients, or internal stakeholders. These usually involve time-sensitive issues, deadlines, or escalations. Keywords/phrases to look for: “urgent,” “ASAP,” “immediate response,” “deadline,” “critical,” “important matter.”"
            },
            {
              "category": "Promotion",
              "description": "Emails related to marketing campaigns, sales offers, product launches, or event invitations. Typically sent in bulk and often contain discounts, new features, or company news. Keywords/phrases to look for: “special offer,” “discount,” “limited time,” “new product,” “webinar,” “sale,” “exclusive invite.”"
            },
            {
              "category": "Finance/Billing",
              "description": "Emails dealing with payments, invoices, receipts, or financial records. May come from vendors, clients, or internal finance teams. Usually involve transactions, balances, or account updates. Keywords/phrases to look for: “invoice,” “payment due,” “billing,” “receipt,” “account statement,” “refund,” “transaction.”"
            },
            {
              "category": "Customer Support",
              "description": "Emails from customers seeking help, troubleshooting, or service requests. Often include questions, complaints, or technical issues that require a response or resolution. Keywords/phrases to look for: “issue,” “not working,” “help,” “support needed,” “error,” “problem with,” “can you fix.”"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "572a1a99-1193-4128-9073-43b5a8a11d11",
      "name": "Modèle de chat OpenAI",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -40,
        160
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5",
          "cachedResultName": "gpt-5"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "BmIUKpYmW7YRSbaU",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "02ca20f3-241e-42df-8969-0c97119b77f8",
      "name": "High Priority",
      "type": "n8n-nodes-base.gmail",
      "position": [
        240,
        -416
      ],
      "webhookId": "2ac56052-19d7-4e91-a7db-855e99c0b996",
      "parameters": {
        "labelIds": [
          "Label_2050230922550608961"
        ],
        "messageId": "={{ $json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "VI8hpbWunRMMvR6a",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "66943ca1-563f-426a-8d81-10be52294555",
      "name": "Promotion",
      "type": "n8n-nodes-base.gmail",
      "position": [
        240,
        -224
      ],
      "webhookId": "2ac56052-19d7-4e91-a7db-855e99c0b996",
      "parameters": {
        "labelIds": [
          "Label_4137435394166770583",
          "CATEGORY_PROMOTIONS"
        ],
        "messageId": "={{ $json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "VI8hpbWunRMMvR6a",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "32916943-2fc8-4b25-b986-bbc5ba64df7a",
      "name": "Finance/Billings",
      "type": "n8n-nodes-base.gmail",
      "position": [
        240,
        -32
      ],
      "webhookId": "2ac56052-19d7-4e91-a7db-855e99c0b996",
      "parameters": {
        "labelIds": [
          "Label_123317652592217245"
        ],
        "messageId": "={{ $json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "VI8hpbWunRMMvR6a",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "ec3002b3-20a6-44c0-855f-43788eedbd4c",
      "name": "Customer Support",
      "type": "n8n-nodes-base.gmail",
      "position": [
        240,
        160
      ],
      "webhookId": "2ac56052-19d7-4e91-a7db-855e99c0b996",
      "parameters": {
        "labelIds": [
          "Label_3866679317291552912"
        ],
        "messageId": "={{ $json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "VI8hpbWunRMMvR6a",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "fb064df0-b84c-466c-b773-7e71e4fcd863",
      "name": "Note adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1008,
        -1280
      ],
      "parameters": {
        "width": 1520,
        "height": 2064,
        "content": "# Smart Gmail inbox organization with OpenAI classification\n\n## Who's it for\nThis template is perfect for busy professionals, customer service teams, and small business owners who receive high volumes of email and struggle to keep their Gmail inbox organized. If you're spending too much time manually sorting emails or missing important messages in the clutter, this AI-powered solution will transform your email management.\n\n## How it works\nThis workflow automatically monitors your Gmail inbox and uses OpenAI's GPT model to intelligently classify incoming emails into four key categories:\n - High Priority - Urgent emails requiring immediate attention from executives, clients, or stakeholders\n - Promotion - Marketing emails, sales offers, product launches, and event invitations\n - Finance/Billing - Invoices, receipts, payment notifications, and financial records\n - Customer Support - Help requests, troubleshooting queries, and service-related issues\n  \nOnce classified, emails are automatically labeled in Gmail using the appropriate tags, making it easy to filter, search, and prioritize your communications.\n\n## How to set up\n### Requirements\n - Gmail account with OAuth2 access enabled\n - OpenAI API key with GPT model access\n - Custom Gmail labels created for each category\n\n### Step-by-step setup\n 1. Create Gmail Labels\n  - In Gmail, create these labels: \"High Priority\", \"Promotion\", \"Finance/Billing\", \"Customer Support\"\n  - Note the label IDs (you'll need to replace the hardcoded ones in the workflow)\n 2. Configure Credentials\n  - Add your Gmail OAuth2 credentials in n8n\n  - Add your OpenAI API credentials\n 3. Update Label IDs\n  - Replace the hardcoded label IDs in each Gmail node with your actual label IDs\n  - You can find label IDs by testing the Gmail node or using Gmail API\n 4. Adjust Classification Rules\n  - Review the Text Classifier categories and modify descriptions to match your specific needs\n  - Add or remove categories as required\n 5. Set Polling Frequency\n  - The workflow is set to check every minute - adjust based on your email volume\n\n\n## How to customize the workflow\n### Modify Categories\n - Edit the Text Classifier node to add/remove email categories\n - Update category descriptions to better match your business context\n - Add corresponding Gmail nodes for new categories\n\n### Change AI Model\n - Switch from GPT-5 to GPT-4 or GPT-3.5-turbo based on your needs and budget\n - Adjust the model parameters in the OpenAI Chat Model node\n\n### Add Actions Beyond Labeling\n  - **Star important** emails by adding a Gmail \"star\" action for high priority items\n  - **Forward to team members** using additional Gmail send nodes\n  - **Create calendar events**  from meeting requests using Google Calendar integration\n  - **Log to spreadsheet**  for email analytics using Google Sheets\n\n### Advanced Filtering\n  - Add Gmail filter conditions to the trigger (sender, subject patterns, etc.)\n  - Include/exclude specific email addresses or domains\n  - Set up different polling schedules for different email types\n\n### Notification Options\n  - Add Slack notifications for high priority emails\n  - Send SMS alerts using Twilio for critical messages\n  - Create tickets in your support system for customer inquiries\n\n### Security considerations\n  - Never hardcode API keys in the workflow - always use n8n's credential system\n  - Review OpenAI's data usage policies for email content processing\n  - Consider data retention policies for processed email content\n  - Test thoroughly with non-sensitive emails first\n\n### Troubleshooting tips\n  - Classification accuracy: Fine-tune category descriptions if emails are being misclassified\n  - Rate limits: Monitor OpenAI API usage to avoid hitting rate limits with high email volumes\n  - Gmail quotas: Be aware of Gmail API quotas when processing large volumes\n  - Label sync: Allow time for Gmail labels to sync across devices and clients\n"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "874dd28f-0458-49bd-9e50-f23fd049c08a",
  "connections": {
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Text Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Text Classifier": {
      "main": [
        [
          {
            "node": "02ca20f3-241e-42df-8969-0c97119b77f8",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "66943ca1-563f-426a-8d81-10be52294555",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "32916943-2fc8-4b25-b986-bbc5ba64df7a",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "ec3002b3-20a6-44c0-855f-43788eedbd4c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Text Classifier",
            "type": "ai_languageModel",
            "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œuds8
Catégorie2
Types de nœuds5
Description de la difficulté

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

Auteur
Abideen Bello

Abideen Bello

@bideen

Data/Automation consultant with experience helping Sales & Marketing teams to streamline their processes. Use my link to book an initial consultation for custom n8n work.

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34