AutomationMart
Home/Browse/Segment PDFs by table of contents with Gemini AI and Chunkr.ai
n8n

Segment PDFs by table of contents with Gemini AI and Chunkr.ai

n8nn8n26 modulesv1.0
Google DriveGemini

Intelligently Segment PDFs by Table of Contents This workflow empowers you to automatically process PDF documents, intelligently identify or generate a hierarchical Table of Contents (ToC), and then segment the entire document's content based on these ToC headings. It effectively breaks down a large PDF into its constituent sections, each paired with its corresponding heading and hierarchical level. Why It's Useful Unlock the true structure of your PDFs for granular access and advanced processin

At a glance

Segment PDFs by table of contents with Gemini AI and Chunkr.ai is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Google Drive, Gemini. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
Google Drive, Gemini
Modules
26
Price
Free
Version
v1.0
Segment PDFs by table of contents with Gemini AI and Chunkr.ai workflow diagram

About this workflow

Intelligently Segment PDFs by Table of Contents This workflow empowers you to automatically process PDF documents, intelligently identify or generate a hierarchical Table of Contents (ToC), and then segment the entire document's content based on these ToC headings. It effectively breaks down a large PDF into its constituent sections, each paired with its corresponding heading and hierarchical level. Why It's Useful Unlock the true structure of your PDFs for granular access and advanced processing: AI Agent Tool: A key use case is to provide this workflow as a tool to an AI agent. The agent can then use the segmented output to "read" and navigate to specific sections of a document to answer questions, extract information, or perform tasks with much greater accuracy and efficiency. Targeted Content Extraction: Programmatically pull out specific chapters or subsections for focused analysis, summarization, reporting, or repurposing content. Enhanced RAG Systems: Improve your Retrieval Augmented Generation (RAG) pipelines by feeding them well-defined, contextually relevant document sections instead of entire, monolithic PDFs. This leads to more precise AI-generated responses. Modular Document Processing: Process different parts of a document using distinct logic in subsequent n8n workflows by acting on individual sections. Data Preparation: Seamlessly convert lengthy PDFs into a structured format where each section (including its heading, level, and content in multiple formats) becomes a distinct, manageable item. How It Works 1. Ingestion & Advanced Parsing: The workflow ingests a PDF (via a provided URL or a pre-set one for manual runs). It then utilizes Chunkr.ai to perform Optical Character Recognition (OCR) and parse the document into detailed structural elements, extracting text, HTML, and Markdown for each segment. 2. AI-Powered Table of Contents Generation: A Google Gemini AI model analyzes the initial pages of the document (where a ToC often resides) along with section headers extracted by Chunkr as a fallback. This allows it to construct an accurate, hierarchical Table of Contents in a structured JSON format, even if the PDF lacks an explicit ToC or if it's poorly formatted. 3. Precise Content Segmentation: Sophisticated custom code then meticulously maps the AI-generated ToC headings to their corresponding content within the parsed document from Chunkr. It intelligently determines the precise start and end of each section. 4. Structured & Flexible Output: The primary output provides each identified section as an individual n8n item. Each item includes the heading text, its hierarchical level (e.g., 1, 1.1, 2), and the full content of that section in Text, HTML, and Markdown formats. Optionally, the workflow can also reconstruct the entire document into a single, navigable HTML file or a clean Markdown file. What You Need To run this workflow, you'll need: Input PDF: When triggered by another workflow: A URL pointing to the PDF document. When triggered manually: The workflow uses a pre-configured sample PDF from Google Drive for demonstration (this can be customized). Chunkr.ai API Key: Required for the initial parsing and OCR of the PDF document. You'll need to insert this into the relevant HTTP Request nodes. Google Gemini API Credentials: Necessary for the AI model to intelligently generate the Table of Contents. This should be configured in the Google Gemini Chat Model nodes. Outputs The workflow primarily generates: Individual Document Sections: A series of n8n items. Each item represents a distinct section of the PDF and contains: heading: The text of the section heading. headingLevel: The hierarchical level of the heading (e.g., 1 for H1, 2 for H2). sectionText: The plain text content of the section. sectionHTML: The HTML content of the section. sectionMarkdown: The Markdown content of the section. Alternatively, you can configure the workflow to output: Full Reconstructed Document: A single HTML file representing the entire processed document. A single Markdown file representing the entire processed document. This workflow is ideal for anyone looking to deconstruct PDFs into meaningful, manageable parts for advanced automation, AI integration, or detailed content analysis.

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Create Word and PDF documents with Plumsail from Cognito Forms data

Automate the generation of documents in your company: create DOCX and PDF files from a template using Plumsail Documents. The scenario is started when a form is submitted in Cognito Forms. Files will be saved in OneDrive. This works equally well with SharePoint, Dropbox, Google Drive, and other storage platforms. You can use it to create applications, orders, invoices, etc.

Free

Create ClickUp tasks from new Google Drive uploads and send a Slack message

Every time a new file is added to your Google Drive, Make will automatically create a new task in a ClickUp list of your choice and upload the file to Slack.

Free

Clone and change your voice 🤖🎙️with Elevenlabs and Telegram

This workflow creates a voice AI assistant accessible via Telegram that leverages ElevenLabs powerful voice synthesis technology. Users can either clone their own voice or transform their voice using pre-existing voice models, all through simple voice messages sent to a Telegram bot. ONLY FOR STARTER, CREATOR, PRO PLAN This workflow allows users to: 1. Clone their voice by sending a voice message to a Telegram bot (creates a new voice pro

Free

Save new Gmail attachments to Google Drive

Automatically save incoming Gmail attachments in your Google Drive!

Free

Automated PDF invoice processing & approval flow using OpenAI and Google Sheets

Who is this for? This workflow is ideal for: Finance teams that need to process incoming invoices faster with minimal errors Small to mid-sized businesses that want to automate invoice intake, review, and storage Operations managers who require approval workflows and centralized record-keeping What problem is this workflow solving? Manually processing invoices is time-consuming, error-prone, and often lacks structure. This workflow solves those challenges by:

Free

Connect Dux-Soup Turbo to Google Sheets - complex integration

When a webhook is received from Dux-Soup Turbo, the data are stored in corresponding sheet in Google Sheet. To have this scenario working, first, clone [this](https://docs.google.com/spreadsheets/d/1GdN-pVCww7YBu2dUv6kZV-75wzw2-JegsGvlv9Jvgic/edit#gid=1219114999/copy) scenario into your Google Drive.

Free

Monitor GitHub Actions budget and send usage alerts to Slack

Quick Overview This workflow runs daily to track GitHub Actions usage across selected repositories, combines recent workflow-run stats with GitHub Actions billing data, calculates budget burn rate and projected spend, and posts a summary to Slack with an additional alert when usage exceeds a defined threshold. How it works 1. Runs on a daily schedule. 2. Reads configuration values (repo owner, repo list, budget minutes, cost per minute, and Slack channel) and expands the comma-separated r

Free

Tesla quant technical indicators webhooks tool

This workflow serves as the central Alpha Vantage API fetcher for Tesla trading indicators, delivering cleaned 20-point JSON outputs for three timeframes: 15min, 1hour, and 1day. It is required by the following agents: Tesla 15min, 1h, 1d Indicators Tools Tesla Financial Market Data Analyst Tool ✅ Requires an Alpha Vantage Premium API Key 🚀 Used as a sub-agent via webhook endpoints triggered by other workflows --- 📈 What It Does For each timeframe (15min, 1h, 1d), this tool: 1. Triggers 6 te

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free