{
  "name": "Summarize content from URLs, text & PDFs using OpenAI",
  "nodes": [
    {
      "id": "41fb7559-5588-4af7-a843-69f3a6ced08e",
      "name": "Initial Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1344,
        1040
      ]
    },
    {
      "id": "bb2f4efb-accc-4e3d-9a1e-6fc4a8175a8f",
      "name": "Input Type Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -944,
        1024
      ]
    },
    {
      "id": "b38cc7cd-66f7-4d86-8de3-d3088679092c",
      "name": "Fetch URL Content",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -288,
        960
      ]
    },
    {
      "id": "9455fbe7-a019-4f5d-8fe7-90f4e4aa19a2",
      "name": "Fetch PDF File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -608,
        1296
      ]
    },
    {
      "id": "fc9e62a8-1eb2-4ba3-8a6e-9f49e9de1693",
      "name": "Extract From File",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -464,
        1296
      ]
    },
    {
      "id": "0b01f016-3673-4401-83f5-aa2e31d2b80b",
      "name": "Check If Extracted Text Empty",
      "type": "n8n-nodes-base.if",
      "position": [
        -320,
        1296
      ]
    },
    {
      "id": "2c5321a0-4040-4ce1-8719-71098eb1f946",
      "name": "Map Language Code",
      "type": "n8n-nodes-base.function",
      "position": [
        16,
        1344
      ]
    },
    {
      "id": "7727da47-5782-4887-9397-2dbd8c1b8e0e",
      "name": "OCR.Space",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        176,
        1344
      ]
    },
    {
      "id": "71c47757-c891-4e29-b10e-55503c634bd6",
      "name": "summarize-url",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1328,
        1664
      ]
    },
    {
      "id": "fb8c898f-a11b-4d10-a6ab-777e80cdf802",
      "name": "summarize-text",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1312,
        2192
      ]
    },
    {
      "id": "5e56e512-7e58-4074-b984-7ea13ae48013",
      "name": "summarize-file",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -1312,
        2800
      ]
    },
    {
      "id": "3652a5dd-7273-42a7-a953-baadc53cde25",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1824,
        2800
      ],
      "parameters": {
        "width": 400,
        "height": 96,
        "content": "# Summarize a PDF file"
      }
    },
    {
      "id": "445ffe95-2006-4e44-82e9-912c6bd7cb4c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1824,
        2224
      ],
      "parameters": {
        "width": 384,
        "height": 80,
        "content": "# Summarize text"
      }
    },
    {
      "id": "62fe1311-19dd-4307-b740-b8534461f93e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1808,
        1680
      ],
      "parameters": {
        "width": 384,
        "height": 80,
        "content": "# Summarize URL"
      }
    },
    {
      "id": "b59d5d2d-4610-4f46-ac77-156ff8bf93f6",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1824,
        1024
      ],
      "parameters": {
        "width": 400,
        "height": 80,
        "content": "# Summarize All in One"
      }
    },
    {
      "id": "063a6c64-8fa5-4a3e-9695-44c2ea5cd894",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2752,
        1008
      ],
      "parameters": {
        "width": 608,
        "height": 1008,
        "content": "# AI Content Summarizer Suite\n\nThis n8n template collection demonstrates how to build a comprehensive AI-powered content summarization system that handles multiple input types: URLs, raw text, and PDF"
      }
    },
    {
      "id": "598ed657-da21-44c1-bd1f-1b4a2739636f",
      "name": "Parse Input Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        -1120,
        1040
      ]
    },
    {
      "id": "8125ba61-90c6-4b36-baf3-94683db88ce8",
      "name": "Generate AI Summary (Unified)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        672,
        1040
      ]
    },
    {
      "id": "0b02b948-24c2-495b-bef7-99901fdd50b6",
      "name": "OpenAI GPT-4.1 (Unified)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        752,
        1264
      ]
    },
    {
      "id": "0da9c053-faaf-4b2c-b089-30d23daab44f",
      "name": "Clean & Format Content",
      "type": "n8n-nodes-base.set",
      "position": [
        448,
        1040
      ]
    },
    {
      "id": "4992bf8e-fb2a-4ef6-b7cc-c6943a256993",
      "name": "Structure Final Output",
      "type": "n8n-nodes-base.set",
      "position": [
        1024,
        1040
      ]
    },
    {
      "id": "dfd24b35-f6ee-4471-93d9-a1f202a85cce",
      "name": "Return Summary Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1248,
        1040
      ]
    },
    {
      "id": "9d6d737e-4fe9-4fd4-a8d6-15b566de57f3",
      "name": "Extract URL Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        -1104,
        1664
      ]
    },
    {
      "id": "7852e220-e77c-4b4a-a74b-110e0c733364",
      "name": "Scrape Web Page Content",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -880,
        1664
      ]
    },
    {
      "id": "3f933b84-8a3f-441b-8a17-412c63563d2d",
      "name": "Clean Scraped Content",
      "type": "n8n-nodes-base.set",
      "position": [
        -656,
        1664
      ]
    },
    {
      "id": "282c6c04-0ba1-47b8-a900-1c3416440710",
      "name": "Summarize URL Content",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -432,
        1664
      ]
    },
    {
      "id": "dcf23318-5a25-43d9-9ccd-a896cc89798e",
      "name": "OpenAI GPT-4.1 (URL)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -368,
        1888
      ]
    },
    {
      "id": "98fa70c1-9594-4d83-bb91-52148d80a450",
      "name": "Format URL Summary",
      "type": "n8n-nodes-base.set",
      "position": [
        -80,
        1664
      ]
    },
    {
      "id": "0d20d017-d4bd-48c4-b931-e30d5ecde720",
      "name": "Return URL Summary",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        144,
        1664
      ]
    },
    {
      "id": "2f0e7464-f607-4333-b34a-398ad045cf25",
      "name": "Extract Text Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        -1088,
        2192
      ]
    },
    {
      "id": "ec5daf86-5837-4489-b967-ca01fd53259b",
      "name": "Process Raw Text Input",
      "type": "n8n-nodes-base.set",
      "position": [
        -864,
        2192
      ]
    },
    {
      "id": "4bb0543c-9611-47fa-9e88-46ab3a5e46d4",
      "name": "Summarize Text Input",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -640,
        2192
      ]
    },
    {
      "id": "144b8cd0-318a-4cd8-9d4c-e3416e59338f",
      "name": "OpenAI GPT-4.1 (Text)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -640,
        2400
      ]
    },
    {
      "id": "2072b47a-130d-417f-8bdf-77ee04f0c39b",
      "name": "Format Text Summary",
      "type": "n8n-nodes-base.set",
      "position": [
        -288,
        2192
      ]
    },
    {
      "id": "9024a142-c034-428e-92b6-3de102474dac",
      "name": "Return Text Summary",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -64,
        2192
      ]
    },
    {
      "id": "37c4c9a2-04e6-49e1-a763-86a9cb5f19d2",
      "name": "Extract File Parameters",
      "type": "n8n-nodes-base.set",
      "position": [
        -1088,
        2800
      ]
    },
    {
      "id": "6ebe835e-2ef9-45ae-b984-bb21a873ab24",
      "name": "Download PDF File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -864,
        2800
      ]
    },
    {
      "id": "49568f41-51f7-4006-84e6-e154ca1e35d4",
      "name": "Extract Text from PDF",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -640,
        2800
      ]
    },
    {
      "id": "db8f0fb5-f524-4489-8bb8-70677bbaa03b",
      "name": "Check PDF Text Extraction",
      "type": "n8n-nodes-base.if",
      "position": [
        -416,
        2800
      ]
    },
    {
      "id": "714729b2-4a02-4685-b7db-4b0346928940",
      "name": "Map OCR Language Code",
      "type": "n8n-nodes-base.function",
      "position": [
        -192,
        2624
      ]
    },
    {
      "id": "ffd527f9-3c97-4eef-9693-be431f79187c",
      "name": "OCR Fallback Processing",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -32,
        2624
      ]
    },
    {
      "id": "d0ebcb03-9151-4217-8ede-dfcf5d47ff22",
      "name": "Process Extracted Text",
      "type": "n8n-nodes-base.set",
      "position": [
        160,
        2816
      ]
    },
    {
      "id": "0818caf5-6479-4776-bd9f-d73962a09e29",
      "name": "Summarize PDF Content",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        480,
        2800
      ]
    },
    {
      "id": "7120dedb-ac90-4aa3-9f3c-ba65aeb698ff",
      "name": "OpenAI GPT-4.1 (PDF)",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        560,
        3024
      ]
    },
    {
      "id": "c3463333-53ed-4a1e-9f57-363a8723409b",
      "name": "Format PDF Summary",
      "type": "n8n-nodes-base.set",
      "position": [
        832,
        2800
      ]
    },
    {
      "id": "6b02e945-6b55-4648-b3b3-7cde2d6d6724",
      "name": "Return PDF Summary",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1056,
        2800
      ]
    },
    {
      "id": "a0bfcac9-cfd6-4822-b8a7-5bc0b50b1483",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2752,
        2048
      ],
      "parameters": {
        "width": 528,
        "height": 80,
        "content": "## Important\n- PDF file must be publicly accesible."
      }
    }
  ],
  "connections": {
    "OCR.Space": {
      "main": [
        [
          {
            "node": "Clean & Format Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "summarize-url": {
      "main": [
        [
          {
            "node": "Extract URL Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch PDF File": {
      "main": [
        [
          {
            "node": "Extract From File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "summarize-file": {
      "main": [
        [
          {
            "node": "Extract File Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "summarize-text": {
      "main": [
        [
          {
            "node": "Extract Text Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Initial Trigger": {
      "main": [
        [
          {
            "node": "Parse Input Parameters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download PDF File": {
      "main": [
        [
          {
            "node": "Extract Text from PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract From File": {
      "main": [
        [
          {
            "node": "Check If Extracted Text Empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch URL Content": {
      "main": [
        [
          {
            "node": "Clean & Format Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Input Type Switch": {
      "main": [
        [
          {
            "node": "Fetch URL Content",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Clean & Format Content",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Fetch PDF File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map Language Code": {
      "main": [
        [
          {
            "node": "OCR.Space",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format PDF Summary": {
      "main": [
        [
          {
            "node": "Return PDF Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format URL Summary": {
      "main": [
        [
          {
            "node": "Return URL Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Text Summary": {
      "main": [
        [
          {
            "node": "Return Text Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-4.1 (PDF)": {
      "ai_languageModel": [
        [
          {
            "node": "Summarize PDF Content",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-4.1 (URL)": {
      "ai_languageModel": [
        [
          {
            "node": "Summarize URL Content",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Text Input": {
      "main": [
        [
          {
            "node": "Format Text Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Scraped Content": {
      "main": [
        [
          {
            "node": "Summarize URL Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text from PDF": {
      "main": [
        [
          {
            "node": "Check PDF Text Extraction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Map OCR Language Code": {
      "main": [
        [
          {
            "node": "OCR Fallback Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-4.1 (Text)": {
      "ai_languageModel": [
        [
          {
            "node": "Summarize Text Input",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Summarize PDF Content": {
      "main": [
        [
          {
            "node": "Format PDF Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize URL Content": {
      "main": [
        [
          {
            "node": "Format URL Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean & Format Content": {
      "main": [
        [
          {
            "node": "Generate AI Summary (Unified)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract URL Parameters": {
      "main": [
        [
          {
            "node": "Scrape Web Page Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Input Parameters": {
      "main": [
        [
          {
            "node": "Input Type Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Extracted Text": {
      "main": [
        [
          {
            "node": "Summarize PDF Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Raw Text Input": {
      "main": [
        [
          {
            "node": "Summarize Text Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structure Final Output": {
      "main": [
        [
          {
            "node": "Return Summary Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract File Parameters": {
      "main": [
        [
          {
            "node": "Download PDF File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text Parameters": {
      "main": [
        [
          {
            "node": "Process Raw Text Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OCR Fallback Processing": {
      "main": [
        [
          {
            "node": "Process Extracted Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Web Page Content": {
      "main": [
        [
          {
            "node": "Clean Scraped Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI GPT-4.1 (Unified)": {
      "ai_languageModel": [
        [
          {
            "node": "Generate AI Summary (Unified)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Check PDF Text Extraction": {
      "main": [
        [
          {
            "node": "Map OCR Language Code",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Process Extracted Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Extracted Text Empty": {
      "main": [
        [
          {
            "node": "Map Language Code",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Clean & Format Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate AI Summary (Unified)": {
      "main": [
        [
          {
            "node": "Structure Final Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}