🔬 Generate AI-powered investment due diligence PDF reports with OpenAI, LlamaParse and Decodo

⚡ 173 views · 🔬 Document Extraction & Analysis

💡 Pro Tip — HTTP Request scraping tends to break when sites update their markup. If you’re scraping a major platform, check if ScraperNode covers it — it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.

View All Scrapers

Description

Turn pitch decks into investment-grade PDFs. This workflow parses raw investment memorandums and financial decks with LlamaParse, enriches them with real-time web intelligence from Decodo, and has an AI Agent synthesize structured financial analysis, risk assessments, and investment theses into a professional Due Diligence report.

M&A Decodo Home

Last updated: September 2026.

Why Use This Workflow?

Ideal For

How It Works

  1. Trigger: A webhook receives document uploads (PDF, DOCX, PPTX) via a custom portal or API.
  2. Data Collection: LlamaParse converts complex document layouts into clean Markdown, preserving tables and financial structures.
  3. Processing: The workflow generates a unique “Deal ID” based on filenames to ensure data isolation and implements a caching layer via Pinecone to avoid redundant parsing.
  4. Intelligence Layer:
    • Web Enrichment: The workflow derives the target company name and uses Decodo to scrape official websites for “About” and “Commercial Risk” data.
    • Multi-Query RAG: An OpenAI-powered agent executes six specific retrieval queries (Financials, Risks, Business Model, etc.) to gather evidence from all sources.
  5. Output & Delivery: Analysis is mapped to a structured template, rendered into a professional HTML report, and converted to a high-quality PDF using Puppeteer.
  6. Storage & Logging: The final report is uploaded to Cloudflare R2, and a public, secure URL is returned to the user instantly.

Setup Guide

Prerequisites

RequirementTypePurpose
n8n instanceEssentialCore automation and workflow orchestration
LlamaIndex CloudEssentialHigh-accuracy document parsing (LlamaParse)
PineconeEssentialVector database for document and web evidence storage
OpenAI APIEssentialLLM for embeddings and expert analysis (Embedding Small & GPT-5.2)
Decodo APIEssentialReal-time web searching and markdown scraping
R2 BucketEssentialSecure storage for the generated PDF reports

Installation Steps

  1. Import the JSON file to your n8n instance.
  2. Configure credentials:
    • OpenAI: Add your API key for embeddings and the Chat Model.
    • Pinecone: Enter your API Key and Index name (default: poc).
    • LlamaIndex: Add your API key under Header Auth (Authorization: Bearer YOUR_KEY).
    • Decodo: Set up your Decodo API credentials for web search and scraping.
    • AWS S3: Configure your bucket name and access keys.
  3. Update environment-specific values:
    • In the “Build Public Report URL” node, update the baseUrl to match your S3 bucket’s public endpoint or CDN.
  4. Test execution:
    • Send a POST request to the webhook URL with a binary file (e.g., a Pitch Deck) to verify the end-to-end generation.

Technical Details

Core Nodes

NodePurposeKey Configuration
LlamaParse (HTTP)Document ConversionUses the /parsing/upload and /job/result endpoints for high-fidelity markdown
Pinecone Vector StoreContext StorageImplements namespace-based isolation using the unique dealId
Decodo Search/ScrapeWeb IntelligenceDynamically identifies the official domain and extracts corporate metadata
AI AgentStrategic AnalysisConfigured with a “Senior Investment Analyst” system prompt and 6-step retrieval logic
PuppeteerPDF GenerationRenders the styled HTML report into a print-ready A4 PDF

Workflow Logic

The workflow uses a Multi-Query Retrieval strategy. Instead of one generic question, the AI Agent runs six distinct searches against the vector database (Revenue History, Key Risks, etc.). Even a 100-page document cannot hide critical financial tables or risk disclosures buried in the text.

Customization Options

Basic Adjustments

Advanced Enhancements

Troubleshooting

ProblemCauseSolution
Parsing TimeoutFile is too large for synchronous processingIncrease the “Wait” node duration or check LlamaParse job limits
Low Analysis QualityInsufficient context in documentsEnsure documents are text-based PDFs (not scans) or enable OCR in LlamaParse
PDF Layout BrokenCSS incompatibility in PuppeteerSimplify CSS in the HTML node; avoid complex Flexbox/Grid if Puppeteer version is older

Use Case Examples

Scenario 1: Venture Capital Deal Screening

Challenge: A VC associate receives 20 pitch decks a day and spends hours manually summarizing company profiles.

Solution: This workflow parses the deck and web-scrapes the startup’s site to verify claims.

Result: The associate receives a 3-page PDF summary for every deck, allowing them to reject or move forward in seconds.

Scenario 2: Private Equity Due Diligence

Challenge: Analyzing a 150-page CIM (Information Memorandum) for specific financial “red flags.”

Solution: The AI Agent is programmed to specifically hunt for customer concentration and margin fluctuations.

Result: Consistent risk identification across all deals, regardless of which analyst is assigned to the project.


Quick Answers

What documents can it read?
PDF, DOCX, and PPTX uploads via webhook, parsed by LlamaParse into clean Markdown.
Where does the finished PDF go?
Cloudflare R2. You instantly get back a public, secure URL.
How is each deal kept separate?
A unique Deal ID plus Pinecone namespaces isolate every deal’s data.

Made by: khmuhtadin Category: Business Intelligence | Tags: Decodo, AI, RAG, Due Diligence, LlamaIndex, Pinecone

Need custom workflows? Contact me

Connect with the creator: Portfolio • Store • LinkedIn • Medium • Threads

Additional info

Built with n8n. Need an assessment on your business? Feel free to reach out at https://khmuhtadin.com/consultation/

đź”— 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