{
  "name": "My workflow 12",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "id": "dfb104bf-54d5-4989-b459-f1dbc4a26429",
      "name": "Fetch Essay List",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1000,
        160
      ],
      "typeVersion": 4.2
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "id": "387b4ad8-58f6-41d9-b444-a54228508183",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -840,
        900
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "essay",
              "cssSelector": "table table a",
              "returnValue": "attribute",
              "attribute": "href",
              "returnArray": true
            }
          ]
        },
        "options": {}
      },
      "id": "1ad74ab8-a3c3-443f-a290-f2a1bd58ee10",
      "name": "Extract essay names",
      "type": "n8n-nodes-base.html",
      "position": [
        -840,
        360
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "fieldToSplitOut": "essay",
        "options": {}
      },
      "id": "a2e66ddd-c260-4f36-ac8b-234d0d74636c",
      "name": "Split out into items",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -700,
        160
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "url": "=domain/{{ $json.essay }}",
        "options": {}
      },
      "id": "dceee0bf-da0f-4a6b-9063-5c5b13fb4148",
      "name": "Fetch essay texts",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -500,
        360
      ],
      "typeVersion": 4.2
    },
    {
      "parameters": {
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "title",
              "cssSelector": "title"
            }
          ]
        },
        "options": {}
      },
      "id": "4eda06b4-10aa-4fb7-b034-a0973b10c483",
      "name": "Extract title",
      "type": "n8n-nodes-base.html",
      "position": [
        -280,
        300
      ],
      "typeVersion": 1.2
    },
    {
      "parameters": {
        "operationMode": "documentLoader",
        "options": {}
      },
      "id": "2fbe3f6a-68ac-4114-be27-b5e632da0007",
      "name": "Summarization Chain",
      "type": "@n8n/n8n-nodes-langchain.chainSummarization",
      "position": [
        -640,
        660
      ],
      "typeVersion": 2
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "7b337b47-a1c6-470e-881f-0c038b4917e5",
              "name": "title",
              "type": "string",
              "value": "={{ $json.title }}"
            },
            {
              "id": "ca820521-4fff-4971-84b5-e6e2dbd8bb7a",
              "name": "summary",
              "type": "string",
              "value": "={{ $json.response.text }}"
            },
            {
              "id": "0fd9b5e3-44dd-49a3-82c1-3a4aa4698376",
              "name": "url",
              "type": "string",
              "value": "=http://www.paulgraham.com/{{ $('Limit to first 3').first().json.essay }}"
            }
          ]
        },
        "options": {}
      },
      "id": "d5e37e4b-5e01-4ca1-8edb-1d1c6f0e3cde",
      "name": "Clean up",
      "type": "n8n-nodes-base.set",
      "position": [
        -140,
        760
      ],
      "typeVersion": 3.4
    },
    {
      "parameters": {
        "mode": "combine",
        "combineBy": "combineByPosition",
        "options": {}
      },
      "id": "da70c212-06d1-4937-9650-823049503cce",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        -140,
        500
      ],
      "typeVersion": 3
    },
    {
      "parameters": {
        "jsonMode": "expressionData",
        "jsonData": "={{ $('Extract Text Only').item.json.data }}",
        "options": {}
      },
      "id": "6336afd2-f0d6-4435-bf02-f640f6d1848f",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -500,
        860
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "chunkSize": 6000,
        "options": {}
      },
      "id": "4d7a49aa-f2bf-4b5a-89bc-7e0de4f8b2b2",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        -640,
        1020
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "maxItems": 3
      },
      "id": "9415abfe-c007-4ce9-b009-dabbdb1a550a",
      "name": "Limit to first 3",
      "type": "n8n-nodes-base.limit",
      "position": [
        -500,
        160
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "operation": "extractHtmlContent",
        "extractionValues": {
          "values": [
            {
              "key": "data",
              "cssSelector": "body",
              "skipSelectors": "img,nav"
            }
          ]
        },
        "options": {}
      },
      "id": "2af510ae-50d9-443e-89f9-5d51468981a0",
      "name": "Extract Text Only",
      "type": "n8n-nodes-base.html",
      "position": [
        -840,
        660
      ],
      "typeVersion": 1.2
    }
  ],
  "pinData": {},
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Clean up",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract title": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Essay List": {
      "main": [
        [
          {
            "node": "Extract essay names",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit to first 3": {
      "main": [
        [
          {
            "node": "Fetch essay texts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text Only": {
      "main": [
        [
          {
            "node": "Summarization Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch essay texts": {
      "main": [
        [
          {
            "node": "Extract title",
            "type": "main",
            "index": 0
          },
          {
            "node": "Extract Text Only",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Summarization Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Summarization Chain",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Extract essay names": {
      "main": [
        [
          {
            "node": "Split out into items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarization Chain": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Split out into items": {
      "main": [
        [
          {
            "node": "Limit to first 3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "meta": {
    "instanceId": "48f28243c5653c508be1e0a4d4520d3882574c1e5cc09525f1ddda9b0015b590"
  },
  "tags": []
}