{
  "name": "会议录音转周报草稿（半成品但能跑）",
  "nodes": [
    {
      "parameters": {},
      "id": "a1f0c9d2-1111-4a01-9c01-000000000001",
      "name": "手动触发（先别自动化触发）",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [-180, 60]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "f1",
              "name": "minuteUrl",
              "value": "https://example.feishu.cn/minutes/obcnxxxxxxxx（换成你的妙记链接）",
              "type": "string"
            },
            { "id": "f2", "name": "meetingDate", "value": "2026-05-21", "type": "string" },
            { "id": "f3", "name": "projectName", "value": "产品例会", "type": "string" }
          ]
        },
        "options": {}
      },
      "id": "a1f0c9d2-1111-4a01-9c01-000000000002",
      "name": "① 录音链接输入",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [60, 60]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "=https://open.feishu.cn/open-apis/minutes/v1/minutes/{{ $json.minuteUrl.split('/').pop() }}/transcript",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": { "timeout": 120000 }
      },
      "id": "a1f0c9d2-1111-4a01-9c01-000000000003",
      "name": "② 抓转写文本（填你的飞书token）",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [300, 60]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({\n  model: 'qwen-plus',\n  messages: [\n    { role: 'system', content: '你是会议纪要整理助手。从转写稿中提取行动项，输出JSON数组，每项包含 project、owner、action、deadline、evidence、confidence、needsCheck 七个字段。只提取明确承诺或主持人确认过的事项；「可能、考虑、回头看看」一律标 needsCheck=true；owner不确定写「待确认」，禁止补全未出现的人名和日期；evidence必须是转写稿原句。' },\n    { role: 'user', content: $json.transcript || $json.data?.transcript || '' }\n  ],\n  response_format: { type: 'json_object' }\n}) }}",
        "options": { "timeout": 300000 }
      },
      "id": "a1f0c9d2-1111-4a01-9c01-000000000004",
      "name": "③ 待办抽取（填你的模型key）",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [540, 60]
    },
    {
      "parameters": {
        "jsCode": "// ④ 周报模板拼装\n// 已知缺陷：录音超过30分钟时，上一个节点可能超时——长会先按议题切段再跑\nconst raw = $input.first().json;\nlet items = [];\ntry {\n  const content = raw.choices?.[0]?.message?.content || '[]';\n  const parsed = JSON.parse(content);\n  items = Array.isArray(parsed) ? parsed : (parsed.items || []);\n} catch (e) {\n  throw new Error('待办抽取返回的不是合法JSON，检查③的输出：' + e.message);\n}\n\nconst CONFIDENCE_GATE = 0.72; // 拍脑袋定的，可改\nconst confirmed = items.filter(i => !i.needsCheck && (i.confidence ?? 0) >= CONFIDENCE_GATE);\nconst needsCheck = items.filter(i => i.needsCheck || (i.confidence ?? 0) < CONFIDENCE_GATE);\n\nconst meta = $('① 录音链接输入').first().json;\nconst line = i => `- [${i.project}] ${i.owner}：${i.action}${i.deadline ? '（' + i.deadline + '）' : ''}\\n  > 依据：${i.evidence}`;\n\nconst report = [\n  `# 周报草稿 · ${meta.projectName} · ${meta.meetingDate}`,\n  '',\n  '## 本周进展 / 下周动作',\n  confirmed.map(line).join('\\n') || '（无明确承诺事项）',\n  '',\n  '## ⚠️ 必须人工确认（别跳过这一段）',\n  needsCheck.map(line).join('\\n') || '（无）',\n  '',\n  '---',\n  '草稿由流程生成，发出前删掉语气像AI的套话。'\n].join('\\n');\n\nreturn [{ json: { report, confirmedCount: confirmed.length, needsCheckCount: needsCheck.length } }];"
      },
      "id": "a1f0c9d2-1111-4a01-9c01-000000000005",
      "name": "④ 周报模板拼装",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [780, 60]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://open.feishu.cn/open-apis/bot/v2/hook/换成你自己的机器人webhook",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ msg_type: 'text', content: { text: $json.report } }) }}",
        "options": {}
      },
      "id": "a1f0c9d2-1111-4a01-9c01-000000000006",
      "name": "⑤ 发给我自己（永远别自动发群）",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [1020, 60]
    },
    {
      "parameters": {
        "content": "## 用之前改两处\n1. ②的 Header Auth 填飞书 token\n2. ③的 Header Auth 填通义千问 key（Bearer sk-xxx）\n\n## 已知缺陷（别问为什么我都试过）\n- 录音 >30 分钟：③会等转写等到超时 → 先按议题切段\n- 同名参会人会串 → owner 对不上唯一人就「待确认」，这条规则别删\n- confidence 阈值 0.72 是拍的，自己改",
        "height": 260,
        "width": 360,
        "color": 3
      },
      "id": "a1f0c9d2-1111-4a01-9c01-000000000007",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-180, -260]
    }
  ],
  "connections": {
    "手动触发（先别自动化触发）": {
      "main": [[{ "node": "① 录音链接输入", "type": "main", "index": 0 }]]
    },
    "① 录音链接输入": {
      "main": [[{ "node": "② 抓转写文本（填你的飞书token）", "type": "main", "index": 0 }]]
    },
    "② 抓转写文本（填你的飞书token）": {
      "main": [[{ "node": "③ 待办抽取（填你的模型key）", "type": "main", "index": 0 }]]
    },
    "③ 待办抽取（填你的模型key）": {
      "main": [[{ "node": "④ 周报模板拼装", "type": "main", "index": 0 }]]
    },
    "④ 周报模板拼装": {
      "main": [[{ "node": "⑤ 发给我自己（永远别自动发群）", "type": "main", "index": 0 }]]
    }
  },
  "settings": { "executionOrder": "v1" },
  "pinData": {}
}
