{
  "nodes": [
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "qwen-turbo-latest",
          "mode": "list",
          "cachedResultName": "qwen-turbo-latest"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        920,
        620
      ],
      "id": "a646887b-1e10-4e84-b902-20ae429d6990",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "\u4f60\u662f\u4e00\u4e2a\u4e13\u4e1a\u7684\u6587\u672c\u6458\u8981\u751f\u6210\u5668\uff0c\u8bf7\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a\n1. \u63a5\u6536\u5305\u542btitle/content/link\u7684JSON\u5bf9\u8c61\n2. \u751f\u6210\u65b0JSON\u5bf9\u8c61\n\u8981\u6c42\uff1a- \u4fdd\u6301\u5b8c\u5168\u76f8\u540c\u7684JSON\u5b57\u6bb5\u7ed3\u6784\n   - title\u548clink\u5b57\u6bb5\u539f\u6837\u4fdd\u7559\n   - \u5bf9content\u5185\u5bb9\u8fdb\u884c\u667a\u80fd\u6458\u8981\uff1a\n     * \u4fdd\u7559\u6838\u5fc3\u89c2\u70b9\u548c\u5173\u952e\u4fe1\u606f\n     * \u957f\u5ea6\u7ea6\u4e3a\u539f\u6587\u768420-30%\n     * \u8bed\u8a00\u7b80\u6d01\u8fde\u8d2f\n     * \u4fdd\u6301\u5ba2\u89c2\u4e2d\u7acb\u7684\u6001\u5ea6\n3. \u8f93\u51fa\u683c\u5f0f\u5fc5\u987b\u4e3a\u6709\u6548\u7684JSON\uff0c\u4e0e\u8f93\u5165\u7ed3\u6784\u5b8c\u5168\u4e00\u81f4\n\u5904\u7406\u4f18\u5148\u7ea7\uff1a\n1. \u4fdd\u6301\u6570\u636e\u7ed3\u6784\u5b8c\u6574\u6027\n2. \u6458\u8981\u8d28\u91cf > \u6458\u8981\u957f\u5ea6\n3. \u7edd\u5bf9\u4e0d\u8981\u6dfb\u52a0\u539f\u59cb\u5185\u5bb9\u5916\u7684\u4fe1\u606f"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        860,
        420
      ],
      "id": "ed1a039e-e2b8-4f3b-8225-86b387daac4f",
      "name": "AI \u751f\u6210\u5185\u5bb9\u7b80\u4ecb"
    },
    {
      "parameters": {
        "operation": "upsert",
        "table": {
          "__rl": true,
          "value": "feed",
          "mode": "list",
          "cachedResultName": "feed"
        },
        "columnToMatchOn": "title",
        "options": {}
      },
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2.4,
      "position": [
        1400,
        420
      ],
      "id": "59870308-0b8e-4618-ba31-d2c46c8b4933",
      "name": "MySQL",
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "return $input.all().map(item => {\n  const data = JSON.parse(item.json.output)\n  return {json:{\n    title:data.title,\n    content: data.content,\n    link: data.link,\n    feed_type:1,\n    create_time:$now.toFormat('yyyy-MM-dd HH:mm:ss'),\n    update_time:$now.toFormat('yyyy-MM-dd HH:mm:ss'),\n  }}\n});"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1220,
        420
      ],
      "id": "c64e2ac0-3bce-4050-aa7b-bbbd04208fe8",
      "name": "\u683c\u5f0f\u5316\u5165\u5e93\u6570\u636e"
    },
    {
      "parameters": {
        "jsCode": "return {titles:$input.all().map((item) => `'${item.json.title}'`).join(',')}"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        220,
        320
      ],
      "id": "ea135225-cd1f-425f-a3eb-4180e09a6367",
      "name": "titles"
    },
    {
      "parameters": {
        "operation": "executeQuery",
        "query": "SELECT title from feed where title in ({{ $json.titles }});",
        "options": {}
      },
      "type": "n8n-nodes-base.mySql",
      "typeVersion": 2.4,
      "position": [
        400,
        320
      ],
      "id": "637adaf1-bade-4885-a74d-055ab572fdbd",
      "name": "alreadyindb",
      "credentials": {
        "mySql": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "mode": "combine",
        "fieldsToMatchString": "title",
        "joinMode": "keepNonMatches",
        "outputDataFrom": "input2",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        660,
        420
      ],
      "id": "442b83f5-7964-4d64-acca-2799305a8632",
      "name": "Merge"
    },
    {
      "parameters": {
        "url": "https://www.woshipm.com/category/it/feed",
        "options": {
          "ignoreSSL": false
        }
      },
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "position": [
        -20,
        420
      ],
      "id": "e7f9e8c1-8edd-4ac4-ac63-ce4253d37ebc",
      "name": "woshipm"
    },
    {
      "parameters": {
        "jsCode": "return $input.all().map(item => {\n  return {json:{\n    title:item.json.title,\n    content: item.json.contentSnippet,\n    link: item.json.link\n  }}\n});"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        280,
        560
      ],
      "id": "e2d6088e-287c-40fe-9d2e-e67a224fe3b1",
      "name": "\u683c\u5f0f\u5316feed\u6570\u636e"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 22
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -220,
        420
      ],
      "id": "a7ddc2ab-b9ba-4989-8ac0-c0d65aceef28",
      "name": "\u6bcf\u592910\u70b9\u6267\u884c"
    }
  ],
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI \u751f\u6210\u5185\u5bb9\u7b80\u4ecb",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI \u751f\u6210\u5185\u5bb9\u7b80\u4ecb": {
      "main": [
        [
          {
            "node": "\u683c\u5f0f\u5316\u5165\u5e93\u6570\u636e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u683c\u5f0f\u5316\u5165\u5e93\u6570\u636e": {
      "main": [
        [
          {
            "node": "MySQL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "titles": {
      "main": [
        [
          {
            "node": "alreadyindb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "alreadyindb": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "AI \u751f\u6210\u5185\u5bb9\u7b80\u4ecb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "woshipm": {
      "main": [
        [
          {
            "node": "titles",
            "type": "main",
            "index": 0
          },
          {
            "node": "\u683c\u5f0f\u5316feed\u6570\u636e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u683c\u5f0f\u5316feed\u6570\u636e": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "\u6bcf\u592910\u70b9\u6267\u884c": {
      "main": [
        [
          {
            "node": "woshipm",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  }
}