個人宛の受信トレイを自動分類

上級

これはPersonal Productivity, Multimodal AI分野の自動化ワークフローで、18個のノードを含みます。主にSet, Code, Gmail, Notion, Aggregateなどのノードを使用。 Gmail、GPT-4o-mini、Notion を使ってメールの分類と要約を自動化

前提条件
  • Googleアカウント + Gmail API認証情報
  • Notion API Key
  • OpenAI API Key
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "id": "RGhw0UmEtucowCuk",
  "meta": {
    "instanceId": "8443f10082278c46aa5cf3acf8ff0f70061a2c58bce76efac814b16290845177",
    "templateCredsSetupCompleted": true
  },
  "name": "Auto-Triage Personal Inbox",
  "tags": [],
  "nodes": [
    {
      "id": "cba3ea9b-89d2-4ef4-a5fd-6cd4c06fd71c",
      "name": "未読メールを取得",
      "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": "メールを分割",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        272,
        -32
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "abc26329-6683-4e9a-a1f7-c95e104d051d",
      "name": "要約をフォーマット",
      "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": "要約を集約",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1344,
        -32
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "b2ca17b9-343c-4a90-99da-b0abcb54e492",
      "name": "Basic LLM Chain",
      "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": "ワークフロー実行時",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -176,
        -32
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "bb021292-df71-4e01-a7de-2650a6444347",
      "name": "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": "フィールドを編集",
      "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": "付箋",
      "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": "付箋1",
      "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": "付箋2",
      "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": "付箋3",
      "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": "付箋4",
      "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": "付箋5",
      "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": "付箋6",
      "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": "付箋7",
      "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": "付箋8",
      "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
          }
        ]
      ]
    }
  }
}
よくある質問

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

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

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

上級 - 個人の生産性, マルチモーダルAI

有料ですか?

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

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

上級者向け、16ノード以上の複雑なワークフロー

作成者
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.

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34