{
 "name": "[미분류] 매일 아침 6시 분석 주제 생성기",
 "nodes": [
  {
   "id": "a288ac29-8e4e-4882-9d71-ffb219f7facb",
   "name": "매일 06시 트리거",
   "type": "n8n-nodes-base.scheduleTrigger",
   "typeVersion": 1.3,
   "position": [
    240,
    300
   ],
   "parameters": {
    "rule": {
     "interval": [
      {
       "field": "days",
       "daysInterval": 1,
       "triggerAtHour": 6,
       "triggerAtMinute": 0
      }
     ]
    }
   }
  },
  {
   "id": "a3c2e136-4c94-4239-b887-03a34a759f0a",
   "name": "구글 트렌드 KR 수집",
   "type": "n8n-nodes-base.rssFeedRead",
   "typeVersion": 1.2,
   "position": [
    540,
    80
   ],
   "parameters": {
    "url": "https://trends.google.co.kr/trending/rss?geo=KR"
   },
   "onError": "continueRegularOutput"
  },
  {
   "id": "a49de837-1c69-4eb4-8ba4-47383b36a694",
   "name": "시그널 통합",
   "type": "n8n-nodes-base.merge",
   "typeVersion": 3.2,
   "position": [
    840,
    300
   ],
   "parameters": {
    "mode": "append",
    "numberInputs": 3
   }
  },
  {
   "id": "034c1fbe-b59b-4b20-bd8d-ef4f0496c98e",
   "name": "매경 헤드라인 수집",
   "type": "n8n-nodes-base.rssFeedRead",
   "typeVersion": 1.2,
   "position": [
    540,
    300
   ],
   "parameters": {
    "url": "https://www.mk.co.kr/rss/30000001/"
   },
   "onError": "continueRegularOutput"
  },
  {
   "id": "85125689-5afc-4702-b33e-6fd7ff3bced7",
   "name": "최근 주제 조회",
   "type": "n8n-nodes-base.dataTable",
   "typeVersion": 1.1,
   "position": [
    540,
    520
   ],
   "parameters": {
    "resource": "row",
    "operation": "get",
    "dataTableId": {
     "__rl": true,
     "mode": "id",
     "value": "YOUR_DATATABLEID"
    },
    "returnAll": false,
    "limit": 30,
    "orderBy": true,
    "orderByColumn": "createdAt",
    "orderByDirection": "DESC"
   },
   "alwaysOutputData": true
  },
  {
   "id": "1a723bdd-7477-4c2a-b77c-4b70896a66ce",
   "name": "프롬프트 컨텍스트 구성",
   "type": "n8n-nodes-base.code",
   "typeVersion": 2,
   "position": [
    1140,
    300
   ],
   "parameters": {
    "mode": "runOnceForAllItems",
    "language": "javaScript",
    "jsCode": "const items = $input.all();\nconst signals = [];\nconst recent = [];\nfor (const item of items) {\n  const j = item.json || {};\n  if (j.topic) {\n    recent.push(j.topic);\n  } else if (j.title) {\n    signals.push(j.title);\n  }\n}\nreturn [{ json: {\n  signalsText: signals.slice(0, 40).map(s => '- ' + s).join('\\n') || '- (수집된 시그널 없음)',\n  recentText: recent.slice(0, 30).map(t => '- ' + t).join('\\n') || '- (없음)'\n} }];"
   }
  },
  {
   "id": "fd74e60a-6b41-4a8c-a6fa-bec4bb4b5437",
   "name": "주제 생성 AI",
   "type": "@n8n/n8n-nodes-langchain.agent",
   "typeVersion": 3.1,
   "position": [
    1440,
    300
   ],
   "parameters": {
    "promptType": "define",
    "text": "=오늘의 트렌드 시그널:\n{{ $json.signalsText }}\n\n최근에 이미 다룬 주제(중복 금지):\n{{ $json.recentText }}\n\n위 시그널을 참고해 오늘의 데이터 분석 주제 1개를 JSON으로 생성하라.",
    "hasOutputParser": true,
    "options": {
     "systemMessage": "너는 데이터 분석 주제 기획자다. 매일 아침 \"재미있으면서 돈이 되는\" 데이터 분석 주제 1개를 엄선한다.\n규칙:\n1. monetization_path는 반드시 다음 중 하나: 주식/투자 정보, 창업 아이템 검증, 분석 리포트 판매\n2. 오늘의 트렌드 시그널에 근거한 주제일 것\n3. data_sources는 개인이 무료 또는 저비용으로 실제 접근 가능한 것만 제시 (API 유무, 무료 여부 명시)\n4. duration은 \"1시간\", \"하루\", \"1주일\" 중 하나\n5. 최근에 다룬 주제와 중복 금지\n6. ice는 Impact/Confidence/Ease 각 1~10점, total은 합계, rationale은 한 줄 근거\n7. first_step은 오늘 바로 실행할 수 있는 첫 행동 하나\n8. 모든 텍스트는 한국어로 작성"
    }
   }
  },
  {
   "id": "63496416-c196-429d-bb89-728c8534c77c",
   "name": "주제 JSON 파서",
   "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
   "typeVersion": 1.3,
   "position": [
    1620,
    540
   ],
   "parameters": {
    "schemaType": "fromJson",
    "jsonSchemaExample": "{\"topic\": \"두쫀쿠는 앞으로도 계속 유행할 것인가\", \"category\": \"사회/트렌드\", \"monetization_path\": \"창업 아이템 검증\", \"duration\": \"1주일\", \"background\": \"실제 창업 판단을 위한 수요 지속성 검증\", \"ice\": {\"impact\": 7, \"confidence\": 6, \"ease\": 8, \"total\": 21, \"rationale\": \"트렌드 데이터 접근이 쉬움\"}, \"data_sources\": [{\"name\": \"네이버 데이터랩\", \"access\": \"무료 API\"}], \"first_step\": \"네이버 데이터랩에서 최근 12개월 검색량 추이 확인\"}"
   }
  },
  {
   "id": "7ae09091-03ca-4c31-91cc-63a932ae282e",
   "name": "주제 이력 저장",
   "type": "n8n-nodes-base.dataTable",
   "typeVersion": 1.1,
   "position": [
    1840,
    300
   ],
   "parameters": {
    "resource": "row",
    "operation": "insert",
    "dataTableId": {
     "__rl": true,
     "mode": "id",
     "value": "YOUR_DATATABLEID"
    },
    "columns": {
     "mappingMode": "defineBelow",
     "value": {
      "topic_date": "={{ $now.setZone(\"Asia/Seoul\").toFormat(\"yyyy-MM-dd\") }}",
      "topic": "={{ $json.output.topic }}",
      "category": "={{ $json.output.category }}",
      "duration": "={{ $json.output.duration }}",
      "monetization": "={{ $json.output.monetization_path }}",
      "ice_total": "={{ $json.output.ice.total }}"
     },
     "schema": [
      {
       "id": "topic_date",
       "displayName": "topic_date",
       "required": false,
       "defaultMatch": false,
       "display": true,
       "type": "string",
       "canBeUsedToMatch": true
      },
      {
       "id": "topic",
       "displayName": "topic",
       "required": false,
       "defaultMatch": false,
       "display": true,
       "type": "string",
       "canBeUsedToMatch": true
      },
      {
       "id": "category",
       "displayName": "category",
       "required": false,
       "defaultMatch": false,
       "display": true,
       "type": "string",
       "canBeUsedToMatch": true
      },
      {
       "id": "duration",
       "displayName": "duration",
       "required": false,
       "defaultMatch": false,
       "display": true,
       "type": "string",
       "canBeUsedToMatch": true
      },
      {
       "id": "monetization",
       "displayName": "monetization",
       "required": false,
       "defaultMatch": false,
       "display": true,
       "type": "string",
       "canBeUsedToMatch": true
      },
      {
       "id": "ice_total",
       "displayName": "ice_total",
       "required": false,
       "defaultMatch": false,
       "display": true,
       "type": "number",
       "canBeUsedToMatch": true
      }
     ]
    }
   }
  },
  {
   "id": "635ae673-6f3c-4325-9e4b-b634d71c8542",
   "name": "Slack 채널 발송",
   "type": "n8n-nodes-base.slack",
   "typeVersion": 2.5,
   "position": [
    2140,
    300
   ],
   "parameters": {
    "authentication": "accessToken",
    "channelId": {
     "__rl": true,
     "mode": "id",
     "value": "YOUR_CHANNELID"
    },
    "messageType": "text",
    "operation": "post",
    "otherOptions": {
     "includeLinkToWorkflow": false,
     "mrkdwn": true
    },
    "resource": "message",
    "select": "channel",
    "text": "=:coffee: *오늘의 분석 주제* — {{ $now.setZone(\"Asia/Seoul\").toFormat(\"yyyy-MM-dd\") }}\n\n*주제:* {{ $(\"주제 생성 AI\").item.json.output.topic }}\n*카테고리:* {{ $(\"주제 생성 AI\").item.json.output.category }}\n*수익화 경로:* {{ $(\"주제 생성 AI\").item.json.output.monetization_path }}\n*예상 소요:* {{ $(\"주제 생성 AI\").item.json.output.duration }}\n\n*분석 배경*\n{{ $(\"주제 생성 AI\").item.json.output.background }}\n\n*ICE 점수:* Impact {{ $(\"주제 생성 AI\").item.json.output.ice.impact }} · Confidence {{ $(\"주제 생성 AI\").item.json.output.ice.confidence }} · Ease {{ $(\"주제 생성 AI\").item.json.output.ice.ease }} → *총 {{ $(\"주제 생성 AI\").item.json.output.ice.total }}점*\n_{{ $(\"주제 생성 AI\").item.json.output.ice.rationale }}_\n\n*데이터소스:* {{ $(\"주제 생성 AI\").item.json.output.data_sources.map(d => d.name + \" (\" + d.access + \")\").join(\", \") }}\n\n:point_right: *첫 액션:* {{ $(\"주제 생성 AI\").item.json.output.first_step }}"
   }
  },
  {
   "id": "2c953dbb-dbe0-4a29-a3ab-3bcf95c12bb6",
   "name": "Gemini 3 Flash",
   "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
   "typeVersion": 1.1,
   "position": [
    1390,
    540
   ],
   "parameters": {
    "modelName": "models/gemini-3-flash-preview",
    "options": {
     "maxOutputTokens": 4096,
     "temperature": 0.7
    }
   }
  }
 ],
 "connections": {
  "매일 06시 트리거": {
   "main": [
    [
     {
      "node": "구글 트렌드 KR 수집",
      "type": "main",
      "index": 0
     },
     {
      "node": "매경 헤드라인 수집",
      "type": "main",
      "index": 0
     },
     {
      "node": "최근 주제 조회",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "구글 트렌드 KR 수집": {
   "main": [
    [
     {
      "node": "시그널 통합",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "시그널 통합": {
   "main": [
    [
     {
      "node": "프롬프트 컨텍스트 구성",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "매경 헤드라인 수집": {
   "main": [
    [
     {
      "node": "시그널 통합",
      "type": "main",
      "index": 1
     }
    ]
   ]
  },
  "최근 주제 조회": {
   "main": [
    [
     {
      "node": "시그널 통합",
      "type": "main",
      "index": 2
     }
    ]
   ]
  },
  "프롬프트 컨텍스트 구성": {
   "main": [
    [
     {
      "node": "주제 생성 AI",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "주제 생성 AI": {
   "main": [
    [
     {
      "node": "주제 이력 저장",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "주제 JSON 파서": {
   "ai_outputParser": [
    [
     {
      "node": "주제 생성 AI",
      "type": "ai_outputParser",
      "index": 0
     }
    ]
   ]
  },
  "주제 이력 저장": {
   "main": [
    [
     {
      "node": "Slack 채널 발송",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "Gemini 3 Flash": {
   "ai_languageModel": [
    [
     {
      "node": "주제 생성 AI",
      "type": "ai_languageModel",
      "index": 0
     }
    ]
   ]
  }
 },
 "settings": {
  "executionOrder": "v1",
  "timezone": "Asia/Seoul"
 },
 "pinData": {},
 "meta": {
  "templateCredsSetupCompleted": false,
  "source": "datapopcorn.ai/workflow"
 }
}