{ "name": "選題引擎", "nodes": [ { "parameters": { "rule": { "interval": [ { "triggerAtHour": 8 } ] } }, "id": "3bfe42d4-9cca-4905-8bcd-0e0ed9e98abd", "name": "每朝 8:00 觸發", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.3, "position": [ 0, 400 ] }, { "parameters": { "assignments": { "assignments": [ { "id": "f1", "name": "feeds", "type": "array", "value": "={{ ['YOUR_RSS_SEARCH_QUERY_1','YOUR_RSS_SEARCH_QUERY_2','YOUR_RSS_SEARCH_QUERY_3'].map(q => 'https://news.google.com/rss/search?q=' + encodeURIComponent(q) + '&hl=zh-Hant') }}" } ] }, "options": {} }, "id": "5cc41111-1a3a-4245-8853-66e265d26b0d", "name": "來源:新聞 RSS", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 240, 240 ] }, { "parameters": { "fieldToSplitOut": "feeds", "options": { "destinationFieldName": "feedUrl" } }, "id": "8ed53aa7-0528-48f3-ac1c-434f98f6e29e", "name": "逐條 feed 分行", "type": "n8n-nodes-base.splitOut", "typeVersion": 1, "position": [ 416, 240 ] }, { "parameters": { "url": "={{ $json.feedUrl }}", "options": {} }, "id": "516e29fe-5cd1-4f1c-b892-1d82a38e74f7", "name": "抓 RSS 新聞", "type": "n8n-nodes-base.rssFeedRead", "typeVersion": 1.1, "position": [ 592, 240 ] }, { "parameters": { "assignments": { "assignments": [ { "id": "y1", "name": "queries", "type": "array", "value": "={{ ['YOUR_YOUTUBE_SEARCH_QUERY_1','YOUR_YOUTUBE_SEARCH_QUERY_2','YOUR_YOUTUBE_SEARCH_QUERY_3'] }}" } ] }, "options": {} }, "id": "9d6937c5-bddb-409a-98e3-784cb9ad1199", "name": "來源:YouTube 搜尋字", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 240, 592 ] }, { "parameters": { "fieldToSplitOut": "queries", "options": { "destinationFieldName": "q" } }, "id": "7838cb64-c57c-408a-8260-cfbf20d687a0", "name": "逐條搜尋字分行", "type": "n8n-nodes-base.splitOut", "typeVersion": 1, "position": [ 416, 592 ] }, { "parameters": { "url": "https://www.googleapis.com/youtube/v3/search", "authentication": "genericCredentialType", "genericAuthType": "httpQueryAuth", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "part", "value": "snippet" }, { "name": "q", "value": "={{ $json.q }}" }, { "name": "type", "value": "video" }, { "name": "order", "value": "viewCount" }, { "name": "maxResults", "value": "6" }, { "name": "relevanceLanguage", "value": "zh-Hant" }, { "name": "publishedAfter", "value": "={{ $now.minus({ days: 120 }).toUTC().toISO() }}" } ] }, "options": {} }, "id": "df3b6bd8-03d6-4163-911a-da846ed0806e", "name": "抓 YouTube 熱門片", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.4, "position": [ 592, 592 ], "credentials": { "httpQueryAuth": { "name": "YouTube Data API key (K)" } } }, { "parameters": { "fieldToSplitOut": "items", "options": {} }, "id": "6b147ec2-d2ae-4122-a5f8-6bab820c1c2d", "name": "逐片分行", "type": "n8n-nodes-base.splitOut", "typeVersion": 1, "position": [ 768, 592 ] }, { "parameters": {}, "id": "c8651898-f0b6-4bac-a1ea-de9c39bb2497", "name": "合流:兩路訊號", "type": "n8n-nodes-base.merge", "typeVersion": 3.2, "position": [ 1280, 400 ] }, { "parameters": { "model": { "__rl": true, "mode": "list", "value": "gpt-4.1-mini" }, "builtInTools": {}, "options": { "temperature": 0.6 } }, "id": "5efb0282-2b49-4112-9a63-12efc89c457a", "name": "OpenAI Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "typeVersion": 1.3, "position": [ 1568, 592 ], "credentials": { "openAiApi": { "name": "OpenAi account" } } }, { "parameters": { "resource": "databasePage", "databaseId": { "__rl": true, "value": "YOUR_NOTION_DATABASE_ID", "mode": "id" }, "title": "={{ $json.title }}", "propertiesUi": { "propertyValues": [ { "key": "Angle|rich_text", "textContent": "={{ $json.angle }}" }, { "key": "Pillar|select", "selectValue": "={{ $json.pillar }}" }, { "key": "ICP_Score|number", "numberValue": "={{ $json.icp_fit }}" }, { "key": "Platform|multi_select", "multiSelectValue": "={{ $json.platform_hint }}" }, { "key": "Status|select", "selectValue": "靈感" }, { "key": "Source_Title|rich_text", "textContent": "={{ $json.source_title }}" } ] }, "options": {} }, "id": "ee95a304-0ad2-46d4-bf4c-abe3c156b620", "name": "寫入 Notion 選題庫", "type": "n8n-nodes-base.notion", "typeVersion": 2.2, "position": [ 2128, 400 ], "credentials": { "notionApi": { "name": "KEA" } } }, { "parameters": { "content": "### 來源 A · 新聞 RSS\nGoogle News RSS → 逐 feed 抓 → 排序去重取 24(唯一保留嘅 logic code node)", "height": 304, "width": 992, "color": 4 }, "id": "2765deab-cd9b-4273-83d8-db9e18a03645", "name": "📌 lane 1", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 224, 112 ] }, { "parameters": { "content": "### 來源 B · YouTube\n搜尋字 → YouTube API → 攤平+整理\n", "height": 304, "width": 864, "color": 5 }, "id": "fc54783f-3763-4f2e-bef8-39a4bfd22d3b", "name": "📌 lane 2", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 224, 448 ] }, { "parameters": { "content": "### AI 選題\n\nAggregate 匯總 → LLM Chain(prompt 喺 node 內可直接改)→ Structured Output Parser 自動出 JSON → Split Out 拆行", "height": 512, "width": 844, "color": 6 }, "id": "3b7ba2a9-f975-47ef-84de-58678c049d9b", "name": "📌 lane 3", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 1440, 224 ] }, { "parameters": { "sortFieldsUi": { "sortField": [ { "fieldName": "isoDate", "order": "descending" } ] }, "options": {} }, "id": "f2354dd0-5985-4c3f-afcb-cb951ccbf795", "name": "排序(新到舊)", "type": "n8n-nodes-base.sort", "typeVersion": 1, "position": [ 752, 240 ] }, { "parameters": { "maxItems": 24 }, "id": "974289b9-185c-484f-ab75-c03cb2e9e317", "name": "取最新 24", "type": "n8n-nodes-base.limit", "typeVersion": 1, "position": [ 1088, 240 ] }, { "parameters": { "jsCode": "const out = [];\nfor (const it of $input.all()) {\n let t = it.json.text ?? it.json.output ?? it.json.response ?? '';\n if (typeof t === 'object') t = JSON.stringify(t);\n t = String(t).replace(/```json/gi,'').replace(/```/g,'').trim();\n let obj; try { obj = JSON.parse(t); } catch(e){ continue; }\n const ideas = obj.ideas || (obj.output && obj.output.ideas) || [];\n for (const i of ideas) out.push({ json: {\n title: i.title||'', angle: i.angle||'', pillar: i.pillar||'',\n platform_hint: Array.isArray(i.platform_hint) ? i.platform_hint : (i.platform_hint ? [i.platform_hint] : []),\n icp_fit: i.icp_fit||0, source_title: i.source_title||'', status: 'Idea'\n }});\n}\nreturn out;" }, "id": "e7ee67ce-461a-4e35-9485-b97f29d7457d", "name": "拆選題 JSON〔code〕", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 1920, 400 ] }, { "parameters": { "aggregate": "aggregateAllItemData", "destinationFieldName": "signals", "options": {} }, "id": "c9a52e05-b98d-4156-82fa-54efa2306e94", "name": "匯總", "type": "n8n-nodes-base.aggregate", "typeVersion": 1, "position": [ 1456, 400 ] }, { "parameters": { "promptType": "define", "text": "=市場訊號(共 {{ $json.signals.length }} 條):\n{{ JSON.stringify($json.signals) }}", "messages": { "messageValues": [ { "message": "你是社交媒體內容策略師。你服務各行業的中小企業主與品牌經營者——他們一手包辦業務、沒有充裕時間構思帖文,希望用最少時間產出能吸引目標受眾、帶動流量與業務轉化的內容。語言:繁體中文書面語(香港常用風格,非台式腔)。\n任務:將下方的市場訊號(行業新聞 RSS、社群熱話與趨勢標題)轉化為品牌經營者能直接採用的社交媒體選題。\n內容方向 pillar(每條選一個):出品=核心產品/服務特色/工藝與細節(展現價值)· 幕後=團隊日常/製作流程/品牌故事(建立信任)· 優惠=限時促銷/節慶推廣/方案優惠(促進轉化)· 場景=痛點解決/使用情境/客戶見證與體驗(引發共鳴)。\n硬規則:\n1. 只保留品牌切實可行、能帶來實際業務價值的角度;純新聞或無關訊號直接捨棄。\n2. 時事或節慶熱話可轉化為品牌使用場景或優惠角度(例如:雨天推相應對策方案、節慶推特別企劃),歸類為「場景」或「優惠」。\n3. icp_fit < 3 不予輸出。\n4. 標題與角度使用繁體中文書面語、平實自然、具吸引力與行動感。\n5. 嚴禁 AI 腔調與台式詞彙(例如:無縫、賦能、打造、一鍵、此外、值得注意的是、深入探討、解鎖、釋放潛能、軟體、品質、數位、點亮、顛覆)——出現即視為廢稿。\n6. 每個市場訊號最多產生 1 條選題;共輸出 3-5 條,並依 icp_fit 由高至低排序。\n輸出格式【嚴格】:只輸出一個 JSON object,前後不要有任何文字或 markdown code fence。格式:{\"ideas\":[{\"title\":\"...\",\"angle\":\"...\",\"pillar\":\"出品\"|\"幕後\"|\"優惠\"|\"場景\",\"platform_hint\":[\"Threads\"|\"IG\"|\"FB\"],\"icp_fit\":3至5整數,\"source_title\":\"對應原始 signal 標題\"}]}。依 icp_fit 由高到低排序,輸出 3-5 條。" } ] } }, "id": "6109ec77-4029-47f4-8405-b3c7b3e62db7", "name": "AI 選題", "type": "@n8n/n8n-nodes-langchain.chainLlm", "typeVersion": 1.5, "position": [ 1632, 400 ] }, { "parameters": { "assignments": { "assignments": [ { "id": "s", "name": "source", "type": "string", "value": "rss/news" }, { "id": "t", "name": "title", "type": "string", "value": "={{ ($json.title || '').replace(/\\s+-\\s+[^-]+$/, '').trim() }}" }, { "id": "u", "name": "url", "type": "string", "value": "={{ $json.link }}" } ] }, "options": {} }, "id": "baf8e0b1-d18c-4ecf-867c-314c994d2043", "name": "整理 RSS", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 928, 240 ] }, { "parameters": { "assignments": { "assignments": [ { "id": "s", "name": "source", "type": "string", "value": "youtube" }, { "id": "t", "name": "title", "type": "string", "value": "={{ $json.snippet.title }}" }, { "id": "u", "name": "url", "type": "string", "value": "={{ 'https://youtu.be/' + $json.id.videoId }}" }, { "id": "c", "name": "channel", "type": "string", "value": "={{ $json.snippet.channelTitle }}" } ] }, "options": {} }, "id": "525e8be3-6f90-4a89-89bd-d991acd340b6", "name": "整理 YouTube", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 928, 592 ] }, { "parameters": { "options": {} }, "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter", "typeVersion": 1, "position": [ 1728, 592 ], "id": "9bcde6ab-ce28-4565-8034-2ef3aa121233", "name": "OpenRouter Chat Model", "credentials": { "openRouterApi": { "name": "OpenRouter account" } } } ], "connections": { "每朝 8:00 觸發": { "main": [ [ { "node": "來源:新聞 RSS", "type": "main", "index": 0 }, { "node": "來源:YouTube 搜尋字", "type": "main", "index": 0 } ] ] }, "來源:新聞 RSS": { "main": [ [ { "node": "逐條 feed 分行", "type": "main", "index": 0 } ] ] }, "逐條 feed 分行": { "main": [ [ { "node": "抓 RSS 新聞", "type": "main", "index": 0 } ] ] }, "抓 RSS 新聞": { "main": [ [ { "node": "排序(新到舊)", "type": "main", "index": 0 } ] ] }, "來源:YouTube 搜尋字": { "main": [ [ { "node": "逐條搜尋字分行", "type": "main", "index": 0 } ] ] }, "逐條搜尋字分行": { "main": [ [ { "node": "抓 YouTube 熱門片", "type": "main", "index": 0 } ] ] }, "抓 YouTube 熱門片": { "main": [ [ { "node": "逐片分行", "type": "main", "index": 0 } ] ] }, "逐片分行": { "main": [ [ { "node": "整理 YouTube", "type": "main", "index": 0 } ] ] }, "合流:兩路訊號": { "main": [ [ { "node": "匯總", "type": "main", "index": 0 } ] ] }, "OpenAI Chat Model": { "ai_languageModel": [ [ { "node": "AI 選題", "type": "ai_languageModel", "index": 0 } ] ] }, "排序(新到舊)": { "main": [ [ { "node": "整理 RSS", "type": "main", "index": 0 } ] ] }, "取最新 24": { "main": [ [ { "node": "合流:兩路訊號", "type": "main", "index": 0 } ] ] }, "拆選題 JSON〔code〕": { "main": [ [ { "node": "寫入 Notion 選題庫", "type": "main", "index": 0 } ] ] }, "匯總": { "main": [ [ { "node": "AI 選題", "type": "main", "index": 0 } ] ] }, "AI 選題": { "main": [ [ { "node": "拆選題 JSON〔code〕", "type": "main", "index": 0 } ] ] }, "整理 RSS": { "main": [ [ { "node": "取最新 24", "type": "main", "index": 0 } ] ] }, "整理 YouTube": { "main": [ [ { "node": "合流:兩路訊號", "type": "main", "index": 1 } ] ] }, "OpenRouter Chat Model": { "ai_languageModel": [ [] ] } }, "settings": { "executionOrder": "v1", "binaryMode": "separate", "availableInMCP": true }, "meta": { "exportedFrom": "NclhKeep0zE1q2HF", "exportedAt": "2026-08-21" } }