{
  "name": "Transform Readwise highlights into weekly content ideas with Gemini AI",
  "nodes": [
    {
      "id": "d658ca25-1a80-4f28-ac28-6b36b60d2ffa",
      "name": "Fetch Articles",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -672,
        -256
      ]
    },
    {
      "id": "e9ab5e55-6500-4ffd-b19f-88921321d0b3",
      "name": "Split Article Results",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -448,
        -256
      ]
    },
    {
      "id": "564a1d51-de71-4d39-badd-bfcb0653c3c8",
      "name": "Fetch Highlights",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        0,
        -256
      ]
    },
    {
      "id": "4105eb45-90d4-4557-9465-3437247199e0",
      "name": "Split Highlights Results",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        224,
        -256
      ]
    },
    {
      "id": "4b4b5b76-8c80-4845-ae40-c053a7ec0635",
      "name": "Merge Articles & Highlights",
      "type": "n8n-nodes-base.code",
      "position": [
        672,
        -256
      ]
    },
    {
      "id": "55c72541-46c7-434b-93a2-f135586045c9",
      "name": "Prepare Prompt",
      "type": "n8n-nodes-base.code",
      "position": [
        896,
        -256
      ]
    },
    {
      "id": "f3691550-22f6-4374-a07f-6652802fa017",
      "name": "Filter Articles >10% Read",
      "type": "n8n-nodes-base.filter",
      "position": [
        -224,
        -256
      ]
    },
    {
      "id": "bfa61775-01fb-4f89-bdb6-ec3df344c643",
      "name": "Find Highlights for Article",
      "type": "n8n-nodes-base.filter",
      "position": [
        448,
        -256
      ]
    },
    {
      "id": "f7a94120-67a5-4301-8e49-df99417a72df",
      "name": "Generate Weekly Insights",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        1120,
        -256
      ]
    },
    {
      "id": "2d6c8414-6c61-4e3b-99b9-1f22f467242d",
      "name": "AI Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        1200,
        -32
      ]
    },
    {
      "id": "51c9c8d4-64ff-4b46-bcea-58247340c540",
      "name": "Convert Insights to HTML",
      "type": "n8n-nodes-base.markdown",
      "position": [
        1472,
        -256
      ]
    },
    {
      "id": "52d42ad7-9c68-4c78-aa47-3c950b6583c4",
      "name": "Format for Readwise Save API",
      "type": "n8n-nodes-base.code",
      "position": [
        1696,
        -256
      ]
    },
    {
      "id": "8f07a901-ea39-415d-99e7-4bce43ba36c7",
      "name": "Save Insights to Readwise",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1920,
        -256
      ]
    },
    {
      "id": "e362501c-ab5a-492d-a94b-679063d9d4f0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        -704
      ],
      "parameters": {
        "width": 272,
        "height": 256,
        "content": "## 📌 START\nThis workflow can be triggered in two ways:\n1. Manually by clicking 'Execute Workflow'.\n2. Automatically on a schedule (default is every Monday at 09:00).\nBoth triggers start the same proce"
      }
    },
    {
      "id": "995257c2-e0ad-42b5-9be7-d86c55630540",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        -704
      ],
      "parameters": {
        "width": 320,
        "height": 256,
        "content": "## 📌 FETCH READWISE DATA\nThese nodes connect to the Readwise API.\n- Fetch Articles: Gets all articles updated in the last 7 days.\n- Fetch Highlights: Gets all highlights updated in the last 7 days.\nEn"
      }
    },
    {
      "id": "b1b348fb-9deb-4d32-8bd7-3b73b793ba3c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -80,
        -704
      ],
      "parameters": {
        "width": 304,
        "height": 256,
        "content": "## 📌 FILTER & MATCH DATA\nHere, we refine the data:\n1. We split the articles and highlights into individual items.\n2. We only keep articles where reading progress is over 10%.\n3. We then find and match"
      }
    },
    {
      "id": "87a101df-925e-4b81-8277-e1b3f681ced0",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        -704
      ],
      "parameters": {
        "width": 384,
        "height": 256,
        "content": "## 📌 PREPARE AI PROMPT\nThis is the 'brain' of the operation.\n- Merge...: This node combines the filtered articles and their highlights into a clean data structure.\n- Prepare Prompt: This node assemble"
      }
    },
    {
      "id": "cac3fd5f-1196-4dd4-82e2-d0e3d4254f5b",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        -704
      ],
      "parameters": {
        "width": 304,
        "height": 256,
        "content": "## 📌 GENERATE AI INSIGHTS\nThe prepared prompt is sent to the AI model connected here.\nThis workflow uses OpenRouter to run Google's Gemini 2.5 Pro model, but you can swap it with any supported LLM (li"
      }
    },
    {
      "id": "fb5fc2ae-d8f6-4f86-b926-ffc090789818",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1536,
        -704
      ],
      "parameters": {
        "width": 432,
        "height": 256,
        "content": "## 📌 SAVE INSIGHTS BACK TO READWISE\nThe final steps:\n1. Convert Insights to HTML: The AI's markdown response is converted into HTML suitable for Readwise.\n2. Format for Readwise...: The HTML is packag"
      }
    },
    {
      "id": "d5f335d3-8610-454d-aa0d-ad27b75ab59a",
      "name": "Monday - 09:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -896,
        -416
      ]
    },
    {
      "id": "0f971879-dc47-477a-9342-f7f102220953",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -896,
        -256
      ]
    }
  ],
  "connections": {
    "AI Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Weekly Insights",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Articles": {
      "main": [
        [
          {
            "node": "Split Article Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Monday - 09:00": {
      "main": [
        [
          {
            "node": "Fetch Articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Prompt": {
      "main": [
        [
          {
            "node": "Generate Weekly Insights",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Highlights": {
      "main": [
        [
          {
            "node": "Split Highlights Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Article Results": {
      "main": [
        [
          {
            "node": "Filter Articles >10% Read",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Insights to HTML": {
      "main": [
        [
          {
            "node": "Format for Readwise Save API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Weekly Insights": {
      "main": [
        [
          {
            "node": "Convert Insights to HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Highlights Results": {
      "main": [
        [
          {
            "node": "Find Highlights for Article",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Articles >10% Read": {
      "main": [
        [
          {
            "node": "Fetch Highlights",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Highlights for Article": {
      "main": [
        [
          {
            "node": "Merge Articles & Highlights",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Articles & Highlights": {
      "main": [
        [
          {
            "node": "Prepare Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format for Readwise Save API": {
      "main": [
        [
          {
            "node": "Save Insights to Readwise",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Fetch Articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}