AIメールリサーチの受信トレイ管理マネージャー

中級

これは自動化ワークフローで、13個のノードを含みます。主にGmail, GmailTrigger, OpenAi, ToolThinkなどのノードを使用。 GPT-4o AIと推論を使ったGmailメール分類の自動化

前提条件
  • Googleアカウント + Gmail API認証情報
  • OpenAI API Key

カテゴリー

-
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "id": "YAlJiB1cYsqCxewZ",
  "meta": {
    "instanceId": "0e1a2b562269befd5dcfc1ff793b9a0d0e907951eac498e2c390de0401708083",
    "templateCredsSetupCompleted": true
  },
  "name": "AI Email Reasoning Inbox Manager",
  "tags": [
    {
      "id": "CJjuUZBDAaUJU0mz",
      "name": "Example",
      "createdAt": "2025-10-13T19:38:15.318Z",
      "updatedAt": "2025-10-13T19:38:15.318Z"
    }
  ],
  "nodes": [
    {
      "id": "0e71a8c5-ba96-473d-9e7e-ccfce68dc949",
      "name": "ラベルID取得",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -640,
        112
      ],
      "webhookId": "ed277ec2-f659-4815-911f-0a3d37e762c7",
      "parameters": {
        "resource": "label",
        "returnAll": true
      },
      "typeVersion": 2.1
    },
    {
      "id": "c2466e9e-48fe-4aee-83af-dd8776229bae",
      "name": "受信メール監視",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -272,
        -112
      ],
      "parameters": {
        "simple": false,
        "filters": {
          "readStatus": "unread"
        },
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "61e42b53-6c7c-4f8b-9faa-469431d4e5bd",
      "name": "既読マーク",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -32,
        -112
      ],
      "webhookId": "acca68ac-57da-439b-b07e-53702c34b30d",
      "parameters": {
        "messageId": "={{ $json.id }}",
        "operation": "markAsRead"
      },
      "typeVersion": 2.1
    },
    {
      "id": "9f5a4ef6-c8de-48c2-88d5-8347a53a7284",
      "name": "AI選択ラベルの正当性/理由説明",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        256,
        32
      ],
      "parameters": {
        "description": "Use the tool to think about something. It will not obtain new information or change the database, but just append the thought to the log. Use this to justify why you have chosen the label you have and make sure it is indeed the most relevant and accurate label you could put the email under"
      },
      "typeVersion": 1
    },
    {
      "id": "eba6b8a0-90e9-480b-a7d3-8492f3399e45",
      "name": "最適ラベル選択",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        192,
        -112
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "GPT-4O"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=You are now a professional email inbox manager for my inbox. \n\nYour job is to select the most relevant label to assign an email to from 1 of the 3 labels clearly defined below: \n\n1. Gumroad Notifications: Label_8633512660150681541\n2. Respond To: Label_6621328525648465499\n3. General: Label_7320308321061690804\n4. Instagram: LABEL ID\n\nThose are the 3 labels\n\nHere are descriptions about each label: \n\n1. Gumroad Notifications:\n\nFor emails that have come from Gumroad (the tool). That's it.\n\n2. Respond To:\n\nThese are emails that would be worthwhile me actually taking a look at and responding to (## NOTE: This excludes people selling me stuff; do NOT put emails in here of people selling me stuff)\n\n3. General: \n\nThis label should include any other email/s that do not meet the requirements of the 2 above specifications for an email qualifiying to the other 2 labels\n\n4. Insagram: \n\nUse this label when a notification comes in from instagram\n\nNow, I want you to take the email message that I have provided below to find and pinpoint the most accurate and relevant label that you think the email should go to: \n\nSubject: {{ $('Watch Incoming Emails').item.json.subject }}\n\nBody: {{ $('Watch Incoming Emails').item.json.text }}\n\n## RULES\n\n• Only output the label you think is most suited and nothing else\n• If you choose \"Gumroad Notifications\" output: Label_8633512660150681541\n• If you choose \"Respond To\" output: Label_6621328525648465499\n• If you choose \"General\" output: Label_7320308321061690804\n• If you choos \"instagram\" output: LABED_ID"
            },
            {
              "role": "system",
              "content": "You are a helpful, intelligent email inbox assistant"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "u1yjzbTDPbdJnZRl",
          "name": "Fatjoe OpenAI Account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "d2ec935e-c6da-4f1c-9646-bb45d51e2d8f",
      "name": "ラベル追加",
      "type": "n8n-nodes-base.gmail",
      "position": [
        608,
        -112
      ],
      "webhookId": "dcf87633-1da0-46d5-bb86-005512814cbd",
      "parameters": {
        "labelIds": "={{ $json.message.content }}",
        "messageId": "={{ $('Watch Incoming Emails').item.json.id }}",
        "operation": "addLabels"
      },
      "typeVersion": 2.1
    },
    {
      "id": "f0192bba-e57f-414d-81a6-1565e172e446",
      "name": "付箋メモ",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        -320
      ],
      "parameters": {
        "color": 5,
        "width": 356,
        "height": 256,
        "content": "## Important Info\n\n### Replace the Labels that are in the Chatgpt prompt with the labels that are in your gmail account. \n\n### Along with the label names you will need to find the Label Id's for each name which you can do using the node in RED Below"
      },
      "typeVersion": 1
    },
    {
      "id": "5de2cb7f-4338-45e7-b213-f065ee392297",
      "name": "付箋メモ1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -256
      ],
      "parameters": {
        "width": 180,
        "height": 400,
        "content": "## Marks Email As Read In your Account"
      },
      "typeVersion": 1
    },
    {
      "id": "ae40c679-a388-467e-8a2c-2ddf242892dd",
      "name": "付箋メモ2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        -256
      ],
      "parameters": {
        "width": 380,
        "height": 400,
        "content": "## Selects Label to put email under and justify's / reasons as to why it has chosen the label it has. "
      },
      "typeVersion": 1
    },
    {
      "id": "fc0f114b-f149-403e-af13-6a749bb2fc89",
      "name": "付箋メモ3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        -256
      ],
      "parameters": {
        "width": 260,
        "height": 400,
        "content": "## Finally, a label is added to the email"
      },
      "typeVersion": 1
    },
    {
      "id": "f180f376-184d-48e9-a220-c07f475d74f2",
      "name": "付箋メモ4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        -32
      ],
      "parameters": {
        "color": 3,
        "width": 356,
        "height": 300,
        "content": "### Used to find label id's in your email account to put in the prompt of the ChatGPT (OpenAI) Node in the flow"
      },
      "typeVersion": 1
    },
    {
      "id": "a9d7eaf6-f902-4f9b-a19f-bea0a89b8764",
      "name": "付箋メモ5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        -256
      ],
      "parameters": {
        "width": 260,
        "height": 400,
        "content": "## Watches Incoming Emails"
      },
      "typeVersion": 1
    },
    {
      "id": "0a289e3f-1ed7-43b3-9449-8f5bd3f38478",
      "name": "付箋メモ7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1808,
        -608
      ],
      "parameters": {
        "color": 5,
        "width": 912,
        "height": 1152,
        "content": "AI inbox labelling manager that has reasoning attached to the ChatGPT inbox manager within n8n. Super simple yet highly effective automation.\n\n## How it works: \n\n• Monitors Gmail inbox → triggers workflow when a new unread email is received.\n\n• Fetches email details including subject, body, and sender information.\n\n• Sends email content to OpenAI → uses AI to determine the most relevant label based on predefined rules.\n\n• AI uses a think tool → justifies why it selected that specific label.\n\n• Retrieves Gmail label IDs → matches AI’s choice to correct Gmail label for that email.\n\n• Adds the chosen label (e.g., Positive reply, priority email, etc) to the email automatically → optionally marks it as read/starred.\n\n• Continues monitoring → every new email is processed automatically, keeping the inbox organized.\n\n## Set Up Steps\n\n• Connect Gmail account to the Gmail Node\n\n• Create OpenAI account & API key → go to OpenAI and sign up or log in. Once logged in, click Dashboard in the top menu. On the left sidebar, find API Keys and click Create new key. Copy this key — you’ll need it for n8n.\n\nCheck your account balance → in the top-right, click your profile icon → Your Profile → Billing. Make sure your account has funds (e.g., $5 USD is enough for testing) so the API requests can run.\n\n**Do these steps through this link:** https://platform.openai.com/\n\n• Retrieve Gmail label IDs → use the Gmail “get labels” node to fetch IDs for all labels you want the AI to use.\n\n• Use OpenAI (ChatGPT) node → set up system and user prompts with rules describing each label, and include the **label IDs (Important)**.\n\n• Test the workflow → send example emails, check labeling, and refine AI prompt or label rules if needed.\n\n• Tip: Pin trigger data for testing (Gmail node \"Watch Incoming Emails\") → re-use the same email record to speed up testing without sending multiple emails.\n\n## About this automation\n\nHandles multiple labels → adding new labels only requires updating the AI prompt (no extra nodes).\n\nScales easily → works for any number of Gmail labels without cluttering the workflow.\n\nFor a complete rundown on how to set this up watch my YouTube tutorial linked below\n\n### See full video tutorial here: \nhttps://www.youtube.com/watch?v=7nda4drHcWw\n\n#### My LinkedIn: https://www.linkedin.com/in/seb-gardner-5b439a260/"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "c3c81590-7766-40ba-9826-63e66eb4ce57",
  "connections": {
    "61e42b53-6c7c-4f8b-9faa-469431d4e5bd": {
      "main": [
        [
          {
            "node": "eba6b8a0-90e9-480b-a7d3-8492f3399e45",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c2466e9e-48fe-4aee-83af-dd8776229bae": {
      "main": [
        [
          {
            "node": "61e42b53-6c7c-4f8b-9faa-469431d4e5bd",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "eba6b8a0-90e9-480b-a7d3-8492f3399e45": {
      "main": [
        [
          {
            "node": "d2ec935e-c6da-4f1c-9646-bb45d51e2d8f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9f5a4ef6-c8de-48c2-88d5-8347a53a7284": {
      "ai_tool": [
        [
          {
            "node": "eba6b8a0-90e9-480b-a7d3-8492f3399e45",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

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

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

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

中級

有料ですか?

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

関連ワークフロー

Danelfin、TwelveData、Alpha Vantage を基にした AI 株式分析
Danelfin、TwelveData、Alpha Vantage を統合した AI 株式分析システム
Set
Code
Gmail
+
Set
Code
Gmail
74 ノードPaul
仮想通貨取引
ビジネスのAIコマンドセンター:Google Workspaceモジュール型アクター、ベクター検索、マルチチャネルレポート
ビジネスAIコマンドセンター:Google Workspaceモジュール型アジンス、ベクター検索、マルチチャネルレポート
Set
Gmail
Slack
+
Set
Gmail
Slack
80 ノードPaul
文書抽出
Stripe請求書発行の自動化
ClickUpとGmailの通知でStripeの領収書ワークフローを自動化する
If
Gmail
Stripe
+
If
Gmail
Stripe
14 ノードSeb
GPT、LangChain、およびインテリジェントルーティングに基づくAI駆動カスタマーサービス自動化
AI駆動カスタマーサービス自動化、GPT、LangChain、およびインテリジェントルーティングに基づく
Set
Gmail
Merge
+
Set
Gmail
Merge
46 ノードPaul
サポート
AIを活用したメール受信箱管理システム、GPT-4、Gmail、Slackとの統合
AIを活用したメール受信箱管理システム、GPT-4、Gmail、Slackとの統合
If
Gmail
Slack
+
If
Gmail
Slack
22 ノードMuhammad Bello
チケット管理
AI駆動のメール返信システム、スパムフィルタリングとFAQ検索を統合、GPT-4o miniとPineconeを活用
AI駆動のメール返信システム、スパムフィルタリングとFAQ検索を統合、GPT-4o miniとPineconeを活用
If
Gmail
Gmail Tool
+
If
Gmail
Gmail Tool
13 ノードMatteo
人工知能
ワークフロー情報
難易度
中級
ノード数13
カテゴリー-
ノードタイプ5
難易度説明

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

作成者
Seb

Seb

@seb

Hi there 👋 I have been building automations for 2.5 years now, and also build automations B2B. Here to share some cool templates!

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34