Local LLM Document Summarization with Ollama and AI Agents - n8n Workflow

Automate document processing (PDF, CSV, XLS) using a powerful n8n workflow. Leverage Ollama and AI Agents for local, private Gemma 3 summaries on sensitive data. Get started with these n8n templates.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Users prioritizing data privacy who need to run powerful LLMs like Gemma locally using Ollama.

  • Data analysts needing automated, context-aware summaries of spreadsheets (CSV, XLS).

  • Professionals who frequently process and summarize large batches of documents (PDFs) with a hands-off n8n workflow.

  • Developers seeking robust n8n templates for advanced AI agent and data extraction pipelines.

Overview

This advanced n8n workflow provides a secure and powerful solution for summarizing diverse document types locally. It leverages the deep integration capabilities of n8n with local LLMs, specifically using Ollama to run high-performance models like Gemma 3. The system is designed to handle multiple file formats—PDFs, spreadsheets (XLS, CSV), and other general documents—routing them through specialized n8n node components for efficient data extraction before feeding the refined content to specialized AI Agents. This comprehensive approach ensures that sensitive data remains on-premises while harnessing the power of large language models for efficient document understanding and summarization, making this one of the most effective n8n templates for local AI processing.

How it Works

This efficient n8n workflow manages the entire document lifecycle from local input to summarized output:


  1. Triggering the Flow: The process starts with the Local File Trigger n8n trigger, configured to constantly monitor a designated local file system path for any new files added. This is the starting point for the automated n8n workflow.

  2. File Reading: Upon file detection, the Read/Write Files from Disk n8n node reads the incoming file content, preparing it for analysis.

  3. Conditional Routing: A highly important Switch n8n node inspects the file’s metadata (like the file extension) and intelligently routes the data to the correct processing path. This is a core part of the n8n logic flow.

  4. Specialized Extraction: If the file is complex (PDF, XLS, or CSV), dedicated n8n nodes (Extract from PDF, Extract from XLS, Extract from CSV) transform the structured or binary data into usable text/JSON payloads suitable for the language model.

  5. AI Agent Processing: The extracted content is then passed to one of three AI Agent n8n node setups. These agents are programmed to perform the core task, defining the reasoning and prompt structure for summarization.

  6. Local LLM Interaction: Each AI Agent communicates with a specific Ollama Chat Model n8n node, which securely executes the LLM task (e.g., running Gemma 3) entirely locally using your existing Ollama environment.

  7. Output Handling: The final summary text generated by the AI Agent is captured and processed by the Convert to File n8n node.

  8. Saving the Summary: The n8n workflow concludes when the Read/Write Files from Disk1 n8n node writes the newly generated summary file back to local storage.

Installation Guide

To deploy this powerful n8n workflow and start using these n8n templates, follow these steps:


  1. Prerequisites: Ensure you have n8n installed (self-hosted via Docker or desktop application) and that you have a functioning Ollama instance running locally, with the desired model (e.g., Gemma 3) pulled.

  2. Import Workflow: Copy the provided JSON code and paste it into the n8n interface using the 'Import Workflow' function.

  3. Set up Ollama Credentials: You will need to configure credentials for the Ollama connection if they are not already set up. Ensure the n8n Ollama nodes are pointing to the correct local endpoint (e.g., http://host.docker.internal:11434 if running n8n in Docker).

  4. Configure Local Paths: Update the paths specified in the Local File Trigger n8n trigger node to point to the directory you wish to monitor for input documents, and update the final Read/Write Files from Disk1 n8n node to define where the summarized outputs should be saved.

  5. Activate: Save the n8n workflow and activate it to begin monitoring the input folder.

Node Details

Local File Trigger: This specialized n8n trigger node is essential for automating the start of the n8n workflow. It constantly polls a directory for changes, ensuring immediate processing of new files.
Read/Write Files from Disk (x2): These generic n8n node tools handle all local file interactions, reading the initial input and securely saving the final LLM-generated summary file.
Switch: A critical flow control n8n node. It dynamically changes the path of the execution based on conditions, ensuring PDF files go to PDF extractors, CSV to CSV extractors, etc.
Extract from PDF / XLS / CSV n8n node (x3): These are specialized data transformation n8n nodes. They efficiently parse the content of complex file formats, extracting text, tables, and data into a clean structure that the AI Agents can digest.
Ollama Chat Model n8n node (x3): This connection n8n node defines the precise LLM model (e.g., Gemma 3) and endpoint used for inference. It acts as the bridge between the n8n workflow logic and the local Ollama service.
AI Agent n8n node (x3): The intelligence layer of the n8n workflow. These agents define the prompts, memory, and tools required to effectively summarize the document content provided by the extraction nodes, utilizing the Ollama service.

Related n8n Workflows

Paid

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

AI & Automation Consultant. Sharing cool stuff on my YouTube Channel

Featured*