工作流文件
n8n-学你的口吻写新稿-国内版.json
{"name":"学我的口吻写新稿(国内版)","nodes":[{"parameters":{"content":"## 学我的口吻写新稿(国内版)\n派派编辑部改自 n8n 官方模板 #2648(作者 jimleuk)。\n\n**第一次用:**\n1. 双击「模型」→ Credential to connect with → Create new credential,填 DeepSeek 的 API Key。Model 已经填好 deepseek-flash\n2. 点右上角 Publish 发布\n3. 双击「① 贴我写过的文章」,复制 Production URL,在登录了 n8n 的浏览器里打开;第一次会问能不能用你的 n8n 账号运行,点 Allow access。「② 按我的文风写」也一样\n\n**只喂你自己写的文章。** 拿别人的文章学口吻再发出去,有洗稿、侵权的风险。\n\n**AI 只用你在「素材」里写的事实**,缺的地方写成【补:……】留给你填。发出去之前逐句核对,按《人工智能生成合成内容标识办法》标明 AI 生成。\n\n文风档案和写好的稿子存在 n8n 自带的数据表里:左侧 Overview →「Data tables」。","height":430,"width":560,"color":4},"id":"4baef974-0a81-5fc8-b629-04e0d2fd6ad1","name":"说明","type":"n8n-nodes-base.stickyNote","typeVersion":1,"position":[-960,-330]},{"parameters":{"formTitle":"学我的文风","formDescription":"贴几篇你过去写的文章,AI 总结你的结构、句子和口头禅,存成一份「文风说明书」。只贴你自己写的。大约 1 分钟。","formFields":{"values":[{"fieldLabel":"给这个文风起个名字","fieldName":"style_name","requiredField":true,"placeholder":"例如:修车铺日记、店里的公众号"},{"fieldLabel":"贴 3~5 篇你自己写过的文章","fieldName":"articles","fieldType":"textarea","requiredField":true,"placeholder":"整篇粘贴,标题也带上。篇与篇之间单独起一行,写三个短横线 ---"},{"fieldLabel":"确认","fieldName":"mine","fieldType":"checkbox","requiredField":true,"fieldOptions":{"values":[{"option":"这些文章是我自己写的,或者我有权使用"}]}}]},"authentication":"n8nUserAuth","responseMode":"lastNode","options":{"appendAttribution":false,"buttonLabel":"开始学"}},"id":"193e70da-a757-5069-87fa-45b8be43547e","name":"① 贴我写过的文章","type":"n8n-nodes-base.formTrigger","typeVersion":2.6,"position":[-300,-200]},{"parameters":{"mode":"runOnceForEachItem","jsCode":"// 按单独一行的 --- 把文章拆开,检查篇数和字数\nconst MIN_ARTICLES = 2; // 至少 2 篇,3~5 篇效果最好\nconst MAX_ARTICLES = 8;\nconst MIN_CHARS = 100; // 每篇至少 100 个字,太短看不出写法\nconst MAX_TOTAL = 20000; // 加起来最多 20000 个字,防止一次花太多钱\nconst count = (s) => s.replace(/\\s/g, '').length;\nconst name = String($json.style_name || '').trim().slice(0, 40);\nconst text = String($json.articles || '').replace(/\\r\\n/g, '\\n');\nconst arts = text.split(/^[ \\t]*-{3,}[ \\t]*$/m).map((s) => s.trim()).filter((s) => count(s) > 0);\nconst total = arts.reduce((n, a) => n + count(a), 0);\nlet problem = '';\nif (!name) problem = '给这个文风起个名字,以后写新稿时要填它。';\nelse if (arts.length < MIN_ARTICLES) problem = `只认出了 ${arts.length} 篇。至少贴 ${MIN_ARTICLES} 篇(3~5 篇最好),篇与篇之间单独起一行,写三个短横线 ---。`;\nelse if (arts.length > MAX_ARTICLES) problem = `贴了 ${arts.length} 篇,最多 ${MAX_ARTICLES} 篇。挑最像你、最近写的 3~5 篇就够了。`;\nelse {\n const short = arts.map((a, i) => [i + 1, count(a)]).filter(([, c]) => c < MIN_CHARS);\n if (short.length) problem = `第 ${short.map((x) => x[0]).join('、')} 篇太短(不到 ${MIN_CHARS} 个字),AI 看不出写法,换一篇长一点的。`;\n else if (total > MAX_TOTAL) problem = `加起来 ${total} 个字,超过了 ${MAX_TOTAL} 字。少贴几篇,或者每篇只留正文。`;\n}\nconst block = arts.map((a, i) => `===== 第 ${i + 1} 篇 =====\\n${a}`).join('\\n\\n');\nreturn { json: { style_name: name, articles: arts, count: arts.length, total, block, problem } };"},"id":"a45754ac-e56e-5636-ab3f-fa3c9fb12552","name":"拆开文章","type":"n8n-nodes-base.code","typeVersion":2,"position":[-80,-200]},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"loose","version":2},"conditions":[{"id":"c1","leftValue":"={{ $json.problem }}","rightValue":"","operator":{"type":"string","operation":"empty","singleValue":true}}],"combinator":"and"},"options":{}},"id":"80d1df3e-6685-5f0c-922d-636d32f08c00","name":"文章够不够","type":"n8n-nodes-base.if","typeVersion":2.2,"position":[140,-200]},{"parameters":{"operation":"completion","completionTitle":"还没法学","completionMessage":"={{ $json.problem }}","options":{}},"id":"335fc7af-4356-5e9c-a509-50a01146b149","name":"没法学","type":"n8n-nodes-base.form","typeVersion":2.5,"position":[400,-20]},{"parameters":{"promptType":"define","text":"=你是一位中文编辑,擅长拆解作者的写作习惯。下面是同一位作者写的 {{ $json.count }} 篇文章。请总结这位作者的写法,写成一份「文风说明书」。以后别人照着它写新文章,要让老读者觉得还是这个人写的。\n\n【怎么总结】\n- 只根据这几篇原文总结,原文里看得出来的才写。不要猜原文没写的事。\n- 每一条都要具体到能照着做。「语言生动」「接地气」这种空话不要,要写成「句子短,多数不超过 15 个字,很少用逗号连成长句」这样。\n- 固定的标题格式、开头、结尾和口头禅,原样写出来,这是最像作者的地方。\n- 引用原文当例子时,每个例子不超过 15 个字,只摘最能说明问题的半句。\n\n【输出格式】用 Markdown,按这个顺序,不要开场白:\n## 一句话画像\n## 结构:标题、开头、中间、结尾\n## 句子和用词\n(句子长短、标点习惯、口语还是书面、方言词、人称、怎么称呼读者、数字怎么写)\n## 固定说法和口头禅\n(逐条列出,注明用在标题、开头、正文还是结尾)\n## 情绪和态度\n## 这位作者不会这么写\n(5 条以内,写具体的反例,比如从不用感叹号、从不喊口号)\n## 照着写时最容易走样的地方\n(3 条以内)\n\n【原文】\n{{ $json.block }}","batching":{}},"id":"e2b5e7ae-f54f-5606-b98e-d1aa7cebd68a","name":"总结文风","type":"@n8n/n8n-nodes-langchain.chainLlm","typeVersion":1.7,"position":[400,-200],"retryOnFail":true,"maxTries":2,"waitBetweenTries":3000,"onError":"continueErrorOutput"},{"parameters":{"mode":"runOnceForEachItem","jsCode":"// 把说明书和原文一起存起来:原文留着给写新稿时「查重」用\nconst a = $('拆开文章').item.json;\nconst style = String($json.text || '').trim();\nconst esc = (s) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');\nreturn { json: { name: a.style_name, style, articles: JSON.stringify(a.articles), article_count: a.count, chars: a.total, style_safe: esc(style) } };"},"id":"ba77b8f6-7bb4-5e52-9017-559fbce7069a","name":"整理文风档案","type":"n8n-nodes-base.code","typeVersion":2,"position":[680,-200]},{"parameters":{"resource":"table","operation":"create","tableName":"文风档案","columns":{"column":[{"name":"name","type":"string"},{"name":"style","type":"string"},{"name":"articles","type":"string"},{"name":"article_count","type":"number"},{"name":"chars","type":"number"}]},"options":{"createIfNotExists":true}},"id":"c72c481b-2d6f-5d79-b100-5a8c4a1278e4","name":"建文风表(已有就跳过)","type":"n8n-nodes-base.dataTable","typeVersion":1.1,"position":[900,-200],"executeOnce":true},{"parameters":{"operation":"upsert","dataTableId":{"__rl":true,"mode":"name","value":"文风档案"},"filters":{"conditions":[{"keyName":"name","condition":"eq","keyValue":"={{ $('整理文风档案').first().json.name }}"}]},"columns":{"mappingMode":"defineBelow","value":{"name":"={{ $('整理文风档案').first().json.name }}","style":"={{ $('整理文风档案').first().json.style }}","articles":"={{ $('整理文风档案').first().json.articles }}","article_count":"={{ $('整理文风档案').first().json.article_count }}","chars":"={{ $('整理文风档案').first().json.chars }}"},"matchingColumns":[],"schema":[{"id":"name","displayName":"name","required":false,"defaultMatch":false,"display":true,"type":"string","readOnly":false,"removed":false},{"id":"style","displayName":"style","required":false,"defaultMatch":false,"display":true,"type":"string","readOnly":false,"removed":false},{"id":"articles","displayName":"articles","required":false,"defaultMatch":false,"display":true,"type":"string","readOnly":false,"removed":false},{"id":"article_count","displayName":"article_count","required":false,"defaultMatch":false,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"chars","displayName":"chars","required":false,"defaultMatch":false,"display":true,"type":"number","readOnly":false,"removed":false}],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{}},"id":"2bb57694-d5cd-5afd-a05a-de33db923dd3","name":"存进文风档案","type":"n8n-nodes-base.dataTable","typeVersion":1.1,"position":[1120,-200]},{"parameters":{"mode":"markdownToHtml","markdown":"={{ $('整理文风档案').first().json.style_safe }}","destinationKey":"style_html","options":{"tables":true,"simpleLineBreaks":true}},"id":"796740be-3d84-5d6b-a3e6-782e66a50ab9","name":"说明书排版","type":"n8n-nodes-base.markdown","typeVersion":1,"position":[1340,-200]},{"parameters":{"operation":"completion","respondWith":"showText","responseText":"=<!doctype html><html lang=\"zh-CN\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><title>文风说明书</title><style>body{margin:0;background:#efeae2;font:16px/1.8 -apple-system,\"PingFang SC\",\"Microsoft YaHei\",\"Noto Sans CJK SC\",sans-serif;color:#26221d}\n.box{max-width:820px;margin:24px auto;background:#fff;border:1px solid #d9cfbf;border-radius:10px;padding:26px 34px}\nh1{font-size:22px;margin:0 0 4px}h2{font-size:18px;border-left:4px solid #9b5b34;padding-left:10px;margin-top:26px}\n.meta{color:#7d6f5c;font-size:14px}.draft{white-space:pre-wrap;background:#fbf8f2;border:1px solid #e6dccb;border-radius:8px;padding:18px 22px;font-size:16px;line-height:1.9}\ntable{border-collapse:collapse;width:100%;font-size:14px}td,th{border:1px solid #e2d8c8;padding:6px 9px;text-align:left;vertical-align:top}th{background:#f6f0e6}\nmark{background:#ffe08a}.todo{color:#a2461b;font-weight:600}.tip{color:#7d6f5c;font-size:13px;margin-top:26px;border-top:1px dashed #d9cfbf;padding-top:12px}</style></head><body><div class=\"box\">\n<h1>文风说明书:{{ $('整理文风档案').first().json.name.replace(/&/g,'&').replace(/</g,'<') }}</h1>\n<div class=\"meta\">学了 {{ $('整理文风档案').first().json.article_count }} 篇、{{ $('整理文风档案').first().json.chars }} 个字,已存进数据表「文风档案」。写新稿时,打开「② 按我的文风写」,文风名字填上面这个。</div>\n{{ $json.style_html.replace(/href=\"(?!https?:)[^\"]*\"/gi, 'href=\"#\"') }}\n<div class=\"tip\">哪条总结得不对,到 n8n 左侧 Overview → Data tables →「文风档案」里直接改 style 这一格,下次写稿就按改过的来。只用你自己写的文章学文风。</div>\n</div></body></html>"},"id":"3f806314-b2c5-50f9-aa4d-72cafa422884","name":"显示文风","type":"n8n-nodes-base.form","typeVersion":2.5,"position":[1560,-200]},{"parameters":{"formTitle":"按我的文风写","formDescription":"照存好的文风说明书写一篇新稿。写完会逐句和你过去的文章比一遍,列出连着 10 个字以上相同的句子。大约 1 分钟。","formFields":{"values":[{"fieldLabel":"用哪个文风","fieldName":"style_name","requiredField":true,"placeholder":"填学文风时起的名字"},{"fieldLabel":"这篇写什么","fieldName":"topic","requiredField":true,"placeholder":"例如:冬天电动车跑不远,先别急着换电瓶"},{"fieldLabel":"要写进去的事实和素材","fieldName":"facts","fieldType":"textarea","requiredField":true,"placeholder":"发生了什么、数字、时间、你的看法,一行一条。AI 只用这里写的事实,缺的会标【补:……】"},{"fieldLabel":"写多长","fieldName":"length","fieldType":"dropdown","requiredField":true,"fieldOptions":{"values":[{"option":"300 字左右"},{"option":"600 字左右"},{"option":"1000 字左右"},{"option":"1500 字左右"}]}}]},"authentication":"n8nUserAuth","responseMode":"lastNode","options":{"appendAttribution":false,"buttonLabel":"开始写"}},"id":"922326fa-63d6-5763-a77f-78a9500b3890","name":"② 按我的文风写","type":"n8n-nodes-base.formTrigger","typeVersion":2.6,"position":[-300,400]},{"parameters":{"operation":"get","returnAll":true,"dataTableId":{"__rl":true,"mode":"name","value":"文风档案"}},"id":"72d066c1-0b39-57b8-a747-1b2071d9cf0f","name":"读文风档案","type":"n8n-nodes-base.dataTable","typeVersion":1.1,"position":[-80,400],"alwaysOutputData":true,"onError":"continueRegularOutput"},{"parameters":{"mode":"runOnceForAllItems","jsCode":"// 按名字找到文风说明书和原文\nconst SEND_ORIGINALS = true; // 写稿时把原文也交给 AI 体会语气;改成 false 只给说明书(更不容易照抄,但没那么像)\nconst f = $('② 按我的文风写').first().json;\nconst want = String(f.style_name || '').trim();\nconst rows = $input.all().map((i) => i.json).filter((r) => r && r.name);\nconst hit = rows.find((r) => String(r.name).trim() === want);\nlet problem = '';\nif (!rows.length) problem = '还没有存过文风。先打开「① 贴我写过的文章」表单,贴几篇你写过的文章,让 AI 学一次。';\nelse if (!hit) problem = `没找到叫「${want}」的文风。已经存过的有:${rows.map((r) => '「' + r.name + '」').join('、')}。`;\nlet articles = [];\ntry { articles = hit ? JSON.parse(hit.articles || '[]') : []; } catch (e) { articles = []; }\nconst block = SEND_ORIGINALS\n ? articles.map((a, i) => `===== 第 ${i + 1} 篇 =====\\n${a}`).join('\\n\\n')\n : '(这次不提供原文,只按说明书写。)';\nreturn [{ json: { problem, style_name: want, topic: String(f.topic || '').trim(), facts: String(f.facts || '').trim(),\n length: f.length || '600 字左右', style: hit ? hit.style : '', articles, block } }];"},"id":"2dfb40ff-7d39-5412-a59c-b92394ff1bb1","name":"准备写稿","type":"n8n-nodes-base.code","typeVersion":2,"position":[140,400]},{"parameters":{"conditions":{"options":{"caseSensitive":true,"leftValue":"","typeValidation":"loose","version":2},"conditions":[{"id":"c2","leftValue":"={{ $json.problem }}","rightValue":"","operator":{"type":"string","operation":"empty","singleValue":true}}],"combinator":"and"},"options":{}},"id":"30c79656-a378-57a0-a47f-ae4dcabcf60f","name":"能写吗","type":"n8n-nodes-base.if","typeVersion":2.2,"position":[360,400]},{"parameters":{"operation":"completion","completionTitle":"没找到这个文风","completionMessage":"={{ $json.problem }}","options":{}},"id":"260d331f-8076-526c-a5a1-d10a4da9579a","name":"没找到文风","type":"n8n-nodes-base.form","typeVersion":2.5,"position":[600,600]},{"parameters":{"promptType":"define","text":"=你替一位作者写一篇新文章。下面有三样东西:这位作者的「文风说明书」、他过去写的文章(只用来体会语气)、这次的主题和素材。\n\n【硬规矩】\n1. 事实只能来自【这次的素材】。素材里没有的人、事、对话、数字、时间、地点,一律不编;也不要把过去文章里的人和事搬过来,当成这次发生的。确实缺一个细节就写不顺的,写成【补:这里写……】,留给作者自己填。\n2. 不照抄过去文章的句子。说明书里列出的固定标题格式、开头、结尾和口头禅可以用;除此之外,不要出现和过去文章连着 10 个字以上相同的句子。\n3. 照说明书写:句子长短、标点、用词、称呼、结构都要像这位作者。说明书里写了「不会这么写」的,一律不用。\n4. 长度:{{ $json.length }}。\n5. 只输出文章本身:第一行是标题(照作者过去的标题格式),空一行后是正文。不要解释,不要写「以下是」。\n\n【文风说明书】\n{{ $json.style }}\n\n【过去的文章(只体会语气,不能照抄)】\n{{ $json.block }}\n\n【这次的主题】\n{{ $json.topic }}\n\n【这次的素材】\n{{ $json.facts }}","batching":{}},"id":"dc3be611-0b3d-53b1-a788-745ebfcc6031","name":"写新稿","type":"@n8n/n8n-nodes-langchain.chainLlm","typeVersion":1.7,"position":[600,400],"retryOnFail":true,"maxTries":2,"waitBetweenTries":3000,"onError":"continueErrorOutput"},{"parameters":{"model":"deepseek-flash","options":{}},"id":"823486f7-d187-579f-939d-096142373cb2","name":"模型","type":"@n8n/n8n-nodes-langchain.lmChatDeepSeek","typeVersion":1,"position":[500,140]},{"parameters":{"operation":"completion","completionTitle":"AI 这次没答上来","completionMessage":"=模型接口报错:{{ String($json.error?.message || $json.error || '未知错误').slice(0, 300) }}。常见原因是 API Key 填错、账户余额不足、模型名写错,或者文章太长超出了模型一次能读的量。过一会儿再试一次,还不行就打开 n8n 的 Executions 看这次执行的详细报错。","options":{}},"id":"132c1a3a-0692-5ca4-8020-fbe68aed6104","name":"AI 没答上来","type":"n8n-nodes-base.form","typeVersion":2.5,"position":[900,120]},{"parameters":{"mode":"runOnceForEachItem","jsCode":"// 逐句查重:新稿里每一句,和你过去的文章比,找连着相同的字(标点、空格不算)\nconst SAME_CHARS = 10; // 连着 10 个字以上相同就列出来\nconst LABEL = '(本文由 AI 辅助生成)'; // AI 生成内容标识,发布时保留\nconst p = $('准备写稿').first().json;\nconst arts = p.articles || [];\nlet raw = String($json.text || '').trim().replace(/^```[a-z]*\\n?/i, '').replace(/\\n?```$/, '').trim();\nconst lines = raw.split('\\n');\nconst title = lines[0].replace(/^#+\\s*/, '').replace(/^标题[::]\\s*/, '').trim();\nconst body = lines.slice(1).join('\\n').trim();\nconst norm = (s) => s.replace(/[\\s\\p{P}\\p{S}]/gu, '');\nconst normArts = arts.map(norm);\nfunction longestCommon(a, b) {\n let best = 0, end = 0, prev = new Array(b.length + 1).fill(0);\n for (let i = 1; i <= a.length; i++) {\n const cur = new Array(b.length + 1).fill(0);\n for (let j = 1; j <= b.length; j++) if (a[i - 1] === b[j - 1]) { cur[j] = prev[j - 1] + 1; if (cur[j] > best) { best = cur[j]; end = i; } }\n prev = cur;\n }\n return a.slice(end - best, end);\n}\nconst sents = (title + '\\n' + body).split(/(?<=[。!?!?;;\\n])/).map((s) => s.trim()).filter(Boolean);\nconst hits = [];\nfor (const s of sents) {\n const ns = norm(s);\n if (ns.length < SAME_CHARS) continue;\n let best = '', from = 0;\n normArts.forEach((na, k) => { const c = longestCommon(ns, na); if (c.length > best.length) { best = c; from = k + 1; } });\n if (best.length >= SAME_CHARS) {\n const inN = normArts.filter((na) => na.includes(best)).length;\n hits.push({ sentence: s, same: best, len: best.length, from, fixed: inN >= 2 });\n }\n}\n// 整篇:有多少字落在和原文相同的 8 字片段里\nconst N = 8, grams = new Set();\nnormArts.forEach((na) => { for (let i = 0; i + N <= na.length; i++) grams.add(na.slice(i, i + N)); });\nconst nb = norm(body), cov = new Array(nb.length).fill(false);\nfor (let i = 0; i + N <= nb.length; i++) if (grams.has(nb.slice(i, i + N))) for (let k = i; k < i + N; k++) cov[k] = true;\nconst overlap = nb.length ? Math.round(cov.filter(Boolean).length * 1000 / nb.length) / 10 : 0;\nconst todo = (title + body).match(/【补[::][^】]*】/g) || [];\nconst copied = hits.filter((h) => !h.fixed);\nconst chars = body.replace(/\\s/g, '').length; // 正文字数(含标点,不含空格)\nconst draft = title + '\\n\\n' + body + '\\n\\n' + LABEL;\nconst esc = (s) => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');\nconst markSame = (s, same) => { // 把相同的那段标黄:先在去掉标点的句子里找到位置,再对回原句\n const chars = [...s], idx = [];\n chars.forEach((ch, i) => { if (!/[\\s\\p{P}\\p{S}]/u.test(ch)) idx.push(i); });\n const at = idx.map((i) => chars[i]).join('').indexOf(same);\n const on = new Set(at < 0 ? [] : idx.slice(at, at + [...same].length));\n return chars.map((ch, i) => (on.has(i) ? '<mark>' + esc(ch) + '</mark>' : esc(ch))).join('').replace(/<\\/mark><mark>/g, '');\n};\nconst rowsHtml = hits.map((h) => `<tr><td>${markSame(h.sentence, h.same)}</td><td>第 ${h.from} 篇</td><td>${h.len} 字</td><td>${h.fixed ? '固定说法(2 篇以上都有)' : '<b>像照抄,建议改</b>'}</td></tr>`).join('');\nconst html = `<h1>${esc(title)}</h1><div class=\"meta\">文风:${esc(p.style_name)} · 主题:${esc(p.topic)} · 正文 ${chars} 字</div>\n<h2>新稿</h2><div class=\"draft\">${esc(body).replace(/【补[::][^】]*】/g, (m) => '<span class=\"todo\">' + m + '</span>')}\\n\\n${esc(LABEL)}</div>\n<h2>要你补的地方:${todo.length} 处</h2>${todo.length ? '<ul>' + todo.map((t) => '<li class=\"todo\">' + esc(t) + '</li>').join('') + '</ul>' : '<p>没有。素材里没写的事实,AI 照规矩不该编,发之前还是逐句对一遍。</p>'}\n<h2>和过去的文章比:连着 ${SAME_CHARS} 个字以上相同的句子 ${hits.length} 句</h2>\n<p class=\"meta\">其中像照抄的 ${copied.length} 句,固定说法 ${hits.length - copied.length} 句;整篇 ${overlap}% 的字落在和原文相同的 8 字片段里。</p>\n${hits.length ? '<table><tr><th>新稿里的句子(黄色是相同的部分)</th><th>出自</th><th>相同</th><th>判断</th></tr>' + rowsHtml + '</table>' : '<p>没有。</p>'}`;\nreturn { json: { style_name: p.style_name, topic: p.topic, facts: p.facts, draft, chars, copied: copied.length, overlap, todo: todo.length, html, hits } };"},"id":"86041f31-6fe1-59f4-9be9-25acbc8cc196","name":"查重和加标识","type":"n8n-nodes-base.code","typeVersion":2,"position":[900,400]},{"parameters":{"resource":"table","operation":"create","tableName":"稿子","columns":{"column":[{"name":"style_name","type":"string"},{"name":"topic","type":"string"},{"name":"facts","type":"string"},{"name":"draft","type":"string"},{"name":"copied","type":"number"},{"name":"overlap","type":"number"},{"name":"todo","type":"number"}]},"options":{"createIfNotExists":true}},"id":"4950e1c7-ef2a-5e22-af5d-2f4290589e74","name":"建稿子表(已有就跳过)","type":"n8n-nodes-base.dataTable","typeVersion":1.1,"position":[1120,400],"executeOnce":true},{"parameters":{"operation":"insert","dataTableId":{"__rl":true,"mode":"name","value":"稿子"},"columns":{"mappingMode":"defineBelow","value":{"style_name":"={{ $('查重和加标识').first().json.style_name }}","topic":"={{ $('查重和加标识').first().json.topic }}","facts":"={{ $('查重和加标识').first().json.facts }}","draft":"={{ $('查重和加标识').first().json.draft }}","copied":"={{ $('查重和加标识').first().json.copied }}","overlap":"={{ $('查重和加标识').first().json.overlap }}","todo":"={{ $('查重和加标识').first().json.todo }}"},"matchingColumns":[],"schema":[{"id":"style_name","displayName":"style_name","required":false,"defaultMatch":false,"display":true,"type":"string","readOnly":false,"removed":false},{"id":"topic","displayName":"topic","required":false,"defaultMatch":false,"display":true,"type":"string","readOnly":false,"removed":false},{"id":"facts","displayName":"facts","required":false,"defaultMatch":false,"display":true,"type":"string","readOnly":false,"removed":false},{"id":"draft","displayName":"draft","required":false,"defaultMatch":false,"display":true,"type":"string","readOnly":false,"removed":false},{"id":"copied","displayName":"copied","required":false,"defaultMatch":false,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"overlap","displayName":"overlap","required":false,"defaultMatch":false,"display":true,"type":"number","readOnly":false,"removed":false},{"id":"todo","displayName":"todo","required":false,"defaultMatch":false,"display":true,"type":"number","readOnly":false,"removed":false}],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{}},"id":"b2faaef1-83cc-54ec-8aa9-adbda6576f17","name":"存进稿子","type":"n8n-nodes-base.dataTable","typeVersion":1.1,"position":[1340,400]},{"parameters":{"operation":"completion","respondWith":"showText","responseText":"=<!doctype html><html lang=\"zh-CN\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><title>新稿</title><style>body{margin:0;background:#efeae2;font:16px/1.8 -apple-system,\"PingFang SC\",\"Microsoft YaHei\",\"Noto Sans CJK SC\",sans-serif;color:#26221d}\n.box{max-width:820px;margin:24px auto;background:#fff;border:1px solid #d9cfbf;border-radius:10px;padding:26px 34px}\nh1{font-size:22px;margin:0 0 4px}h2{font-size:18px;border-left:4px solid #9b5b34;padding-left:10px;margin-top:26px}\n.meta{color:#7d6f5c;font-size:14px}.draft{white-space:pre-wrap;background:#fbf8f2;border:1px solid #e6dccb;border-radius:8px;padding:18px 22px;font-size:16px;line-height:1.9}\ntable{border-collapse:collapse;width:100%;font-size:14px}td,th{border:1px solid #e2d8c8;padding:6px 9px;text-align:left;vertical-align:top}th{background:#f6f0e6}\nmark{background:#ffe08a}.todo{color:#a2461b;font-weight:600}.tip{color:#7d6f5c;font-size:13px;margin-top:26px;border-top:1px dashed #d9cfbf;padding-top:12px}</style></head><body><div class=\"box\">\n{{ $('查重和加标识').first().json.html }}\n<div class=\"tip\">这是初稿,已存进数据表「稿子」。发出去之前:① 逐句对一遍事实,【补】的地方换成真事;② 标黄、写着「像照抄」的句子改掉;③ 末尾的「本文由 AI 辅助生成」按《人工智能生成合成内容标识办法》保留,平台发布页有 AI 声明的也勾上。只用你自己写的文章学文风。</div>\n</div></body></html>"},"id":"5cfaab01-2210-5ecc-aacb-34389986ae06","name":"显示新稿","type":"n8n-nodes-base.form","typeVersion":2.5,"position":[1560,400]}],"connections":{"① 贴我写过的文章":{"main":[[{"node":"拆开文章","type":"main","index":0}]]},"拆开文章":{"main":[[{"node":"文章够不够","type":"main","index":0}]]},"文章够不够":{"main":[[{"node":"总结文风","type":"main","index":0}],[{"node":"没法学","type":"main","index":0}]]},"总结文风":{"main":[[{"node":"整理文风档案","type":"main","index":0}],[{"node":"AI 没答上来","type":"main","index":0}]]},"整理文风档案":{"main":[[{"node":"建文风表(已有就跳过)","type":"main","index":0}]]},"建文风表(已有就跳过)":{"main":[[{"node":"存进文风档案","type":"main","index":0}]]},"存进文风档案":{"main":[[{"node":"说明书排版","type":"main","index":0}]]},"说明书排版":{"main":[[{"node":"显示文风","type":"main","index":0}]]},"② 按我的文风写":{"main":[[{"node":"读文风档案","type":"main","index":0}]]},"读文风档案":{"main":[[{"node":"准备写稿","type":"main","index":0}]]},"准备写稿":{"main":[[{"node":"能写吗","type":"main","index":0}]]},"能写吗":{"main":[[{"node":"写新稿","type":"main","index":0}],[{"node":"没找到文风","type":"main","index":0}]]},"模型":{"ai_languageModel":[[{"node":"总结文风","type":"ai_languageModel","index":0},{"node":"写新稿","type":"ai_languageModel","index":0}]]},"写新稿":{"main":[[{"node":"查重和加标识","type":"main","index":0}],[{"node":"AI 没答上来","type":"main","index":0}]]},"查重和加标识":{"main":[[{"node":"建稿子表(已有就跳过)","type":"main","index":0}]]},"建稿子表(已有就跳过)":{"main":[[{"node":"存进稿子","type":"main","index":0}]]},"存进稿子":{"main":[[{"node":"显示新稿","type":"main","index":0}]]}},"settings":{"executionOrder":"v1","timezone":"Asia/Shanghai","saveManualExecutions":true},"pinData":{},"meta":{"templateCredsSetupCompleted":false}}
下载后在 n8n、Dify 里导入;n8n 也可以直接在画布上按 Ctrl+V 粘贴。