{
  "id": "aihDailyBrief",
  "name": "AIHotple - RSS briefing with source links",
  "active": false,
  "nodes": [
    {
      "id": "start",
      "name": "Start",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "parameters": {},
      "position": [
        0,
        0
      ]
    },
    {
      "id": "read-rss",
      "name": "Read RSS",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "parameters": {
        "url": "http://127.0.0.1:5683/feed.xml",
        "options": {}
      },
      "position": [
        220,
        0
      ]
    },
    {
      "id": "deduplicate-this-input",
      "name": "Deduplicate this input",
      "type": "n8n-nodes-base.removeDuplicates",
      "typeVersion": 2,
      "parameters": {
        "operation": "removeDuplicateInputItems",
        "compare": "selectedFields",
        "fieldsToCompare": "link",
        "options": {}
      },
      "position": [
        440,
        0
      ]
    },
    {
      "id": "new-urls-only",
      "name": "New URLs only",
      "type": "n8n-nodes-base.removeDuplicates",
      "typeVersion": 2,
      "parameters": {
        "operation": "removeItemsSeenInPreviousExecutions",
        "logic": "removeItemsWithAlreadySeenKeyValues",
        "dedupeValue": "={{$json.link}}",
        "options": {
          "scope": "node",
          "historySize": 10000
        }
      },
      "position": [
        660,
        0
      ]
    },
    {
      "id": "summarize-rss-excerpt",
      "name": "Summarize RSS excerpt",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "parameters": {
        "url": "http://127.0.0.1:5683/brief",
        "method": "POST",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ {text:$json.contentSnippet || $json.content || $json.description} }}",
        "options": {
          "timeout": 180000
        }
      },
      "position": [
        880,
        0
      ]
    },
    {
      "id": "keep-original-source",
      "name": "Keep original source",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "parameters": {
        "jsCode": "return $input.all().map((item,i)=>({json:{title:$('New URLs only').all()[i].json.title,source_url:$('New URLs only').all()[i].json.link,summary:item.json.summary,source_scope:'RSS excerpt only',review_required:true}}));"
      },
      "position": [
        1100,
        0
      ]
    },
    {
      "id": "save-briefing",
      "name": "Save briefing",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "parameters": {
        "url": "http://127.0.0.1:5683/record",
        "method": "POST",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ {kind:\"brief\",...$json} }}",
        "options": {
          "timeout": 180000
        }
      },
      "position": [
        1320,
        0
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Read RSS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read RSS": {
      "main": [
        [
          {
            "node": "Deduplicate this input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Deduplicate this input": {
      "main": [
        [
          {
            "node": "New URLs only",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New URLs only": {
      "main": [
        [
          {
            "node": "Summarize RSS excerpt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize RSS excerpt": {
      "main": [
        [
          {
            "node": "Keep original source",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep original source": {
      "main": [
        [
          {
            "node": "Save briefing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveDataSuccessExecution": "all",
    "saveDataErrorExecution": "all"
  }
}
