8
n8n 한국어amn8n.com

Gmail과 GPT-4를 사용한 이메일 분류 및 응답 생성 자동화

중급

이것은Ticket Management, Multimodal AI분야의자동화 워크플로우로, 15개의 노드를 포함합니다.주로 If, Gmail, OpenAi, Webhook, GoogleSheets 등의 노드를 사용하며. Gmail 및 GPT-4를 사용한 이메일 분류 및 응답 생성 자동화

사전 요구사항
  • Google 계정 및 Gmail API 인증 정보
  • OpenAI API Key
  • HTTP Webhook 엔드포인트(n8n이 자동으로 생성)
  • Google Sheets API 인증 정보
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "meta": {
    "instanceId": "e7ccf4281d5afb175c79c02db95b45f15d5b53862cb6bc357c5e5bc26567f35c"
  },
  "nodes": [
    {
      "id": "759d4f88-c6de-4cee-af9a-628102d93200",
      "name": "📧 Gmail 웹훅 트리거",
      "type": "n8n-nodes-base.webhook",
      "notes": "🔧 SETUP REQUIRED:\n1. Copy webhook URL after saving\n2. Configure Gmail webhook in Google Cloud Console\n3. Set up Gmail push notifications\n4. Test with sample email",
      "position": [
        -800,
        464
      ],
      "webhookId": "gmail-email-webhook",
      "parameters": {
        "path": "gmail-webhook",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 1
    },
    {
      "id": "000229fb-153f-4db4-ad19-cda7b78f3b57",
      "name": "📩 이메일 세부 정보 가져오기",
      "type": "n8n-nodes-base.gmail",
      "notes": "🔧 SETUP REQUIRED:\n1. Create Gmail OAuth2 credentials\n2. Add scopes: gmail.readonly, gmail.modify\n3. Authorize the connection\n4. Test connection",
      "position": [
        -576,
        464
      ],
      "webhookId": "0d0edb78-408d-41be-b856-b3bdff6b4e4f",
      "parameters": {
        "messageId": "={{ $json.message.data.messageId }}",
        "operation": "get"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "zDJ58xrpmivGPuAW",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "daf62cc0-3dc9-4b67-801b-3c48eeb3d4df",
      "name": "🤖 AI 이메일 분석기",
      "type": "n8n-nodes-base.openAi",
      "notes": "🔧 SETUP REQUIRED:\n1. Get OpenAI API key\n2. Add to credentials\n3. Choose model (gpt-4 recommended)\n4. Adjust temperature for consistency\n5. Test with sample emails",
      "position": [
        -368,
        464
      ],
      "parameters": {
        "model": "gpt-4",
        "prompt": "=Analyze this email and provide a JSON response with the following structure:\n{\n  \"category\": \"urgent|important|promotional|spam|personal|work\",\n  \"sentiment\": \"positive|negative|neutral\",\n  \"priority\": \"high|medium|low\",\n  \"action_needed\": \"reply|forward|archive|delete|flag\",\n  \"summary\": \"brief summary in 1-2 sentences\",\n  \"suggested_response\": \"suggested response if reply needed\",\n  \"keywords\": [\"array\", \"of\", \"relevant\", \"keywords\"]\n}\n\nEmail details:\nFrom: {{ $node['📩 Get Email Details'].json.payload.headers.find(h => h.name === 'From').value }}\nSubject: {{ $node['📩 Get Email Details'].json.payload.headers.find(h => h.name === 'Subject').value }}\nBody: {{ $node['📩 Get Email Details'].json.snippet }}",
        "options": {
          "maxTokens": 1000,
          "temperature": 0.3
        },
        "requestOptions": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "OQJASLp1qn1StvpI",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cf1eba5b-6645-4b21-b5bb-d8cb4ae5015e",
      "name": "🚦 우선순위 라우터",
      "type": "n8n-nodes-base.if",
      "notes": "📝 POST-IT NOTE:\nRoutes emails based on AI analysis\n- High priority → Immediate notification\n- Medium/Low → Standard processing\n- Customize conditions as needed",
      "position": [
        -144,
        464
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": false,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ JSON.parse($json.choices[0].message.content).priority }}",
              "rightValue": "high"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "cbb52bdb-1065-4d4f-b09f-08e9367940f4",
      "name": "🚨 고우선순위 알림",
      "type": "n8n-nodes-base.gmail",
      "notes": "🔧 SETUP REQUIRED:\n1. Update notification email address\n2. Customize alert message\n3. Consider using Slack/Teams instead\n4. Test notification delivery",
      "position": [
        80,
        352
      ],
      "webhookId": "76854229-c43b-4331-9860-d44d5e02b8ec",
      "parameters": {
        "message": "=High priority email received:\n\nFrom: {{ $node['📩 Get Email Details'].json.payload.headers.find(h => h.name === 'From').value }}\nSubject: {{ $node['📩 Get Email Details'].json.payload.headers.find(h => h.name === 'Subject').value }}\n\nAI Summary: {{ JSON.parse($node['🤖 AI Email Analyzer'].json.choices[0].message.content).summary }}\n\nSuggested Action: {{ JSON.parse($node['🤖 AI Email Analyzer'].json.choices[0].message.content).action_needed }}\n\nView in Gmail: https://mail.google.com/mail/u/0/#inbox/{{ $node['📩 Get Email Details'].json.id }}",
        "options": {},
        "subject": "🚨 High Priority Email Alert"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "zDJ58xrpmivGPuAW",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "b77a498a-001c-4029-a60a-1307dafa27fc",
      "name": "🛡️ 스팸 감지기",
      "type": "n8n-nodes-base.if",
      "notes": "📝 POST-IT NOTE:\nDetects spam emails\n- Auto-delete or move to spam\n- Log spam attempts\n- Update spam filters",
      "position": [
        80,
        560
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": false,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ JSON.parse($node['🤖 AI Email Analyzer'].json.choices[0].message.content).category }}",
              "rightValue": "spam"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "1b7b3f23-01cb-42c0-8985-79696d0a38b2",
      "name": "🗑️ 스팸으로 이동",
      "type": "n8n-nodes-base.gmail",
      "notes": "📝 POST-IT NOTE:\nMoves spam to spam folder\n- Removes from inbox\n- Adds spam label\n- Consider auto-delete after time",
      "position": [
        304,
        656
      ],
      "webhookId": "ca7a4755-b0f4-4f7e-9b3a-4c20971b2ce1",
      "parameters": {
        "operation": "modify"
      },
      "typeVersion": 2
    },
    {
      "id": "63ae92b9-71c5-41e9-82f7-606985a1e4f3",
      "name": "💬 자동 답장 감지기",
      "type": "n8n-nodes-base.if",
      "notes": "📝 POST-IT NOTE:\nDetects emails needing replies\n- AI suggests response\n- Option for auto-send or draft\n- Customize reply rules",
      "position": [
        304,
        480
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": false,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ JSON.parse($node['🤖 AI Email Analyzer'].json.choices[0].message.content).action_needed }}",
              "rightValue": "reply"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "778961c6-43d4-4624-abdb-3d6bebcf6249",
      "name": "📝 답장 초안 작성",
      "type": "n8n-nodes-base.gmail",
      "notes": "📝 POST-IT NOTE:\nCreates AI-generated reply draft\n- Review before sending\n- Customize response style\n- Option to auto-send for simple cases",
      "position": [
        528,
        352
      ],
      "webhookId": "2af91249-fdb6-4447-b573-8c06249a52fe",
      "parameters": {
        "message": "={{ JSON.parse($node['🤖 AI Email Analyzer'].json.choices[0].message.content).suggested_response }}\n\n---\nThis is an AI-generated draft. Please review before sending.",
        "options": {},
        "subject": "=Re: {{ $node['📩 Get Email Details'].json.payload.headers.find(h => h.name === 'Subject').value }}",
        "resource": "draft"
      },
      "typeVersion": 2
    },
    {
      "id": "4a6f205f-80e6-42fc-be48-a672b76163ee",
      "name": "🏷️ 이메일 분류",
      "type": "n8n-nodes-base.gmail",
      "notes": "🔧 SETUP REQUIRED:\n1. Create Gmail labels:\n   - URGENT, IMPORTANT\n   - PROMOTIONAL, PERSONAL\n   - WORK, PROJECTS\n2. Customize categories\n3. Set up label colors",
      "position": [
        528,
        560
      ],
      "webhookId": "8c0f452c-f1ac-4c72-8f92-834477ecd627",
      "parameters": {
        "operation": "modify"
      },
      "typeVersion": 2
    },
    {
      "id": "9be9a801-9b54-45f2-a820-4a35dc7915bb",
      "name": "📊 스프레드시트에 기록",
      "type": "n8n-nodes-base.googleSheets",
      "notes": "🔧 SETUP REQUIRED:\n1. Create Google Sheets log\n2. Add headers: timestamp, messageId, from, subject, category, priority, sentiment, action_taken, ai_summary\n3. Share sheet with service account\n4. Update spreadsheet ID",
      "position": [
        752,
        464
      ],
      "parameters": {
        "resource": "spreadsheet",
        "operation": "appendOrUpdate"
      },
      "typeVersion": 4
    },
    {
      "id": "0f78144e-bb3a-4065-b15e-3294750b13b7",
      "name": "✅ 웹훅 응답",
      "type": "n8n-nodes-base.respondToWebhook",
      "notes": "📝 POST-IT NOTE:\nSends response back to Gmail\n- Confirms processing\n- Includes analysis results\n- Required for webhook completion",
      "position": [
        960,
        464
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": {
          "details": {
            "category": "={{ JSON.parse($node['🤖 AI Email Analyzer'].json.choices[0].message.content).category }}",
            "priority": "={{ JSON.parse($node['🤖 AI Email Analyzer'].json.choices[0].message.content).priority }}",
            "messageId": "={{ $node['📩 Get Email Details'].json.id }}",
            "action_taken": "={{ JSON.parse($node['🤖 AI Email Analyzer'].json.choices[0].message.content).action_needed }}"
          },
          "message": "Email processed successfully",
          "success": true
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fe23603a-8174-48ee-8ebf-3cabf507ecd7",
      "name": "스티커 메모9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        -320
      ],
      "parameters": {
        "color": 3,
        "width": 576,
        "height": 560,
        "content": "## Need a tailor-made workflow? Tell me about your business and get a free proposal:\n\n**[Start here → Custom Automation Form](https://taskmorphr.com/contact)**\n\n---\n## 📈 Cost-Savings Snapshot  \nCurious what automation could save you?  \nRun the 60-second calculator:\n\n**[ROI / Cost Comparison](https://taskmorphr.com/cost-comparison)**\n\n---\n### ✉️ Reach me directly  \n`paul@taskmorphr.com`"
      },
      "typeVersion": 1
    },
    {
      "id": "4ca8fea5-6f43-41f9-9e68-e2dca7f73d8e",
      "name": "스티커 메모10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -464,
        64
      ],
      "parameters": {
        "color": 3,
        "width": 224,
        "height": 128,
        "content": "### 🛠️ Build it yourself  \nBrowse every ready-made workflow:  \n[Full Template Pack — coming soon](https://n8n.io/creators/diagopl/)\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f2cbe293-04fa-48c4-8849-4637063becf3",
      "name": "스티커 메모",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1776,
        -304
      ],
      "parameters": {
        "width": 848,
        "height": 2272,
        "content": "# Gmail AI Email Manager - Setup Guide\n\n## 🎯 Workflow Overview\n\nThis workflow will create an intelligent Gmail email manager that can:\n- Monitor incoming emails via webhook\n- Analyze email content using AI\n- Categorize emails automatically\n- Generate smart responses\n- Take actions based on email content\n- Send notifications for important emails\n\n## 📋 Pre-Setup Checklist\n\nBefore we build the workflow, let me gather the necessary information and validate our approach.\n\n### Phase 1: Discovery & Planning\n- [ ] Search for Gmail nodes\n- [ ] Find AI analysis nodes\n- [ ] Identify webhook trigger options\n- [ ] Check notification nodes\n\n### Phase 2: Configuration Requirements\n- [ ] Gmail API credentials\n- [ ] AI service (OpenAI/Claude) API key\n- [ ] Webhook URL setup\n- [ ] Email classification rules\n\n## 🔧 Setup Instructions\n\n### Step 1: Gmail API Setup\n1. Go to Google Cloud Console\n2. Create new project or select existing\n3. Enable Gmail API\n4. Create OAuth 2.0 credentials\n5. Add authorized redirect URI: `https://your-n8n-instance.com/rest/oauth2-credential/callback`\n\n### Step 2: AI Service Setup\nChoose one of the following:\n- **OpenAI**: Get API key from platform.openai.com\n- **Claude**: Get API key from console.anthropic.com\n- **Local AI**: Set up Ollama or similar\n\n### Step 3: n8n Credentials\n1. Gmail OAuth2: Add client ID, secret, and scopes\n2. AI Service: Add API key\n3. Webhook: Configure webhook URL\n\n# Gmail AI Email Manager - Setup Guide\n\n## 🔧 Quick Setup Checklist\n\n### 1. Google Cloud Console\n- [ ] Enable Gmail API\n- [ ] Create OAuth2 credentials  \n- [ ] Add redirect URI: `https://your-n8n.com/rest/oauth2-credential/callback`\n- [ ] Set up Gmail push notifications with Pub/Sub\n\n### 2. API Keys\n- [ ] Get OpenAI API key from platform.openai.com\n- [ ] Create Google Sheets for logging (optional)\n\n### 3. n8n Credentials\n- [ ] **Gmail OAuth2**: Client ID, Secret, Scopes: `gmail.readonly,gmail.modify,gmail.compose`\n- [ ] **OpenAI API**: Your API key\n\n### 4. Gmail Labels (Create these)\n- [ ] URGENT (red) \n- [ ] IMPORTANT (orange)\n- [ ] PROMOTIONAL (purple)\n- [ ] PERSONAL (green) \n- [ ] WORK (blue)\n- [ ] SPAM (gray)\n\n### 5. Update Workflow Values\n- [ ] High Priority Alert: Change notification email\n- [ ] Spreadsheet Log: Update sheet ID (if using)\n- [ ] Webhook: Copy URL after saving workflow\n\n### 6. Test\n- [ ] Save & activate workflow\n- [ ] Send test email to Gmail\n- [ ] Check execution log\n- [ ] Verify auto-categorization works\n\n**That's it! Your AI email manager is ready! 🚀**"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "1b7b3f23-01cb-42c0-8985-79696d0a38b2": {
      "main": [
        [
          {
            "node": "9be9a801-9b54-45f2-a820-4a35dc7915bb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cf1eba5b-6645-4b21-b5bb-d8cb4ae5015e": {
      "main": [
        [
          {
            "node": "cbb52bdb-1065-4d4f-b09f-08e9367940f4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "b77a498a-001c-4029-a60a-1307dafa27fc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b77a498a-001c-4029-a60a-1307dafa27fc": {
      "main": [
        [
          {
            "node": "1b7b3f23-01cb-42c0-8985-79696d0a38b2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "63ae92b9-71c5-41e9-82f7-606985a1e4f3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "000229fb-153f-4db4-ad19-cda7b78f3b57": {
      "main": [
        [
          {
            "node": "daf62cc0-3dc9-4b67-801b-3c48eeb3d4df",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "daf62cc0-3dc9-4b67-801b-3c48eeb3d4df": {
      "main": [
        [
          {
            "node": "cf1eba5b-6645-4b21-b5bb-d8cb4ae5015e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "9be9a801-9b54-45f2-a820-4a35dc7915bb": {
      "main": [
        [
          {
            "node": "0f78144e-bb3a-4065-b15e-3294750b13b7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "778961c6-43d4-4624-abdb-3d6bebcf6249": {
      "main": [
        [
          {
            "node": "4a6f205f-80e6-42fc-be48-a672b76163ee",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4a6f205f-80e6-42fc-be48-a672b76163ee": {
      "main": [
        [
          {
            "node": "9be9a801-9b54-45f2-a820-4a35dc7915bb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "63ae92b9-71c5-41e9-82f7-606985a1e4f3": {
      "main": [
        [
          {
            "node": "778961c6-43d4-4624-abdb-3d6bebcf6249",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "4a6f205f-80e6-42fc-be48-a672b76163ee",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cbb52bdb-1065-4d4f-b09f-08e9367940f4": {
      "main": [
        [
          {
            "node": "4a6f205f-80e6-42fc-be48-a672b76163ee",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "759d4f88-c6de-4cee-af9a-628102d93200": {
      "main": [
        [
          {
            "node": "000229fb-153f-4db4-ad19-cda7b78f3b57",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

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

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

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

중급 - 티켓 관리, 멀티모달 AI

유료인가요?

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

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

일정 경험을 가진 사용자를 위한 6-15개 노드의 중간 복잡도 워크플로우

저자

Automation expert & n8n power user. I build advanced workflows combining AI, outbound, and business logic. Grab my templates or reach out for custom builds.

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34