{
  "nodes": [
    {
      "id": "rss-start",
      "type": "canvas-node",
      "position": { "x": 80, "y": 220 },
      "data": {
        "id": "rss-start",
        "name": "手动触发",
        "engineType": "ManualTrigger",
        "creatorType": "trigger-manual",
        "type": "trigger",
        "icon": "IconPlayerPlay",
        "inputs": [],
        "outputs": [{ "type": "main", "index": 0 }],
        "parameters": {},
        "retryOnFail": false,
        "onError": "stopWorkflow"
      }
    },
    {
      "id": "rss-http",
      "type": "canvas-node",
      "position": { "x": 360, "y": 220 },
      "data": {
        "id": "rss-http",
        "name": "获取订阅源",
        "engineType": "HttpRequest",
        "creatorType": "http-request",
        "icon": "IconWorld",
        "inputs": [{ "type": "main", "index": 0 }],
        "outputs": [{ "type": "main", "index": 0 }],
        "parameters": {
          "url": "https://bee.njstack.com/feed.xml",
          "method": "GET",
          "headers": {},
          "query": {},
          "responseFormat": "text",
          "responseMode": "metadata",
          "outputPropertyName": "data",
          "timeout": 30000,
          "redirect": "follow"
        },
        "retryOnFail": false,
        "onError": "stopWorkflow"
      }
    },
    {
      "id": "rss-code",
      "type": "canvas-node",
      "position": { "x": 680, "y": 220 },
      "data": {
        "id": "rss-code",
        "name": "提取标题列表",
        "engineType": "Code",
        "creatorType": "transform",
        "icon": "IconCode",
        "inputs": [{ "type": "main", "index": 0 }],
        "outputs": [{ "type": "main", "index": 0 }],
        "parameters": {
          "mode": "runOnceForAllItems",
          "code": "const first = $input.first();\nconst body = first && first.json ? first.json : {};\nconst xml = String(body.data || body.body || body.xml || '');\nconst blocks = xml.split(/<item>/i).slice(1);\nconst titles = [];\nfor (const block of blocks) {\n  const match = block.match(/<title>([\\s\\S]*?)<\\/title>/i);\n  if (!match) continue;\n  const clean = match[1].replace(/<!\\[CDATA\\[/g, '').replace(/\\]\\]>/g, '').trim();\n  if (clean) titles.push(clean);\n}\nconst markdown = titles.length\n  ? titles.map((title, index) => (index + 1) + '. ' + title).join('\\n')\n  : '没有解析到条目：请确认接口返回的是 RSS/Atom XML，并把「获取订阅源」的响应格式设为文本。';\nreturn [{ json: { count: titles.length, titles: titles, markdown: markdown } }];"
        },
        "retryOnFail": false,
        "onError": "stopWorkflow"
      }
    },
    {
      "id": "rss-log",
      "type": "canvas-node",
      "position": { "x": 1000, "y": 220 },
      "data": {
        "id": "rss-log",
        "name": "输出标题列表",
        "engineType": "Log",
        "creatorType": "log",
        "icon": "IconFileText",
        "inputs": [{ "type": "main", "index": 0 }],
        "outputs": [{ "type": "main", "index": 0 }],
        "parameters": {
          "level": "info",
          "message": "={{ $json.markdown }}"
        },
        "retryOnFail": false,
        "onError": "stopWorkflow"
      }
    }
  ],
  "edges": [
    { "id": "rss-start-rss-http", "source": "rss-start", "target": "rss-http", "sourceHandle": "outputs/main/0", "targetHandle": "inputs/main/0" },
    { "id": "rss-http-rss-code", "source": "rss-http", "target": "rss-code", "sourceHandle": "outputs/main/0", "targetHandle": "inputs/main/0" },
    { "id": "rss-code-rss-log", "source": "rss-code", "target": "rss-log", "sourceHandle": "outputs/main/0", "targetHandle": "inputs/main/0" }
  ],
  "variables": {},
  "pinData": {},
  "settings": { "scheduleEnabled": false, "maxNodeExecutions": 10000, "executionTimeout": 300 }
}
