{
  "name": "\ud30c\uc774\ud504\ub77c\uc778 \u2461 Q&A \ud06c\ub864\ub9c1",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 4
            }
          ]
        }
      },
      "id": "schedule-trigger",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// \uc774\uc9c0\uc5b4\ub4dc\ubbfc CS\ucc3d \ud06c\ub864\ub9c1 \uc2dc\ubbac\ub808\uc774\uc158\n// \uc2e4\uc81c \uad6c\ud604 \uc2dc Puppeteer/Playwright \uc0ac\uc6a9\n\nconst mockQnAData = [\n  {\n    id: `QNA-${Date.now()}-1`,\n    platform: '\uc2a4\ub9c8\ud2b8\uc2a4\ud1a0\uc5b4',\n    product_name: '\ud504\ub9ac\ubbf8\uc5c4 \ubb34\uc120 \uc774\uc5b4\ud3f0 X1',\n    question: '\ud55c\ucabd\uc5d0\uc11c\ub9cc \uc18c\ub9ac\uac00 \ub098\uc694',\n    answer: '',\n    date: new Date().toISOString().split('T')[0],\n    is_new: true\n  },\n  {\n    id: `QNA-${Date.now()}-2`,\n    platform: '\ucfe0\ud321',\n    product_name: '\uc62c\uc778\uc6d0 \uacf5\uae30\uccad\uc815\uae30 \uc5d0\uc5b4\ub9c8\uc2a4\ud130',\n    question: '\ud544\ud130 \uad50\uccb4 \ubc29\ubc95 \uc54c\ub824\uc8fc\uc138\uc694',\n    answer: '',\n    date: new Date().toISOString().split('T')[0],\n    is_new: true\n  }\n];\n\nreturn mockQnAData.map(item => ({ json: item }));"
      },
      "id": "crawl-ezadmin",
      "name": "\uc774\uc9c0\uc5b4\ub4dc\ubbfc \ud06c\ub864\ub9c1",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        220,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// \uc911\uc694\ub3c4 \ud544\ud130\ub9c1 \ub85c\uc9c1\nconst keywords = {\n  exclude: ['\ubc30\uc1a1', '\uc5b8\uc81c', '\ub3c4\ucc29', '\uc1a1\uc7a5', '\ud0dd\ubc30', '\ucd9c\uace0'],\n  include: ['\ubd88\ub7c9', '\uace0\uc7a5', '\uc0ac\uc6a9\ubc95', '\ud638\ud658', '\uad50\ud658', '\ud658\ubd88', '\uc791\ub3d9', '\uc124\uba85\uc11c', '\uc548\ub428', '\uc548\ub3fc']\n};\n\nconst items = $input.all();\nconst filtered = [];\n\nfor (const item of items) {\n  const question = item.json.question.toLowerCase();\n  \n  // exclude \ud0a4\uc6cc\ub4dc\uac00 \uc788\uc73c\uba74 \uc81c\uc678\n  const shouldExclude = keywords.exclude.some(k => question.includes(k));\n  if (shouldExclude) continue;\n  \n  // include \ud0a4\uc6cc\ub4dc\uac00 \uc788\uc73c\uba74 \uce74\ud14c\uace0\ub9ac \uc9c0\uc815\n  let category = '\uae30\ud0c0';\n  if (keywords.include.some(k => question.includes(k))) {\n    if (question.includes('\ubd88\ub7c9') || question.includes('\uace0\uc7a5') || question.includes('\uc548\ub428') || question.includes('\uc548\ub3fc')) {\n      category = '\ubd88\ub7c9';\n    } else if (question.includes('\uc0ac\uc6a9\ubc95') || question.includes('\ubc29\ubc95') || question.includes('\uc5b4\ub5bb\uac8c')) {\n      category = '\uc0ac\uc6a9\ubc95';\n    } else if (question.includes('\uad50\ud658') || question.includes('\ud658\ubd88')) {\n      category = '\uad50\ud658/\ud658\ubd88';\n    }\n  }\n  \n  filtered.push({\n    json: {\n      ...item.json,\n      category,\n      filtered_at: new Date().toISOString()\n    }\n  });\n}\n\nreturn filtered;"
      },
      "id": "filter-importance",
      "name": "\uc911\uc694\ub3c4 \ud544\ud130\ub9c1",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        440,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.notion.com/v1/pages",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "notionApi",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Notion-Version",
              "value": "2022-06-28"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"parent\": { \"database_id\": \"{{ $env.NOTION_VOC_DB_ID }}\" },\n  \"properties\": {\n    \"ID\": { \"title\": [{ \"text\": { \"content\": \"{{ $json.id }}\" } }] },\n    \"\ud50c\ub7ab\ud3fc\": { \"select\": { \"name\": \"{{ $json.platform }}\" } },\n    \"\uc0c1\ud488\uba85\": { \"rich_text\": [{ \"text\": { \"content\": \"{{ $json.product_name }}\" } }] },\n    \"\uc9c8\ubb38\": { \"rich_text\": [{ \"text\": { \"content\": \"{{ $json.question }}\" } }] },\n    \"\uce74\ud14c\uace0\ub9ac\": { \"select\": { \"name\": \"{{ $json.category }}\" } },\n    \"\uc218\uc9d1\uc77c\": { \"date\": { \"start\": \"{{ $json.date }}\" } },\n    \"\ucc98\ub9ac\uc0c1\ud0dc\": { \"select\": { \"name\": \"\uc2e0\uaddc\" } }\n  }\n}"
      },
      "id": "notion-create",
      "name": "Notion VOC DB \ub4f1\ub85d",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        660,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "leftValue": "={{ $json.category }}",
              "rightValue": "\ubd88\ub7c9",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "if-urgent",
      "name": "\uae34\uae09 \uc774\uc288 \uccb4\ud06c",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        880,
        0
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $env.JANDI_WEBHOOK_URL }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"body\": \"[\uae34\uae09] \ubd88\ub7c9 \ubb38\uc758 \uc811\uc218\",\n  \"connectColor\": \"#FF0000\",\n  \"connectInfo\": [\n    {\n      \"title\": \"\uc0c1\ud488\",\n      \"description\": \"{{ $json.product_name }}\"\n    },\n    {\n      \"title\": \"\ud50c\ub7ab\ud3fc\",\n      \"description\": \"{{ $json.platform }}\"\n    },\n    {\n      \"title\": \"\ubb38\uc758 \ub0b4\uc6a9\",\n      \"description\": \"{{ $json.question }}\"\n    }\n  ]\n}"
      },
      "id": "jandi-urgent",
      "name": "\uc794\ub514 \uae34\uae09 \uc54c\ub9bc",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1100,
        -100
      ]
    },
    {
      "parameters": {},
      "id": "no-op",
      "name": "\uc644\ub8cc",
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1100,
        100
      ]
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "\uc774\uc9c0\uc5b4\ub4dc\ubbfc \ud06c\ub864\ub9c1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\uc774\uc9c0\uc5b4\ub4dc\ubbfc \ud06c\ub864\ub9c1": {
      "main": [
        [
          {
            "node": "\uc911\uc694\ub3c4 \ud544\ud130\ub9c1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\uc911\uc694\ub3c4 \ud544\ud130\ub9c1": {
      "main": [
        [
          {
            "node": "Notion VOC DB \ub4f1\ub85d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notion VOC DB \ub4f1\ub85d": {
      "main": [
        [
          {
            "node": "\uae34\uae09 \uc774\uc288 \uccb4\ud06c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\uae34\uae09 \uc774\uc288 \uccb4\ud06c": {
      "main": [
        [
          {
            "node": "\uc794\ub514 \uae34\uae09 \uc54c\ub9bc",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "\uc644\ub8cc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}