Skip to main content

Automate vehicle insurance claim approvals with OpenAI, OCR and PDF API Hub

Workflow preview

Workflow preview
100%
Automate vehicle insurance claim approvals with OpenAI, OCR and PDF API Hub preview
Open on n8n.io

1. Workflow Overview

This workflow automates the full lifecycle of a vehicle insurance claim — from an incoming Gmail email to a signed, watermarked PDF decision letter delivered back to the claimant. It monitors Gmail...

Best for

  • Document Extraction automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.gmailtrigger, n8n-nodes-pdf-api-hub.pdfsplitmerge, n8n-nodes-base.code, n8n-nodes-base.googlesheets, n8n-nodes-base.switch, n8n-nodes-base.googledrive, n8n-nodes-base.gmail

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Rishabh Dugar.

Original n8n.io source

1.1 Workflow description

Title
Automate vehicle insurance claim approvals with OpenAI, OCR and PDF API Hub
Workflow name
Automate vehicle insurance claim approvals with OpenAI, OCR and PDF API Hub

This workflow automates the full lifecycle of a vehicle insurance claim — from an incoming Gmail email to a signed, watermarked PDF decision letter delivered back to the claimant.

It monitors Gmail for emails with a PDF claim attachment, deduplicates them against a Google Sheet, parses the claim PDF using PDF API Hub's OCR, evaluates the claim with OpenAI GPT-4o-mini (or a built-in mock evaluator for testing), and routes it to one of three paths:

  • Approved — generates a signed approval letter, stamps it APPROVED, uploads to Google Drive, and emails the claimant
  • Rejected — generates a rejection letter, stamps it REJECTED, uploads to Google Drive, and emails the claimant
  • Manual Review — notifies your claims adjuster by email for human review

Every claim is logged and tracked in a Google Sheet.

What you need

  • Gmail OAuth2 — to monitor the claims inbox and send decision emails
  • Google Sheets OAuth2 — for claim logging and duplicate detection
  • Google Drive OAuth2 — to store processed claim PDFs
  • OpenAI API key — only required when ai_mode is set to openai
  • PDF API Hub API key — get one free at pdfapihub.com (30 free API calls)

Setup

Google Sheets

Create a Google Sheet with a tab named Claims and add these headers in row 1:

claim_id | claimant_name | claimant_email | claim_type | decision | approved_amount | reasoning | risk_flags | summary | processed_at | email_message_id

A sample sheet you can clone is linked in the Sticky Note — Overview node inside the workflow.

After creating the sheet, open every Google Sheets node in the workflow and point it to your sheet and tab.

Google Drive

Create two folders in your Drive: Approved Claims and Rejected Claims. Set each folder in the corresponding Upload node.

Workflow Config node

Edit the Workflow Config Set node to configure:

Field Description
self_email Your email — receives duplicate-claim alerts
claims_adjuster_email Email for manual review notifications
ai_mode mock for testing, openai for production
mock_decision APPROVED, REJECTED, or MANUAL_REVIEW (mock mode only)
company_name Used in generated PDF letters
support_phone Used in generated PDF letters
appeals_email Used in generated PDF letters

How it works

  1. New Claim Uploaded — Gmail trigger polls every minute for emails with subject containing "insurance claim" and a PDF attachment
  2. Check Duplicate in Sheet — looks up the Gmail message ID in the tracking sheet to skip already-processed emails
  3. Extract Claim Data — sends the PDF to PDF API Hub's Parse PDF node and returns the full claim text as JSON
  4. AI Mode Router — routes to OpenAI or Mock evaluator based on ai_mode config
  5. AI Claim Evaluator / Mock AI Evaluator — produces a structured decision with decision, reasoning, approved_amount, risk_flags, and claimant details
  6. Parse AI Decision — extracts the structured JSON from the AI response
  7. Log Claim to Sheet — appends the claim record to Google Sheets
  8. Route by Decision — branches into Approved, Rejected, or Manual Review paths
  9. PDF generation — HTML-to-PDF nodes generate branded decision letters using PDF API Hub
  10. Sign + Watermark — approval letters are digitally signed and stamped APPROVED or REJECTED
  11. Upload + Email — PDFs are uploaded to Drive and the decision is emailed to the claimant

Customisation tips

  • Edit the AI system prompt in the AI Claim Evaluator node to match your own underwriting rules and risk thresholds
  • Switch mock_decision in Workflow Config between APPROVED, REJECTED, and MANUAL_REVIEW to test all three paths without making any API calls
  • Edit the HTML inside the letter-generation nodes to match your company branding
  • Adjust the >$50,000 → MANUAL_REVIEW threshold directly in the AI prompt

PDF API Hub nodes used

  • Parse PDF — extracts claim text from the uploaded PDF attachment
  • HTML to PDF ×2 — generates the approval and rejection letter PDFs
  • Sign PDF — adds an authorised digital signature to the approval letter
  • Add Watermark ×2 — stamps APPROVED (green) or REJECTED (red) across the letter

A note on quality

This is not an AI-generated template. AI was used as a coding assistant for certain pieces, but every path and every input has been manually validated end-to-end — including sending a real claim email, receiving the decision email back, verifying the signed and watermarked PDF was uploaded to the correct Google Drive folder, and confirming the Google Sheet was updated with the claim record. Both the OpenAI path and mock mode were tested manually across all three decision outcomes: APPROVED, REJECTED, and MANUAL_REVIEW.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note - Approved Path

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note - Rejected Path

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - New Claim Uploaded

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1

Block 4 - Extract Claim Data

Type / Role
n8n-nodes-pdf-api-hub.pdfSplitMerge - pdfSplitMerge
Config choices
Version 1

Block 5 - Parse AI Decision

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Log Claim to Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4

Block 7 - Route by Decision

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3

Block 8 - Generate Approval Letter

Type / Role
n8n-nodes-pdf-api-hub.pdfSplitMerge - pdfSplitMerge
Config choices
Version 1

Block 9 - Sign Approval Letter

Type / Role
n8n-nodes-pdf-api-hub.pdfSplitMerge - pdfSplitMerge
Config choices
Version 1

Block 10 - Add APPROVED Stamp

Type / Role
n8n-nodes-pdf-api-hub.pdfSplitMerge - pdfSplitMerge
Config choices
Version 1

Block 11 - Upload Approved Claim

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 12 - Email Approval

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 13 - Generate Rejection Letter

Type / Role
n8n-nodes-pdf-api-hub.pdfSplitMerge - pdfSplitMerge
Config choices
Version 1

Block 14 - Add REJECTED Stamp

Type / Role
n8n-nodes-pdf-api-hub.pdfSplitMerge - pdfSplitMerge
Config choices
Version 1

Block 15 - Upload Rejected Claim

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 16 - Email Rejection

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 17 - Notify Claims Adjuster

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 18 - Update Sheet - Approved

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 19 - Update Sheet - Rejected

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 20 - Mock AI Evaluator

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 21 - AI Mode Router

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3

Block 22 - Workflow Config

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 23 - Check Duplicate in Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4

Block 24 - Notify - Already Processed

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Showing the first 24 of 37 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Automate vehicle insurance claim approvals with OpenAI, OCR and PDF API Hub
Complexity advanced
Nodes 37
Categories Document Extraction, AI Summarization
Author Rishabh Dugar
Published 22 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15232/15232.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automate vehicle insurance claim approvals with OpenAI, OCR and PDF API Hub do?

This workflow automates the full lifecycle of a vehicle insurance claim — from an incoming Gmail email to a signed, watermarked PDF decision letter delivered back to the claimant. It monitors Gmail...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, AI Summarization use case.