Skip to main content

Legal Case Research Extractor, Data Miner with Bright Data MCP & Google Gemini

Workflow preview

Workflow preview
100%
Legal Case Research Extractor, Data Miner with Bright Data MCP & Google Gemini preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Notice Community nodes can only be installed on self hosted instances of n8n. Who this is for The Legal Case Research Extractor is a powerful autom...

Best for

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

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.stickynote, n8n-nodes-mcp.mcpclient, n8n-nodes-base.function, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.splitinbatches

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Legal Case Research Extractor, Data Miner with Bright Data MCP & Google Gemini
Workflow name
Legal Case Research Extractor, Data Miner with Bright Data MCP & Google Gemini

Notice

Community nodes can only be installed on self-hosted instances of n8n.

Who this is for

The Legal Case Research Extractor is a powerful automated workflow designed for legal tech teams, researchers, law firms, and data scientists focused on transforming unstructured legal case data into actionable, structured insights.

This workflow is tailored for:

  • Legal Researchers automating case law data mining

  • Litigation Support Teams handling large volumes of case records

  • LawTech Startups building AI-powered legal research assistants

  • Compliance Analysts extracting case-specific insights

  • AI Developers working on legal NLP, summarization, and search engines

What problem is this workflow solving?

Legal case data is often locked in semi-structured or raw HTML formats, scattered across jurisdiction-specific websites. Manually extracting and processing this data is tedious and inefficient.

This workflow automates:

  • Extraction of legal case data via Bright Data's powerful MCP infrastructure

  • Parsing of HTML into clean, readable text using Google Gemini LLM

  • Structuring and delivering the output through webhook and file storage

What this workflow does

Input

  • Set the Legal Case Research URL node is responsible for setting the legal case URL for the data extraction.

Bright Data MCP Data Extractor

  • Bright Data MCP Client For Legal Case Research node is responsible for the legal case extraction via the Bright Data MCP tool - scrape_as_html

Case Extractor

  • Google Gemini based Case Extractor is responsible for producing a paginated list of cases

Loop through Legal Case URLs

  • Receives a collection of legal case links to process

  • Each URL represents a different case from a target legal website

Bright Data MCP Scraping

  • Utilizes Bright Data’s scrape_as_html MCP mode

  • Retrieves raw HTML content of each legal case

Google Gemini LLM Extraction

  • Transforms raw HTML into clean, structured text

  • Performs additional information extraction if required (e.g., case summary, court, jurisdiction etc.)

Webhook Notification

  • Sends extracted legal case content to a configurable webhook URL

  • Enables downstream processing or storage in legal databases

Binary Conversion & File Persistence

  • Converts the structured text to binary format

  • Saves the final response to disk for archival or further processing

Pre-conditions

  1. Knowledge of Model Context Protocol (MCP) is highly essential. Please read this blog post - model-context-protocol
  2. You need to have the Bright Data account and do the necessary setup as mentioned in the Setup section below.
  3. You need to have the Google Gemini API Key. Visit Google AI Studio
  4. You need to install the Bright Data MCP Server @brightdata/mcp
  5. You need to install the n8n-nodes-mcp

Setup

  1. Please make sure to setup n8n locally with MCP Servers by navigating to n8n-nodes-mcp
  2. Please make sure to install the Bright Data MCP Server @brightdata/mcp on your local machine.
  3. Sign up at Bright Data.
  4. Create a Web Unlocker proxy zone called mcp_unlocker on Bright Data control panel.
  5. Navigate to Proxies & Scraping and create a new Web Unlocker zone by selecting Web Unlocker API under Scraping Solutions.
  6. In n8n, configure the Google Gemini(PaLM) Api account with the Google Gemini API key (or access through Vertex AI or proxy).
  7. In n8n, configure the credentials to connect with MCP Client (STDIO) account with the Bright Data MCP Server as shown below.

Make sure to copy the Bright Data API_TOKEN within the Environments textbox above as API_TOKEN=<your-token>

How to customize this workflow to your needs

Target New Legal Portals

  • Modify the legal case input URLs to scrape from different state or federal case databases

Customize LLM Extraction

  • Modify the prompt to extract specific fields: case number, plaintiff, case summary, outcome, legal precedents etc.

  • Add a summarization step if needed

Enhance Loop Handling

  • Integrate with a Google Sheet or API to dynamically fetch case URLs

  • Add error handling logic to skip failed cases and log them

Improve Security & Compliance

  • Redact sensitive information before sending via webhook

  • Store processed case data in encrypted cloud storage

Output Formats

  • Save as PDF, JSON, or Markdown

  • Enable output to cloud storage (S3, Google Drive) or legal document management systems

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 - When clicking ‘Test workflow’

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

Block 2 - Sticky Note

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

Block 3 - List all tools for Bright Data

Type / Role
n8n-nodes-mcp.mcpClient - mcpClient
Config choices
Version 1

Block 4 - Create a binary data for LinkedIn company info extract

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

Block 5 - Sticky Note2

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

Block 6 - Set the Legal Case Research URL

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

Block 7 - Bright Data MCP Client For Legal Case Research

Type / Role
n8n-nodes-mcp.mcpClient - mcpClient
Config choices
Version 1

Block 8 - Case Extractor

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.6

Block 9 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 10 - Loop Over Items

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

Block 11 - Bright Data MCP Client For Legal Case Research Within Loop

Type / Role
n8n-nodes-mcp.mcpClient - mcpClient
Config choices
Version 1

Block 12 - HTML to Textual Data Extract Within Loop

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.6

Block 13 - Webhook Notification for HTML to Textual Data Extract Within the Loop

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 14 - Write the case content to disk

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

Block 15 - Google Gemini Chat Model For Case Data Extract

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 16 - Code to output the collection of cases

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

Block 17 - Google Gemini Chat Model for HTML to Textual Data Extract Within the Loop

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 18 - Sticky Note1

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

Block 19 - Sticky Note4

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

Block 20 - Sticky Note5

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

Block 21 - Sticky Note3

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

Block 22 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

3. Summary Table

Workflow Legal Case Research Extractor, Data Miner with Bright Data MCP & Google Gemini
Complexity advanced
Nodes 22
Categories Document Extraction, AI Summarization
Author Ranjan Dailata
Published 24 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4354/4354.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 Legal Case Research Extractor, Data Miner with Bright Data MCP & Google Gemini do?

Notice Community nodes can only be installed on self hosted instances of n8n. Who this is for The Legal Case Research Extractor is a powerful autom...

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.