๐Ÿ”ฌ Send PDF document summaries with CoreNexis OCR, GPT-4.1-mini, GPT-4o-mini and Gmail

โšก 84 views ยท ๐Ÿ”ฌ Document Extraction & Analysis

Description

Quick overview

Upload any PDF through a form and this workflow extracts the full text using CoreNexis OCR, generates a structured 5-section summary with GPT-4.1-mini, converts it into a branded HTML email with GPT-4o-mini, and delivers it to your inbox automatically.

How it works

  1. User fills a form with their name, email address, and PDF file upload โ€” no login or account required.
  2. A code step identifies the uploaded PDF binary and extracts user metadata for use throughout the workflow.
  3. The PDF is submitted to the CoreNexis OCR API which extracts all text from the document asynchronously and returns a job ID.
  4. After an initial 4-second wait, the workflow polls the CoreNexis status endpoint. If the job is still processing, it waits 1 minute and polls again. This loop continues automatically until the OCR job reports completed.
  5. Once completed, the extracted text file is downloaded from the CoreNexis output URL.
  6. GPT-4.1-mini reads the full extracted text and writes a structured 5-section Markdown summary: Document Overview, Key Points, Important Numbers and Dates, Action Items, and Executive Summary.

Setup

  1. Get your CoreNexis API key from api.corenexis.com. Open node 3. HTTP โ€” CoreNexis OCR Submit and replace YOUR_CORENEXIS_API_KEY with your actual key.
  2. Open node 6. HTTP โ€” Poll OCR Status and replace YOUR_CORENEXIS_API_KEY again โ€” the same key must appear in both nodes 3 and 6
  3. Open the OpenAI โ€” GPT-4.1-mini Model node and connect your OpenAI API credential.

Requirements

Customization

Additional info

The CoreNexis API key appears in two separate steps โ€” node 3. HTTP โ€” CoreNexis OCR Submit and node 6. HTTP โ€” Poll OCR Status. You must replace YOUR_CORENEXIS_API_KEY in both. Missing either one will cause the workflow to fail.

The OCR polling loop runs automatically until the job status equals completed. For large PDFs this may take several minutes. The workflow handles this without any manual intervention.

If the OCR job returns a failed or unknown status, the workflow stops at node 10. IF โ€” OCR Completed? without sending an email. Check the CoreNexis dashboard for the job error details.

Node 16. Code โ€” Extract HTML includes a built-in fallback โ€” if GPT-4o-mini returns invalid or empty HTML, the workflow automatically generates a plain formatted HTML email from the Markdown summary so the user always receives something.

๐Ÿ”— Nodes Used

HTTP Request, Gmail, AI Agent, OpenAI Chat Model, n8n Form Trigger

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup