πŸ”¬ Generate M&A due diligence reports with OpenAI, LlamaIndex and Pinecone

⚑ 32 views Β· πŸ”¬ Document Extraction & Analysis

Description

M&A Due Diligence Automation with AI

Automatically parse financial documents using LlamaIndex, embed data into Pinecone, and generate AI-driven reports with GPT-5-mini. Reducing manual review from days to minutes.

Why Use This Workflow?

Cuts document review time dramatically, minimizes reliance on expensive analysts for initial extraction, ensures consistent data-backed insights, and scales effortlessly across multiple deals in parallel.

Ideal For

Investment analysts, private equity firms, M&A advisors, and financial professionals who need rapid, standardized preliminary due diligence reports.

How It Works

  1. Trigger β€” A webhook receives due diligence documents (PDF, DOCX, XLSX) with metadata.
  2. Cache Check β€” Pinecone is queried first. If the deal was processed before, parsing is skipped entirely.
  3. Document Parsing β€” New documents are sent to LlamaIndex for structured text extraction.
  4. Vectorization β€” Parsed text is embedded via OpenAI and stored in a Pinecone namespace unique to each deal.
  5. AI Analysis β€” A Langchain Agent (GPT-5-mini) acting as a Senior Investment Analyst queries Pinecone across six key areas (company profile, financials, risks, business model, etc.) and outputs structured JSON.
  6. Report Generation β€” The JSON is converted to HTML, then rendered as a professional PDF via Puppeteer.
  7. Delivery β€” The PDF is uploaded to AWS S3 and a public URL is returned via the webhook.

Setup

Prerequisites

RequirementPurpose
n8n instanceWorkflow execution
LlamaIndex API KeyDocument parsing
OpenAI API KeyEmbeddings + GPT-5-mini agent
Pinecone API KeyVector storage & retrieval
AWS S3 AccountPDF report storage

Steps

  1. Import the JSON workflow into your n8n instance.
  2. Configure credentials for LlamaIndex (HTTP Header Auth), OpenAI, Pinecone, and AWS S3.
  3. Set your S3 bucketName and update baseUrl in the β€œCreate Public URL” node.
  4. Optionally customize the AI persona and queries in the β€œAnalyze” (Langchain Agent) node.
  5. Test by sending sample documents to /webhook/dd-ai.

Customization

Modify the agent prompt to adjust personas or add new queries. Update the output parser’s JSON schema to capture additional fields. For advanced use, integrate with CRMs (Salesforce, HubSpot), virtual data rooms (Datasite), or add Slack/email notifications on report completion.


Created by: Khmuhtadin | Workflows β€’ LinkedIn β€’ Medium Need custom workflows? Contact us

πŸ”— Nodes Used

HTTP Request, Webhook, S3, AI Agent, Embeddings OpenAI, OpenAI Chat Model

πŸ“₯ Import

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

πŸ“– Importing guide Β· πŸ”‘ Credential setup