{ "name": "內容起稿引擎", "nodes": [ { "parameters": {}, "id": "a1", "name": "手動觸發", "type": "n8n-nodes-base.manualTrigger", "typeVersion": 1, "position": [ -464, 32 ] }, { "parameters": { "resource": "databasePage", "operation": "getAll", "databaseId": { "__rl": true, "value": "YOUR_NOTION_DATABASE_ID", "mode": "id" }, "returnAll": true, "filterType": "manual", "filters": { "conditions": [ { "key": "Status|select", "condition": "equals", "selectValue": "準備起稿" } ] }, "options": {} }, "id": "n1", "name": "讀選題庫:已揀嘅題", "type": "n8n-nodes-base.notion", "typeVersion": 2.2, "position": [ -288, 32 ], "credentials": { "notionApi": { "name": "KEA" } } }, { "parameters": { "assignments": { "assignments": [ { "id": "m1", "name": "topic", "type": "string", "value": "={{ $json.property_name }}" }, { "id": "m2", "name": "pillar", "type": "string", "value": "={{ $json.property_pillar }}" }, { "id": "m3", "name": "audience", "type": "string", "value": "{{目標受眾}}" }, { "id": "m4", "name": "brand_role", "type": "string", "value": "{{品牌定位}}" }, { "id": "m5", "name": "brand_handle", "type": "string", "value": "{{品牌帳號}}" }, { "id": "m6", "name": "brand_tagline", "type": "string", "value": "{{品牌標語}}" }, { "id": "m7", "name": "slides", "type": "string", "value": "5" } ] }, "options": {} }, "id": "a2", "name": "整理起稿輸入", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ -16, 32 ] }, { "parameters": { "promptType": "define", "text": "=題目:{{ $json.topic }}\nPillar:{{ $json.pillar }}\n受眾:{{ $json.audience }}\n\n產出剛好 {{ $json.slides }} 張 carousel,依照 schema 輸出 JSON。", "options": { "systemMessage": "=你是專業的社交媒體文案創作者,負責為品牌撰寫社交媒體帖文,介紹產品、服務與品牌亮點,吸引讀者關注、互動與採取行動。\n\n品牌角色:{{ $('整理起稿輸入').item.json.brand_role }}\n受眾:{{ $('整理起稿輸入').item.json.audience }}\n\n定位:你是「呈現價值與體驗」,而不是「說教或空談理論」。每篇內容都要讓受眾產生興趣、想要儲存(save)及分享(share)。善用具體生動的細節描述(外觀、特色、使用感受、成效)+實用資訊(價格或方案、適用對象、使用時機、核心亮點)。\n題目可能是行業新聞、一項具體產品/服務,或是一個實用技巧——必須緊扣題目切入,切勿泛化成抽象大道理。\n\n平台格式:\n- threads:風格親和自然、簡潔俐落、不使用 markdown,善用 emoji 分層(🔥核心亮點/📍適用場景/💰方案費用/💡實用重點)最多 4-5 個,不放外部連結\n- ig:內文(caption)較短,結尾附上 3-5 個精準貼題的 hashtag\n- fb:篇幅可稍長,段落分明、排版清晰,方便讀者細讀\n\nCarousel(必須產出剛好 {{ $('整理起稿輸入').item.json.slides }} 張,順序推進):\n- 第 1 張 type=cover:緊扣實際題目或產品/服務名稱,headline = 最吸睛的核心痛點或亮點(≤16字)引導讀者滑動閱讀(swipe);kicker 放 pillar;sub 一句話引起好奇。\n- 中間張 type=body:每張闡述一個賣點/一項特色/一個實用重點,headline ≤16字,sub 一句話補充說明;kicker 寫「重點 N」。\n- 最後張 type=cta:呼籲讀者追蹤(follow)/儲存(save)/進一步體驗,headline ≤16字,sub 一句話;kicker 寫「立即追蹤」。\n每張提供 i(由 1 開始)、type、kicker、headline、sub。headline 與 sub 皆為中文、不放 emoji、標點符號最多一個。\n\n嚴禁:硬性推銷、罐頭勵志語錄、虛構數據、提及由 AI 撰寫。數字僅限使用輸入資料中的真實數據,若無具體數字切勿捏造。\n\n輸出規則(重要):只輸出一個 JSON object,不要加入任何解釋、不要用 ``` 包裹。schema:\n{\"threads\":\"...\",\"ig\":\"...\",\"fb\":\"...\",\"carousel\":[{\"i\":1,\"type\":\"cover\",\"kicker\":\"...\",\"headline\":\"...\",\"sub\":\"...\"}],\"self_check\":\"...\"}" } }, "id": "ag", "name": "起三平台稿", "type": "@n8n/n8n-nodes-langchain.agent", "typeVersion": 3.1, "position": [ 192, 32 ] }, { "parameters": { "model": { "__rl": true, "value": "gpt-4.1-mini", "mode": "list", "cachedResultName": "gpt-4.1-mini" }, "builtInTools": {}, "options": {} }, "id": "lm", "name": "OpenAI 模型", "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi", "typeVersion": 1.3, "position": [ 192, 240 ], "credentials": { "openAiApi": { "name": "OpenAi account" } } }, { "parameters": { "content": "## 來源:邊條題要起稿\n選題庫入面 Status =「已揀」嘅題會被讀出,再整理成起稿輸入。\n", "height": 320, "width": 604, "color": 4 }, "id": "s1", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -496, -96 ] }, { "parameters": { "content": "## AI:一次出三平台稿\nAI Agent 出 Threads / IG / FB 三個版本 \n", "height": 320, "width": 1076, "color": 5 }, "id": "s2", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 128, -96 ] }, { "parameters": { "content": "## 輸出:更新選題庫\n把三平台稿回寫返選題庫,Status 轉「已起稿」。", "height": 320, "width": 620, "color": 3 }, "id": "s3", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ 1232, -96 ] }, { "parameters": { "fieldToSplitOut": "draft.carousel", "options": {} }, "type": "n8n-nodes-base.splitOut", "typeVersion": 1, "position": [ 608, 32 ], "name": "拆出卡片", "id": "08959072-46f3-4e02-815d-0152fa4dc1c1" }, { "parameters": { "fieldsToAggregate": { "fieldToAggregate": [ { "fieldToAggregate": "cardUrl" } ] }, "options": {} }, "type": "n8n-nodes-base.aggregate", "typeVersion": 1, "position": [ 1408, 32 ], "name": "集合 URL", "id": "35ccea87-539b-4b21-851a-2bd33a94c1d3" }, { "parameters": { "assignments": { "assignments": [ { "id": "h1", "name": "html", "type": "string", "value": "={{ (() => { const h=$json.headline||'', s=$json.sub||'', k=$json.kicker||'', i=$json.i||''; const handle=$('整理起稿輸入').item.json.brand_handle; const tag=$('整理起稿輸入').item.json.brand_tagline; const t=$json.type; if(t==='cover'){return `
${k}
${h}
${s}
${handle}SWIPE →
`;} if(t==='cta'){return `
${k}
${h}
${s}
+ 追蹤 ${handle}
${handle}${tag}
`;} return `
${i}
${k}
${h}
${s}
${handle}${tag}
`; })() }}" } ] }, "includeOtherFields": true, "options": {} }, "id": "a6", "name": "卡片 HTML", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 752, 32 ] }, { "parameters": { "assignments": { "assignments": [ { "id": "d1", "name": "draft", "type": "object", "value": "={{ JSON.parse($json.output.replace(/```json/gi,'').replace(/```/g,'').trim()) }}" } ] }, "options": {} }, "id": "pz", "name": "分拆三平台草稿", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 464, 32 ] }, { "parameters": { "method": "POST", "url": "https://production-sfo.browserless.io/screenshot", "authentication": "genericCredentialType", "genericAuthType": "httpQueryAuth", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Cache-Control", "value": "no-cache" } ] }, "sendBody": true, "specifyBody": "json", "jsonBody": "={\n \"html\": {{ $json.html.toJsonString() }},\n \"options\": { \"type\": \"png\" },\n \"viewport\": { \"width\": 1080, \"height\": 1080, \"deviceScaleFactor\": 2 }\n}", "options": { "batching": { "batch": { "batchSize": 1, "batchInterval": 2000 } }, "response": { "response": { "responseFormat": "file", "outputPropertyName": "card.png" } } } }, "id": "a7", "name": "截圖", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 944, 32 ], "credentials": { "httpQueryAuth": { "name": "Browserless.io" } } }, { "parameters": { "operation": "upload", "bucketName": "nca-media", "fileName": "=cards/{{ $('讀選題庫:已揀嘅題').item.json.id }}-{{ $('拆出卡片').item.json.i }}.png", "binaryPropertyName": "card.png", "additionalFields": {} }, "type": "n8n-nodes-base.s3", "typeVersion": 1, "position": [ 1104, 32 ], "name": "上傳卡圖", "id": "93ee2662-bbf9-4681-a169-0cf93e8aa0a8", "credentials": { "s3": { "name": "OctoFlow R2" } } }, { "parameters": { "assignments": { "assignments": [ { "id": "u1", "name": "cardUrl", "type": "string", "value": "=https://YOUR_R2_PUBLIC_HOST/cards/{{ $('讀選題庫:已揀嘅題').item.json.id }}-{{ $('拆出卡片').item.json.i }}.png" } ] }, "options": {} }, "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [ 1264, 32 ], "name": "整理URL", "id": "0afb90b9-7e75-481d-b392-60bf5fe12b96" }, { "parameters": { "method": "PATCH", "url": "=https://api.notion.com/v1/pages/{{ $('讀選題庫:已揀嘅題').first().json.id }}", "authentication": "predefinedCredentialType", "nodeCredentialType": "notionApi", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "Notion-Version", "value": "2022-06-28" } ] }, "sendBody": true, "specifyBody": "json", "jsonBody": "={{ ({ properties: { Card_Carousel: { files: $json.cardUrl.map((u,i)=>({ type:'external', name:'card-'+(i+1)+'.png', external:{ url:u } })) } } }) }}", "options": {} }, "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 1568, 32 ], "name": "上傳到 Notion", "id": "3ad0215e-2194-4ff3-bfbc-77fe902bb465", "credentials": { "notionApi": { "name": "KEA" } } }, { "parameters": { "resource": "databasePage", "operation": "update", "pageId": { "__rl": true, "mode": "id", "value": "={{ $('讀選題庫:已揀嘅題').first().json.id }}" }, "propertiesUi": { "propertyValues": [ { "key": "Draft_Threads|rich_text", "textContent": "={{ $('分拆三平台草稿').first().json.draft.threads }}" }, { "key": "Draft_IG|rich_text", "textContent": "={{ $('分拆三平台草稿').first().json.draft.ig }}" }, { "key": "Draft_FB|rich_text", "textContent": "={{ $('分拆三平台草稿').first().json.draft.fb }}" }, { "key": "Status|select", "selectValue": "已起稿" } ] }, "options": {} }, "id": "n2", "name": "更新選題庫", "type": "n8n-nodes-base.notion", "typeVersion": 2.2, "position": [ 1744, 32 ], "credentials": { "notionApi": { "name": "KEA" } } }, { "parameters": {}, "id": "lim", "name": "分流", "type": "n8n-nodes-base.limit", "typeVersion": 1, "position": [ -144, 32 ] } ], "connections": { "手動觸發": { "main": [ [ { "node": "讀選題庫:已揀嘅題", "type": "main", "index": 0 } ] ] }, "讀選題庫:已揀嘅題": { "main": [ [ { "node": "分流", "type": "main", "index": 0 } ] ] }, "整理起稿輸入": { "main": [ [ { "node": "起三平台稿", "type": "main", "index": 0 } ] ] }, "OpenAI 模型": { "ai_languageModel": [ [ { "node": "起三平台稿", "type": "ai_languageModel", "index": 0 } ] ] }, "起三平台稿": { "main": [ [ { "node": "分拆三平台草稿", "type": "main", "index": 0 } ] ] }, "拆出卡片": { "main": [ [ { "node": "卡片 HTML", "type": "main", "index": 0 } ] ] }, "集合 URL": { "main": [ [ { "node": "上傳到 Notion", "type": "main", "index": 0 } ] ] }, "卡片 HTML": { "main": [ [ { "node": "截圖", "type": "main", "index": 0 } ] ] }, "分拆三平台草稿": { "main": [ [ { "node": "拆出卡片", "type": "main", "index": 0 } ] ] }, "截圖": { "main": [ [ { "node": "上傳卡圖", "type": "main", "index": 0 } ] ] }, "上傳卡圖": { "main": [ [ { "node": "整理URL", "type": "main", "index": 0 } ] ] }, "整理URL": { "main": [ [ { "node": "集合 URL", "type": "main", "index": 0 } ] ] }, "上傳到 Notion": { "main": [ [ { "node": "更新選題庫", "type": "main", "index": 0 } ] ] }, "分流": { "main": [ [ { "node": "整理起稿輸入", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1", "binaryMode": "separate", "timeSavedMode": "fixed", "callerPolicy": "workflowsFromSameOwner", "availableInMCP": true }, "meta": { "exportedFrom": "02haLPjgL1mnpmkz", "exportedAt": "2026-08-21" } }