{
  "name": "AI Research Digest",
  "nodes": [
    {
      "id": "cbd3f425-563f-406d-9cb6-cd2b71e3bfac",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.3,
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            }
          ]
        }
      }
    },
    {
      "id": "d8ae75a6-d4a6-4f64-a208-c67a6a5a3c5d",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        208,
        0
      ],
      "parameters": {
        "url": "https://hn.algolia.com/api/v1/search?tags=front_page&hitsPerPage=10",
        "options": {}
      }
    },
    {
      "id": "66eb62f2-6f01-470c-bba0-68e9ca852762",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        416,
        0
      ],
      "parameters": {
        "jsCode": "const hits = $input.first().json.hits;\nreturn hits.map(hit => ({\n    json: {\n        title: hit.title,\n        url: hit.url,\n        points: hit.points,\n        objectID: hit.objectID\n    }\n}));"
      }
    },
    {
      "id": "cf8d56ec-d7b7-41ad-8278-170944bd8e78",
      "name": "Summarization Chain",
      "type": "@n8n/n8n-nodes-langchain.chainSummarization",
      "typeVersion": 2.1,
      "position": [
        624,
        0
      ],
      "parameters": {
        "options": {
          "summarizationMethodAndPrompts": {
            "values": {
              "combineMapPrompt": "You are a tech news analyst. Here is a Hacker News story:\n\n\"{text}\"\n\nWrite ONE sentence (max 25 words) explaining what this story is about and why it matters. Be direct and informative.\n\nONE-SENTENCE SUMMARY:",
              "prompt": "You are a tech news analyst. Here is a Hacker News story:\n\n\"{text}\"\n\nWrite ONE sentence (max 25 words) explaining what this story is about and why it matters. Be direct and informative.\n\nONE-SENTENCE SUMMARY:"
            }
          }
        }
      }
    },
    {
      "id": "ddc90eeb-1a65-4484-bab7-dcc96c467732",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        560,
        208
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini"
        },
        "builtInTools": {},
        "options": {}
      }
    },
    {
      "id": "82a9638b-5b01-4e7b-b7fe-7b78415dfe81",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        976,
        0
      ],
      "parameters": {
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "output.text"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "27a675c5-6690-46ba-9b11-9ddee1c22849",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        1184,
        0
      ],
      "parameters": {
        "promptType": "define",
        "text": "=You are an AI newsletter editor. Below are one-sentence summaries of today's top 10 Hacker News stories:\n\n{{ $json.text.join('\\n\\n') }}\n\nFormat this as a clean, engaging daily tech digest email. Start with a 2-sentence intro for the date {{ $now.toFormat('MMMM d, yyyy') }}, then list each story as a numbered bullet. End with a friendly sign-off. Keep the tone informative and developer-friendly.",
        "options": {}
      }
    },
    {
      "id": "d6ba8e2d-2c06-48fb-b460-2a7f93c4ddff",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        1056,
        208
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini"
        },
        "builtInTools": {},
        "options": {}
      }
    },
    {
      "id": "b19a664b-0be1-4177-b0bf-5eed1356e333",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        1200,
        208
      ],
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "hn-digest"
      }
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Summarization Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Summarization Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Summarization Chain": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate"
  },
  "staticData": null
}