{
  "name": "Changelog Summarizer from HTTP Source",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24
            }
          ]
        }
      },
      "id": "cls0001-0001-4000-8000-000000000001",
      "name": "Daily Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [240, 300]
    },
    {
      "parameters": {
        "url": "={{ $vars.changelogUrl || 'https://example.com/changelog' }}",
        "options": {
          "timeout": 15000
        }
      },
      "id": "cls0001-0002-4000-8000-000000000002",
      "name": "Fetch Changelog",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [460, 300]
    },
    {
      "parameters": {
        "jsCode": "const raw = $input.item.json.data || '';\n// Strip HTML and clean up the content\nconst cleaned = raw\n  .replace(/<[^>]+>/g, ' ')\n  .replace(/\\s+/g, ' ')\n  .trim();\n// Take first 6000 chars to stay within token limits\nconst truncated = cleaned.slice(0, 6000);\nreturn [{ json: { content: truncated, fetchedAt: new Date().toISOString() } }];"
      },
      "id": "cls0001-0003-4000-8000-000000000003",
      "name": "Clean Changelog Text",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [680, 300]
    },
    {
      "parameters": {
        "resource": "text",
        "operation": "message",
        "modelId": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list"
        },
        "messages": {
          "values": [
            {
              "content": "You are a technical writer. Summarize the following changelog into a digest suitable for a weekly email newsletter. Organize by: New Features, Bug Fixes, Breaking Changes, and Deprecations. Use bullet points. Only include entries that are clearly significant.\n\nChangelog Content:\n{{ $json.content }}"
            }
          ]
        },
        "options": {
          "temperature": 0.2
        }
      },
      "id": "cls0001-0004-4000-8000-000000000004",
      "name": "Summarize with AI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1,
      "position": [900, 300]
    },
    {
      "parameters": {
        "sendTo": "team@company.com",
        "subject": "Weekly Changelog Digest - {{ $('Clean Changelog Text').item.json.fetchedAt.split('T')[0] }}",
        "message": "{{ $json.message.content }}",
        "options": {}
      },
      "id": "cls0001-0005-4000-8000-000000000005",
      "name": "Email Digest",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [1120, 300]
    }
  ],
  "connections": {
    "Daily Schedule Trigger": {
      "main": [[{ "node": "Fetch Changelog", "type": "main", "index": 0 }]]
    },
    "Fetch Changelog": {
      "main": [[{ "node": "Clean Changelog Text", "type": "main", "index": 0 }]]
    },
    "Clean Changelog Text": {
      "main": [[{ "node": "Summarize with AI", "type": "main", "index": 0 }]]
    },
    "Summarize with AI": {
      "main": [[{ "node": "Email Digest", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "meta": {},
  "pinData": {}
}
