Quick overview
Upload a PDF containing multiple documents, use AI to suggest document groups, and review titles, categories, and page ranges in a guided form. pdfRest creates separate PDFs and a downloadable ZIP with a page manifest, with optional Google Drive filing.
How it works
- Receives a PDF through an n8n upload form and verifies that exactly one valid PDF was provided.
- Uses pdfRest to inspect the PDF, run OCR to create a searchable master copy, and split the master into individual page PDFs.
- Uses pdfRest to convert each page to Markdown, then compiles a full-page inventory while preserving original page numbers and flagging low-text pages.
- Sends the combined extracted text to OpenAI (via the n8n LangChain Information Extractor) to propose contiguous document boundaries with document type, title, counterparty, and evidence-based reasoning.
- Presents editable titles, categories, and start/end page numbers for each proposed document. Reviewers can exclude groups or add up to two additional groups, then approve or cancel.
- Checks that every page belongs to exactly one included group. Invalid ranges receive clear correction messages, with edits preserved across up to three review submissions. Validated groups are sorted by start page, split into separate PDFs, and given descriptive filenames.
- Optionally uploads the split PDFs to Google Drive, then builds a page-to-document manifest, compresses the PDFs and manifest into a ZIP, and returns it as a download.
Setup
- Add a pdfRest API credential and connect it to all pdfRest nodes (PDF info, OCR, split pages, convert to Markdown, and split approved documents).
- Add an OpenAI API credential in the AI model node and select a model available to your account.
- Review and adjust the Settings values (maxPages, maxTextCharacters, and ocrLanguages) to match your expected batch sizes and languages.
- If you enable Google Drive filing (saveToDrive = true), add a Google Drive credential and set outputFolderId to a real destination folder ID.
Requirements
- Requires the pdfRest API Toolkit node, pdfRest and OpenAI or Anthropic credentials, and Google Drive credentials only when optional Drive filing is enabled.