8
n8n 한국어amn8n.com

AI로 자동으로 Gmail 이메일을 표시

고급

이것은Ticket Management, AI Summarization분야의자동화 워크플로우로, 17개의 노드를 포함합니다.주로 Gmail, Filter, Switch, GmailTrigger, Agent 등의 노드를 사용하며. GPT-4o mini를 사용하여 Gmail 이메일을 자동으로 분류하고 표시합니다.

사전 요구사항
  • Google 계정 및 Gmail API 인증 정보
  • OpenAI API Key
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "id": "ggkJA0uoozwG7xjI",
  "meta": {
    "instanceId": "0a82a9d5784b67ad963ceff89283b2e40cb771be10fe58ba2682f3598a37c6e1",
    "templateCredsSetupCompleted": true
  },
  "name": "Auto-label incoming Gmail emails using AI",
  "tags": [
    {
      "id": "Ii0eAkipojnzTClF",
      "name": "arlindeveloper",
      "createdAt": "2025-06-27T00:20:16.715Z",
      "updatedAt": "2025-06-27T00:20:16.715Z"
    }
  ],
  "nodes": [
    {
      "id": "43213c04-af84-46b3-95a1-e1ed1112f988",
      "name": "Gmail 트리거",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -260,
        1640
      ],
      "parameters": {
        "simple": false,
        "filters": {},
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "pVkuuYNT0KTxFcw0",
          "name": "Gmail account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "65924fac-5776-4e4f-928a-d1180e730a9c",
      "name": "OpenAI 채팅 모델2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        300,
        1880
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "wAP7QjMnHDyoGfIB",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "887dac9a-7bae-4797-8967-1114660c194a",
      "name": "구조화된 출력 파서1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        560,
        1880
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"email_label\": \"business\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "fa913085-1c4f-4d61-938c-9bbf24fe9e69",
      "name": "스티커 노트3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -360,
        1380
      ],
      "parameters": {
        "color": 7,
        "width": 560,
        "height": 700,
        "content": "## 1. Gmail Trigger + Label Checker\n[Read more about Gmail Trigger node Editing](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.gmailtrigger/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=n8n-nodes-base.gmailTrigger)\n[Read more about Filter node editing](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.filter/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=n8n-nodes-base.filter)\n\n📬 Incoming email check\nThis section triggers when a new email is received in Gmail.\nIt uses a filter to ignore any emails that already have labels, so only unlabeled messages are processed.\nYou can adjust the frequency of the trigger (e.g., every minute, hours or Custom using Cron ⏱️) in the Gmail node."
      },
      "typeVersion": 1
    },
    {
      "id": "a9c899ef-a4f5-4947-9d9b-5d579ae58827",
      "name": "스티커 노트11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1020,
        1380
      ],
      "parameters": {
        "width": 620,
        "height": 1100,
        "content": "##  Sort Gmail messages by category with AI \n\n## 👥 Who's it for  \nThis workflow is perfect for individuals or teams who receive a high volume of emails 📥 and want to automatically organize them into Gmail labels 🏷️ using AI. No coding required!\n\n## 🤖 What it does  \nIt automatically processes new Gmail emails, skips those that already have labels, sends the content to an AI Agent powered by GPT-4o mini 🧠, and applies a relevant label based on the content. All labels must exist in Gmail beforehand.\n\n## ⚙️ How it works  \n1. **📬 Gmail Trigger** – Activates on new email received.  \n2. **🚫 Filter** – Skips emails that already have a label.  \n3. **🧠 AI Agent (GPT-4o mini)** – Analyzes the message and decides which label fits best.  \n4. **🧾 Structured Output Parser** – Formats the AI output into a clean JSON.  \n5. **🔀 Switch Node** – Routes each email to the correct label path based on the AI result.  \n6. **🏷️ Gmail Nodes** – Assign the Gmail label to the original email.\n\n## 📋 Requirements  \n- Gmail account connected to n8n  \n- Pre-created labels in Gmail matching the AI categories  \n- OpenAI credentials with GPT-4o mini access  \n- n8n's AI Agent & Structured Output Parser nodes  \n\n## 🛠️ How to set up  \n1. Open the workflow and adjust the **trigger interval** (e.g., every minute, hours or Custom using Cron ⏱️)  \n2. Check that the **Filter** skips emails with existing labels  \n3. Define your categories in the **AI Agent prompt** and make sure they match the Gmail labels  \n4. Configure the **Switch Node** conditions for each category  \n5. Ensure each **Gmail Label Node** applies the correct label  \n6. Save and activate the workflow ✅\n\n## 🎨 How to customize the workflow  \n- Add or remove categories in the AI prompt & Switch Node   \n- Fine-tune prompt instructions to match your specific use case  \n"
      },
      "typeVersion": 1
    },
    {
      "id": "0415122e-6746-408c-a4eb-5d128c80a921",
      "name": "스티커 노트12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        220,
        1380
      ],
      "parameters": {
        "color": 7,
        "width": 560,
        "height": 700,
        "content": "## 2. AI Agent (GPT-4o mini + Output Parser)\n[Read more about the AI Agent node editing](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=%40n8n%2Fn8n-nodes-langchain.agent)\n[Read more about the Structured Output Parser node editing](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparserstructured/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=%40n8n%2Fn8n-nodes-langchain.outputParserStructured)\n\n🧠 AI-powered categorization\nThe email content is sent to an AI Agent using GPT-4o mini to determine the appropriate label.\nMake sure the prompt includes your predefined categories, and that these labels already exist in Gmail.\nThe Structured Output Parser ensures the AI response is formatted like this:\n{ \"email_label\": \"Your Category Name\" }"
      },
      "typeVersion": 1
    },
    {
      "id": "446e3625-8388-44f6-b04e-2d2483f1d4d5",
      "name": "스티커 노트13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        1380
      ],
      "parameters": {
        "color": 7,
        "width": 760,
        "height": 1300,
        "content": "## 3. Apply labels based on AI output\n[Read more about Switch node editing](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.switch/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=n8n-nodes-base.switch)\n[Read more about Gmail node editing](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.gmail/message-operations/#add-label-to-a-message)\n\n🏷️ Apply labels based on AI output\nThe Switch node uses email_label from the AI response to route each email to the correct label path.\nEach branch corresponds to one category.\nThen, each Gmail node applies the label that matches the category.\n⚠️ Make sure each route and label name matches exactly."
      },
      "typeVersion": 1
    },
    {
      "id": "4b4a928d-5305-40e5-a040-8a2e8787cf30",
      "name": "AI 에이전트 태그 부여",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        340,
        1640
      ],
      "parameters": {
        "text": "=Topic: {{ $json.subject }}\nDescription: {{ $json.text }}\nSender: {{ $json.from.text }}",
        "options": {
          "systemMessage": "=**Your Role**\n\nYou are an intelligent email assistant responsible for sorting incoming messages. Your task is to analyze the content, subject, and sender of each email and assign it to the appropriate category.\n\n**Categories**\n\nCategories for sorting:\n\n-Work: Emails related to jobs, coworkers, meetings, projects, or professional tasks.\n\n-Personal: Messages from friends, family, or general personal life content.\n\n-Finance: Bank emails, invoices, receipts, bills, or payment confirmations.\n\n-Shopping: Order confirmations, promotions, receipts, or product updates from stores.\n\n-Travel: Booking confirmations, tickets, hotel or car rental details, itineraries.\n\n-Newsletters: Recurring marketing or informational emails from subscriptions or blogs.\n\n-Others: Relevant emails that don’t clearly fit into any of the categories above.\n\n**Instructions**\n\n-For each email:\n\n-Analyze the content, subject, and sender\n\n-Assign it to the appropriate category\n\n-Add a label with the category\n\n-If you are unsure, do not label the message\n\n**Response Format**\n\nAlways return the result in JSON format:\n\n{\n  \"email_label\": \"Shopping\"\n}\n\nIMPORTANT – the response must use the exact label format as listed (capitalized with spaces).\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.8
    },
    {
      "id": "5301b42e-ba3c-4f3c-8f84-e4f9ee4ca724",
      "name": "태그 확인 필터",
      "type": "n8n-nodes-base.filter",
      "position": [
        -40,
        1640
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6c287523-4ae2-43c4-8f9a-faf756f01855",
              "operator": {
                "type": "string",
                "operation": "notContains"
              },
              "leftValue": "={{ $json.labelIds[0] }}",
              "rightValue": "Label"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "3ccb8cd6-a329-4507-8158-cbc81b2d31da",
      "name": "스위치",
      "type": "n8n-nodes-base.switch",
      "position": [
        840,
        1940
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Work",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "10893f03-231e-4dba-bfdf-69530f908b4d",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output.email_label }}",
                    "rightValue": "Work"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Personal",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "23e430c2-ac8b-4fb5-bb5a-1fafb9e41b09",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output.email_label }}",
                    "rightValue": "Personal"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Finance",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "53698e8e-f038-405d-a1d3-274dba7fb2a2",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output.email_label }}",
                    "rightValue": "Finance"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Shopping",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "b3b7ffc6-d046-402f-8c9d-2e19d00b49a7",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output.email_label }}",
                    "rightValue": "Shopping"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Travel",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "4e0a670b-4017-4d83-b01a-78a79c55daf2",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output.email_label }}",
                    "rightValue": "Travel"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Newsletters",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "f0079792-cf4b-4c3e-8aed-48e2dddb4e05",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output.email_label }}",
                    "rightValue": "Newsletters"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Others",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "a0c39fdd-3312-4a34-8cd4-41a1a10f9149",
                    "operator": {
                      "name": "filter.operator.equals",
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.output.email_label }}",
                    "rightValue": "Others"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "70f0255c-de96-44a0-bcd0-748c9f6e4fe4",
      "name": "업무",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1320,
        1560
      ],
      "webhookId": "265d6794-4bc1-44e5-b7b0-3a327c860235",
      "parameters": {
        "messageId": "={{ $('Gmail Trigger').item.json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "pVkuuYNT0KTxFcw0",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "525f3f9f-9bc7-40f1-b6a5-8c3edd75025f",
      "name": "개인",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1320,
        1720
      ],
      "webhookId": "d63928b3-89bb-4549-b241-8a5462db0116",
      "parameters": {
        "messageId": "={{ $('Gmail Trigger').item.json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "pVkuuYNT0KTxFcw0",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "84059ca7-f0cb-4582-bfb7-75f2678c1dae",
      "name": "금융",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1320,
        1880
      ],
      "webhookId": "e35bc26e-3b63-471a-8c82-909ccc4aac6c",
      "parameters": {
        "messageId": "={{ $('Gmail Trigger').item.json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "pVkuuYNT0KTxFcw0",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "eb7f8180-c834-4f2a-b102-7e5bbacaca3b",
      "name": "쇼핑",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1160,
        2020
      ],
      "webhookId": "29f83d35-3ad1-4e5b-9359-8b9b2e83ed80",
      "parameters": {
        "messageId": "={{ $('Gmail Trigger').item.json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "pVkuuYNT0KTxFcw0",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "12ba969b-d0aa-475c-ab5e-e4151f8df96e",
      "name": "여행",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1320,
        2140
      ],
      "webhookId": "4513f916-1685-4733-8fa6-6373a90abc5e",
      "parameters": {
        "messageId": "={{ $('Gmail Trigger').item.json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "pVkuuYNT0KTxFcw0",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "41bebc40-ba6a-448e-8e28-d74b9ed73de6",
      "name": "뉴스레터",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1320,
        2320
      ],
      "webhookId": "523b3148-4ff3-4bf5-be9b-31a4b7739b3c",
      "parameters": {
        "messageId": "={{ $('Gmail Trigger').item.json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "pVkuuYNT0KTxFcw0",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "9b3690d5-419c-4b4f-9e86-8720a94818d9",
      "name": "기타",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1320,
        2500
      ],
      "webhookId": "b20366d0-4de9-4c99-a577-a14bfff50faf",
      "parameters": {
        "messageId": "={{ $('Gmail Trigger').item.json.id }}",
        "operation": "addLabels"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "pVkuuYNT0KTxFcw0",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "551de827-cf86-472f-935e-99539be78588",
  "connections": {
    "3ccb8cd6-a329-4507-8158-cbc81b2d31da": {
      "main": [
        [
          {
            "node": "70f0255c-de96-44a0-bcd0-748c9f6e4fe4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "525f3f9f-9bc7-40f1-b6a5-8c3edd75025f",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "84059ca7-f0cb-4582-bfb7-75f2678c1dae",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "eb7f8180-c834-4f2a-b102-7e5bbacaca3b",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "12ba969b-d0aa-475c-ab5e-e4151f8df96e",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "41bebc40-ba6a-448e-8e28-d74b9ed73de6",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "9b3690d5-419c-4b4f-9e86-8720a94818d9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "43213c04-af84-46b3-95a1-e1ed1112f988": {
      "main": [
        [
          {
            "node": "5301b42e-ba3c-4f3c-8f84-e4f9ee4ca724",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "65924fac-5776-4e4f-928a-d1180e730a9c": {
      "ai_languageModel": [
        [
          {
            "node": "4b4a928d-5305-40e5-a040-8a2e8787cf30",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "5301b42e-ba3c-4f3c-8f84-e4f9ee4ca724": {
      "main": [
        [
          {
            "node": "4b4a928d-5305-40e5-a040-8a2e8787cf30",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4b4a928d-5305-40e5-a040-8a2e8787cf30": {
      "main": [
        [
          {
            "node": "3ccb8cd6-a329-4507-8158-cbc81b2d31da",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "887dac9a-7bae-4797-8967-1114660c194a": {
      "ai_outputParser": [
        [
          {
            "node": "4b4a928d-5305-40e5-a040-8a2e8787cf30",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

고급 - 티켓 관리, AI 요약

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
고급
노드 수17
카테고리2
노드 유형8
난이도 설명

고급 사용자를 위한 16+개 노드의 복잡한 워크플로우

저자
Arlin Perez

Arlin Perez

@arlindeveloper

👋 Hi! I'm Arlin - a QA Engineer with 2 years of experience and a background in Dart & Flutter for mobile app development. ⚙️ I'm passionate about automation and love building efficient workflows using n8n. 📬 Reach out on LinkedIn for any help with custom workflows

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34