{
  "name": "RSS Reader → Tóm Tắt AI → Đăng Blog",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [{ "field": "hours", "hoursInterval": 6 }]
        }
      },
      "id": "e1b2c3d4-5555-4aaa-bbbb-000000000001",
      "name": "Schedule Every 6h",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [260, 300]
    },
    {
      "parameters": {
        "url": "https://example.com/feed"
      },
      "id": "e1b2c3d4-5555-4aaa-bbbb-000000000002",
      "name": "RSS Feed Read",
      "type": "n8n-nodes-base.rssFeedRead",
      "typeVersion": 1.1,
      "position": [480, 300]
    },
    {
      "parameters": {
        "maxItems": 5
      },
      "id": "e1b2c3d4-5555-4aaa-bbbb-000000000003",
      "name": "Limit Items",
      "type": "n8n-nodes-base.limit",
      "typeVersion": 1,
      "position": [680, 300]
    },
    {
      "parameters": {
        "model": "gpt-4o-mini",
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "Bạn là nhà báo chuyên nghiệp. Hãy viết lại bài báo thành bài blog tiếng Việt 500-800 từ, có tiêu đề hấp dẫn, giữ nguyên ý chính, thêm phân tích."
            },
            {
              "role": "user",
              "content": "=Tiêu đề: {{ $json.title }}\nNội dung: {{ $json.contentSnippet || $json.content }}\nLink gốc: {{ $json.link }}"
            }
          ]
        },
        "options": {
          "maxTokens": 2000,
          "temperature": 0.8
        }
      },
      "id": "e1b2c3d4-5555-4aaa-bbbb-000000000004",
      "name": "AI Rewrite",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.2,
      "position": [900, 300],
      "credentials": {
        "openAiApi": { "id": "3", "name": "OpenAI account" }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://yourblog.com/wp-json/wp/v2/posts",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            { "name": "title", "value": "={{ $json.choices[0].message.content.split('\\n')[0] }}" },
            { "name": "content", "value": "={{ $json.choices[0].message.content }}" },
            { "name": "status", "value": "draft" },
            { "name": "categories", "value": "[1]" }
          ]
        }
      },
      "id": "e1b2c3d4-5555-4aaa-bbbb-000000000005",
      "name": "Create WP Post",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [1140, 300],
      "credentials": {
        "httpBasicAuth": { "id": "6", "name": "WordPress Auth" }
      }
    }
  ],
  "connections": {
    "Schedule Every 6h": { "main": [[{ "node": "RSS Feed Read", "type": "main", "index": 0 }]] },
    "RSS Feed Read": { "main": [[{ "node": "Limit Items", "type": "main", "index": 0 }]] },
    "Limit Items": { "main": [[{ "node": "AI Rewrite", "type": "main", "index": 0 }]] },
    "AI Rewrite": { "main": [[{ "node": "Create WP Post", "type": "main", "index": 0 }]] }
  },
  "settings": {
    "executionOrder": "v1"
  }
}
