Multi-Input AI Content Summarizer using GPT-4 and OCR Fallback - n8n Workflow

Deploy this robust n8n workflow to summarize content from URLs, raw text, and PDFs. This versatile n8n template uses OpenAI for advanced, customizable AI summarization with language support and OCR fallback.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Content creators and researchers needing automated summarization.

  • Developers requiring an API endpoint for high-quality, multi-source AI summarization.

  • Teams automating document processing and analysis.

  • Users looking for advanced n8n templates incorporating LLMs and external services like OCR.

Overview

This comprehensive n8n workflow solution addresses the complexity of processing diverse content formats (URLs, text, and documents) into clean, concise summaries. It utilizes the power of an n8n workflow combined with cutting-edge AI models (GPT-4.1-mini) to handle web scraping, standard PDF text extraction, and includes an OCR fallback mechanism for image-based PDFs using the OCR.Space API.

This robust n8n template offers deep customization, allowing users to define the summary length (brief, standard, detailed) and the focus area (key points, conclusions, action items). By employing a unified routing mechanism starting from a single n8n trigger, this n8n workflow is ideal for seamless integration into larger applications, streamlining research, content curation, or internal document analysis processes.

How it Works

The unified n8n workflow begins with the Initial Trigger webhook, which acts as the main n8n trigger point, accepting content and user preference parameters (summary length, focus, language).


  1. Input Parsing and Routing: The Parse Input Parameters n8n node extracts all necessary data. The Input Type Switch then routes the execution path based on the input_type parameter (url, text, or file).

  2. Data Acquisition: If a URL is provided, the Fetch URL Content node scrapes the content. If a file URL is provided, the workflow downloads it via HTTP request and attempts Extract From File for PDF text.

  3. Intelligent PDF Handling: The Check If Extracted Text Empty conditional n8n node determines if the PDF extraction was successful. If the text is empty (likely an image-based PDF), the flow automatically uses the Map Language Code n8n node and sends the file binary to the OCR.Space API for reliable text extraction.

  4. AI Processing: All extracted content converges into the Clean & Format Content node. This prepared content is passed to the Generate AI Summary (Unified) LangChain Agent. This crucial n8n node uses a highly customized system prompt, dynamically configured with user preferences extracted by the initial n8n node, powered by the efficient OpenAI GPT-4.1 (Unified) model.

  5. Output: The final, clean markdown summary is formatted by the Structure Final Output node and instantly returned to the calling application via the Return Summary Response webhook, completing this highly functional n8n workflow.

Installation Guide


  1. Importing the n8n workflow: Copy the entire JSON code and import it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. OpenAI Credentials: Locate the OpenAI GPT-4.1 (Unified) n8n node (and the others dedicated nodes) and replace the placeholder 'Dummy OpenAI' credential with your actual OpenAI API key.

  3. OCR Setup (Optional but recommended): If you intend to process image-based PDFs, you must obtain an OCR.Space API key and update the OCR.Space n8n node by replacing 'YOUROCRAPIKEY' in the header parameters with your actual key.

  4. Activation: Ensure the n8n workflow is active. Note the webhook URLs generated for the Initial Trigger and the three dedicated n8n trigger nodes (summarize-url, summarize-text, summarize-file) for integration.

  5. Testing: Test the primary n8n trigger by sending a POST request to the Initial Trigger URL with the required JSON body parameters, ensuring you include the inputtype key.

Node Details

This complex n8n workflow utilizes several powerful nodes:

Initial Trigger (Webhook): The main entry n8n trigger point for the unified workflow. It listens for incoming POST requests containing content source details and summarization parameters.
Parse Input Parameters (Set): A key n8n node that extracts dynamic parameters like url, textcontent, filecontent, summarylength, and focus from the incoming request body or query.
Input Type Switch (Switch): Routes the n8n workflow execution based on the inputtype field, directing traffic to web scraping, raw text processing, or file handling paths.
Fetch URL Content / Fetch PDF File (HTTP Request): These nodes are responsible for retrieving external data, acting as the web scraping n8n node for URLs or downloading files for processing.
Extract From File: An essential n8n node for PDF processing, attempting to extract raw text content from the downloaded file.
Check If Extracted Text Empty (IF): A conditional n8n node that checks the success of PDF text extraction, enabling the fallback path to OCR if necessary.
OCR.Space (HTTP Request): If standard extraction fails, this n8n node uses the OCR API to perform image-to-text conversion on the PDF file binary, relying on a pre-mapped language code.
Generate AI Summary (LangChain Agent): The core intelligence n8n node. It receives the prepared raw content and executes the highly detailed system prompt against the connected LLM.
OpenAI GPT-4.1 (LangChain LLM): The language model n8n node that interfaces with OpenAI, providing the generative AI power (using the gpt-4.1-mini model) to create the customized summaries.
Return Summary Response (Respond to Webhook): The final n8n node that sends the polished, markdown-formatted summary back to the caller.

Related n8n Workflows

Free

Nodes: 11 Nodes
Updated: December 26 2025
View all
Created by

Featured*