{
  "name": "日报自动化工作流",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            { "field": "cronExpression", "expression": "0 18 * * *" }
          ]
        }
      },
      "name": "每天18点触发",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [0, 0]
    },
    {
      "parameters": {
        "url": "YOUR_GIT_COMMITS_API_URL",
        "method": "GET",
        "options": {}
      },
      "name": "拉取Git提交",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [220, 0]
    },
    {
      "parameters": {
        "url": "YOUR_TASK_SYSTEM_API_URL",
        "method": "GET",
        "options": {}
      },
      "name": "拉取任务",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [220, 160]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            { "name": "merged", "value": "={{$json.message}}\n{{$node[\"拉取任务\"].json.title}}" }
          ]
        }
      },
      "name": "汇总拼接",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [440, 80]
    },
    {
      "parameters": {
        "url": "https://api.moonshot.cn/v1/chat/completions",
        "method": "POST",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            { "name": "Authorization", "value": "Bearer YOUR_LLM_API_KEY" },
            { "name": "Content-Type", "value": "application/json" }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"model\":\"moonshot-v1-8k\",\"messages\":[{\"role\":\"system\",\"content\":\"你是项目助理。根据原始数据生成今日工作日报：今日完成/进行中/明日计划/风险阻塞。每条一句话动词开头，不编造，数据不足写待补充\"},{\"role\":\"user\",\"content\":\"={{$json.merged}}\"}]}",
        "options": {}
      },
      "name": "LLM生成日报",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [660, 80]
    },
    {
      "parameters": {
        "url": "YOUR_FEISHU_OR_DINGTALK_WEBHOOK",
        "method": "POST",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\"msg_type\":\"text\",\"content\":{\"text\":\"={{$json.choices[0].message.content}}\"}}",
        "options": {}
      },
      "name": "推送群消息",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [880, 80]
    }
  ],
  "connections": {
    "每天18点触发": { "main": [ [{ "node": "拉取Git提交", "type": "main", "index": 0 }] ] },
    "拉取Git提交": { "main": [ [{ "node": "汇总拼接", "type": "main", "index": 0 }] ] },
    "拉取任务": { "main": [ [{ "node": "汇总拼接", "type": "main", "index": 0 }] ] },
    "汇总拼接": { "main": [ [{ "node": "LLM生成日报", "type": "main", "index": 0 }] ] },
    "LLM生成日报": { "main": [ [{ "node": "推送群消息", "type": "main", "index": 0 }] ] }
  }
}
