Structured Data Extraction & Trend Analysis with Bright Data and Google Gemini

Overview

This workflow demonstrates a powerful pipeline for extracting structured data from any public web page, then analyzing it using Google Gemini's AI models. It uses Bright Data's Web Unlocker to reliably fetch web content (even from complex or anti-scraping sites), converts the raw markdown to clean text, and then performs two types of AI-powered analysis: topic extraction with structured JSON output and trend clustering by location and category. The results are saved to disk and optionally sent to a webhook for further processing.

This is ideal for competitive intelligence, market research, news monitoring, or any scenario where you need to turn unstructured web content into actionable, structured insights.

Workflow Steps

  1. When clicking 'Test workflow' (Manual Trigger) — No auth. This is a manual trigger to start the workflow for testing. In production, you can replace it with a Schedule Trigger or Webhook.

  2. Set URL and Bright Data Zone (Set node) — No auth. This node defines two variables: url (the target webpage, e.g., https://www.bbc.com/news/world) and zone (your Bright Data zone name, e.g., web_unlocker1). Edit these to point to your desired page.

  3. Perform Bright Data Web Request (HTTP Request) — Header Auth (genericCredentialType with httpHeaderAuth). This sends a POST request to Bright Data's API (https://api.brightdata.com/request) with the zone, URL, and format parameters. It fetches the page content as raw markdown. You must configure a Bright Data account and provide your API token as a header credential in n8n.

  4. Markdown to Textual Data Extractor (Basic LLM Chain) — Uses Google Gemini Chat Model for Data Extract (OAuth2 for Google Gemini). This chain takes the raw markdown from Bright Data and instructs the LLM to convert it to clean, plain text (removing links, scripts, CSS). The prompt is: "You are a markdown expert. Analyze the below markdown and convert to textual data..."

  5. Topic Extractor with the structured response (Information Extractor) — Uses Google Gemini Chat Model for Sentiment Analyzer (OAuth2). This node performs topic analysis on the cleaned text. It outputs a structured JSON array with fields: topic, score (0-1), summary, and keywords. The schema is manually defined in the node.

  6. Trends by location and category with the structured response (Information Extractor) — Uses Google Gemini Chat Model (OAuth2). This node performs a second analysis: clustering emerging trends by location and category. It outputs a structured JSON array with fields: location, category, and an array of trends (each with trend, score, summary, mentions).

  7. Initiate a Webhook Notification for Markdown to Textual Data Extraction (HTTP Request) — No auth. Sends the cleaned text to a webhook URL (currently set to https://webhook.site/...). Replace with your own webhook URL if needed.

  8. Initiate a Webhook Notification for AI Sentiment Analyzer (HTTP Request) — No auth. Sends the topic extraction results to the same webhook.

  9. Initiate a Webhook Notification for trends by location and category (HTTP Request) — No auth. Sends the trend clustering results to the same webhook.

  10. Create a binary file for topics (Function node) — No auth. Converts the topic extraction JSON into a binary buffer (base64) for file writing.

  11. Write the topics file to disk (Read/Write File) — No auth. Writes the topics JSON to d:\topics.json (Windows path). Adjust the path for your OS.

  12. Create a binary data for tends (Function node) — No auth. Converts the trend clustering JSON into a binary buffer.

  13. Write the trends file to disk (Read/Write File) — No auth. Writes the trends JSON to d:\trends.json.

Setup Instructions

  1. Bright Data Account: Sign up at brightdata.com. Create a Web Unlocker zone and get your API token. In n8n, create a new Header Auth credential with the token (typically as Authorization: Bearer <token>).
  2. Google Gemini API: Enable the Gemini API in your Google Cloud project. Generate an API key. In n8n, create an OAuth2 credential for Google Gemini (or use API key if supported).
  3. Webhook (optional): If you want to receive notifications, replace the webhook URL with your own (e.g., from webhook.site or a custom endpoint).
  4. File Paths: Update the file paths in the Write nodes to match your system (e.g., /home/user/topics.json on Linux/Mac).
  5. Target URL: Edit the Set URL and Bright Data Zone node to point to the webpage you want to analyze.

Use Cases & Variations

  • Competitive Monitoring: Point the workflow at competitor news pages or product pages to extract pricing, features, or sentiment trends.
  • News Aggregation & Summarization: Replace the manual trigger with a Schedule Trigger (e.g., every hour) to continuously monitor news sites and save structured summaries.
  • Social Media Analysis: Modify the URL to scrape social media profiles or hashtag pages (ensure compliance with terms of service).
  • Custom Analysis: Change the LLM prompts and JSON schemas to extract different information (e.g., product specs, job listings, event details).
  • Output to Database: Instead of writing to disk, connect the output nodes to a database (e.g., PostgreSQL, MongoDB) or a cloud storage service (e.g., Google Sheets, Airtable).
18 nodesmanual triggerData
Sticky NoteChain LlmSetHTTP RequestLm Chat Google GeminiInformation ExtractorFunctionRead Write File

Workflow JSON

{
  "id": "1GOrjyc9mtZCMvCr",
  "meta": {
    "instanceId": "885b4fb4a6a9c2cb5621429a7b972df0d05bb724c20ac7dac7171b62f1c7ef40",
    "templateCredsSetupCompleted": true
  },
  "name": "Structured Data Extract, Data Mining with Bright Data & Google Gemini",
  "tags": [
    {
      "id": "Kujft2FOjmOVQAmJ",
      "name": "Engineering",
      "createdAt": "2025-04-09T01:31:00.558Z",
      "updatedAt": "2025-04-09T01:31:00.558Z"
    },
    {
      "id": "ddPkw7Hg5dZhQu2w",
      "name": "AI",
      "createdAt": "2025-04-13T05:38:08.053Z",
      "updatedAt": "2025-04-13T05:38:08.053Z"
    }
  ],
  "nodes": [
    {
      "id": "1e9038e6-9ebc-4460-bee2-3faea3b38f4c",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        200,
        -420
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "fd4ace46-7261-4380-8b65-1e00bb574f27",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        -780
      ],
      "parameters": {
        "width": 400,
        "height": 300,
        "content": "## Note\n\nThis workflow deals with the structured data extraction by utilizing Bright Data Web Unlocker Product.\n\nThe Basic LLM Chain, Information Extraction, are being used to demonstrate the usage of the N8N AI capabilities.\n\n**Please make sure to set the web URL of your interest within the \"Set URL and Bright Data Zone\" node and update the Webhook Notification URL**"
      },
      "typeVersion": 1
    },
    {
      "id": "1c1dd10f-beb2-4cc7-9118-77efd3172651",
// ... truncated (copy to see full JSON)

How to Import This Workflow

  1. 1Copy the workflow JSON above using the Copy Workflow JSON button.
  2. 2Open your n8n instance and go to Workflows.
  3. 3Click Import from JSON and paste the copied workflow.

Don't have an n8n instance? Start your free trial at n8nautomation.cloud

Related Templates

AI-Powered CV Scanner with Google Sheets & Gemini

Overview This workflow automates the initial screening of job applicants by combining a web form, AI-powered CV analysis, and Google Sheets. When a candidate submits their application (name, email, and CV PDF), the workflow instantly extracts the text from the PDF using Mistral OCR, then sends it to Google Gemini for evaluation against a predefined job description. The AI returns a qualification score (0.0 to 1.0) and a detailed explanation, which are then logged alongside the candidate's details in a Google Sheet. This eliminates manual CV review, speeds up your hiring pipeline, and ensures every applicant is evaluated consistently. Workflow Steps Application Form (Form Trigger) — No auth required. This node presents a custom-branded web form to collect the candidate's Full Name, Email, and CV (PDF upload). The form is styled with a dark, glassmorphism theme and includes animated backgrounds. Once submitted, the workflow triggers automatically. Log Candidate Submission (Google Sheets) — OAuth2. Immediately after form submission, this node appends the candidate's name and email to the 'CVs' Google Sheet. This ensures the application is recorded even if the subsequent analysis steps fail. Extract CV Text (Mistral AI) — API Key auth. This node takes the uploaded PDF file from the form and uses Mistral's OCR API to extract all text content from the CV. It dynamically selects the binary file uploaded in the previous step. AI Qualification (LLM Chain) — This is the core analysis node. It uses a detailed prompt that includes: - A system message defining the AI as a professional, objective hiring assistant. - The full job description for a "Senior Frontend Developer" with core requirements and preferred qualifications. - Clear evaluation logic: candidates missing core requirements cannot score above 0.6; meeting all core requirements yields at least 0.75; preferred qualifications add bonuses up to 1.0. - The extracted CV text as context. - An instruction to output raw JSON only. Gemini 2.5 Flash Lite (Language Model) — API Key auth (Google AI Studio). This node provides the actual AI model (Google Gemini 2.5 Flash Lite) with a temperature of 0.4 for balanced, deterministic outputs. It powers the LLM Chain above. JSON Output Parser (Output Parser) — This node ensures the AI's response is valid JSON with the exact schema: (number) and (string). It prevents malformed responses from breaking downstream nodes. Add CV Analysis (Google Sheets) — OAuth2. After analysis, this node updates the candidate's row in the 'CVs' sheet by matching on the Email column. It writes the and from the AI's output into the corresponding columns. Create 'CVs' Spreadsheet (Google Sheets) — OAuth2. This node runs once when the workflow is first triggered manually. It creates a new Google Sheet named 'CVs' with columns: FullName, Email, QualificationRate, QualificationDescription. Setup Instructions Prerequisites A Google account (for Google Sheets) A Mistral AI account (free tier available) — Get your API key here A Google AI Studio account — Create an API key here Step-by-Step Google Sheets Credentials: In the three Google Sheets nodes, create or select an OAuth2 credential for Google Sheets. Grant access to create and edit spreadsheets. Mistral AI Credential: In the "Extract CV Text" node, create a new credential and paste your Mistral API key. Gemini Credential: In the "Gemini 2.5 Flash Lite" node, create a new credential and paste your Google AI Studio API key. Customize Job Description: Open the "AI Qualification" node and edit the section in the prompt to match your actual job posting. Activate the Workflow: Toggle the workflow to "Active" status. The "Application Form" node will generate a public URL you can share with candidates. Test: Use the "Start Here" manual trigger to initialize the Google Sheet, then submit a test application via the form URL. Use Cases & Variations Custom Job Roles: Replace the Senior Frontend Developer description with any role (e.g., Marketing Manager, Data Scientist, Sales Rep) by editing the prompt in the AI Qualification node. Different Storage: Replace Google Sheets with Airtable, Notion, or a database like PostgreSQL for storing applications and results. Multi-Round Screening: Add a Slack or email notification node to alert the hiring team when a candidate scores above a certain threshold (e.g., >0.8). Interview Scheduling: Connect the output to a Calendly or Google Calendar node to automatically invite high-scoring candidates for an interview. Batch Processing: Modify the trigger to accept a CSV upload of multiple CVs for bulk analysis. Enhanced Analysis: Add more output fields like "years of experience", "top skills", or "red flags" by updating the JSON schema in the Output Parser and the prompt.

18 nodes

Convert Baserow Markdown to HTML via Webhook

This workflow automatically converts markdown content stored in a Baserow table to HTML. It is triggered by a webhook and can process either a single record (specified by a record ID) or all records in the table. After conversion, it updates the original record(s) with the resulting HTML, making it ideal for content management systems, blog posts, or any scenario where markdown needs to be rendered for web use. Step-by-Step Walkthrough Baserow sync video description — Webhook (no auth) This node starts the workflow when an HTTP request is received. It uses a unique path () and expects an optional query parameter to indicate a single record ID. No authentication is configured, so you should secure the webhook with a validation mechanism or by keeping the URL secret. Check if it's 1 record or all records — If (no auth) This conditional node checks whether the incoming request contains a parameter (i.e., a specific record ID). If it exists, the workflow proceeds to fetch and convert a single record; otherwise, it processes all records in the table. Get single record from baserow — Baserow (API Key auth) When a record ID is provided, this node retrieves that specific row from the Baserow table (ID ) in database . The row ID is dynamically set using the expression . Convert markdown to HTML (single) — Markdown (no auth) This node converts the content of the field (which contains markdown) into HTML. Options enabled include emoji support, simple line breaks, and backslash escaping of HTML tags. The output is stored in . Update single record in baserow — Baserow (API Key auth) The generated HTML is written back to the same record. The field ID (which corresponds to the HTML version of the description) is updated with the converted value. Get all records from baserow — Baserow (API Key auth) When no specific record ID is given, this node fetches all rows from the table (). No additional filters are applied. Convert markdown to HTML (all records) — Markdown (no auth) For each record retrieved, this node converts the field to HTML. Options are left at defaults (no emoji/simple line breaks). Update all records in baserow — Baserow (API Key auth) The converted HTML is updated back into every record’s field ID . Note that this updates all records sequentially; the node uses to target each row. (There are also nine error‑handler nodes connected to the webhook, which are not shown in detail but provide error logging or fallback behavior.) Setup Instructions Baserow – You need a Baserow account and an API token. In n8n, create a new Baserow credential (type: Baserow API) and enter your API token. You must also know your database ID () and table ID (). These can be found in the Baserow URL when browsing the table. Webhook – The workflow provides a unique webhook URL (e.g., ). Configure any external system (like a custom app, Zapier, or manual testing) to send a POST request to this URL. Optionally include a query parameter to update only one record. No other external services are required; the markdown conversion is handled natively by n8n. Use Cases and Variations Content Management System – Automatically convert markdown blog posts or descriptions stored in Baserow to HTML for display on a website. Email Campaigns – Convert markdown content to HTML before sending via an email service (you could add an SMTP node after the update). Batch Processing – The “all records” path is perfect for periodic re‑rendering of an entire table, e.g., after changing markdown conversion options. Variation – Instead of a webhook, you could trigger the workflow on a schedule to re‑convert stale records. Replace the webhook with a Schedule Trigger node and add a filter (e.g., only records updated in the last hour). Security – Since the webhook has no authentication, consider adding a Header Auth node or an HMAC validator to prevent unauthorized calls. This workflow is production‑ready, includes error handling, and can be easily adapted for other Baserow tables or different field mappings.

9 nodes

Nextcloud Folder Move with Subfolder Support

Overview This workflow automates the process of moving a folder (including all its files and subfolders) from one location to another within a Nextcloud instance. It is especially useful when dealing with external storage that has rate limits, as it moves each file individually to avoid exceeding those limits. The workflow supports recursive traversal of subfolders, recreates the destination folder structure, and optionally deletes the source folder after the move. How It Works The workflow can be triggered manually, via a webhook, or from another workflow. It first validates the input (source and destination paths), then creates the destination folder if it doesn't exist. It lists all files and folders in the source, loops through them, and for each subfolder it recursively lists its contents. All discovered files are collected and then moved one by one to the correct location in the destination. Finally, the original source folder can be deleted (optional). Node Breakdown When clicking "Execute Workflow" (Manual Trigger) — No auth. Starts the workflow when the user clicks the execute button in the editor. Requires the user to set the source and destination paths in the Set paths node. Webhook (Webhook Trigger, disabled) — No auth. Listens for incoming POST requests at a unique path. Expects a JSON body with and properties. The workflow validates the request and proceeds. Execute Workflow Trigger (disabled) — No auth. Allows another n8n workflow to start this one, passing and as parameters. Whether the request is valid / Whether the request is valid1 (IF) — No auth. Checks that the incoming JSON has the required and fields. If not, it stops with an error. Stop and Error: request not valid / Stop and Error: request not valid1 (Stop & Error) — No auth. Throws an error message if validation fails. Set paths (Set) — No auth. Hardcoded example values for manual trigger: , . Users should edit these. Set folder-paths for from and to (Set) — No auth. Extracts and from the incoming data (manual, webhook, or workflow trigger) and passes them downstream. Create to folder if necessary (Nextcloud) — Nextcloud OAuth2 or Basic Auth. Creates the destination folder if it doesn't already exist. Uses the path from the field. Get all folders/files in from-folder (Nextcloud) — Nextcloud OAuth2 or Basic Auth. Lists all items (files and folders) in the source folder. Loop over files and folders (SplitInBatches) — No auth. Iterates over the list of items, processing them in batches (default batch size 1). Whether type is file (IF) — No auth. Checks if the current item is a file or a folder. Files go to consolidation; folders go to subfolder handling. Set new path for subfolder (Set) — No auth. Constructs the destination path for a subfolder by combining the base destination path with the subfolder name. Create subfolder in to-folder (Nextcloud) — Nextcloud OAuth2 or Basic Auth. Creates the corresponding subfolder in the destination. Get all folders/files in found subfolder (Nextcloud) — Nextcloud OAuth2 or Basic Auth. Lists the contents of the subfolder (recursive step). Consolidate all files and folders found (NoOp) — No auth. Acts as a junction point to collect all discovered files from recursive calls. Whether there is are more files or subfolders found (IF) — No auth. Checks if the loop has finished (no items left). If yes, proceeds to consolidate; otherwise loops back to process more items. Consolidate all found files (Code) — No auth. JavaScript code that gathers all file items from the NoOp node across multiple iterations into a single array. Set new path for file (Code) — No auth. JavaScript code that calculates the new destination path for each file by stripping the source prefix and appending the relative path to the destination. Loop Over all files (SplitInBatches) — No auth. Iterates over the consolidated list of files, moving them one by one. Move file to destination (Nextcloud) — Nextcloud OAuth2 or Basic Auth. Moves a file from its current path to the computed destination path. Delete from-folder (Nextcloud) — Nextcloud OAuth2 or Basic Auth. (Optional) Deletes the original source folder after all files have been moved. The node has error handling set to continue on error. Setup Instructions Nextcloud Credentials: You need a Nextcloud account with read/write access to both the source and destination folders. In n8n, create a Nextcloud credential (OAuth2 or Basic Auth) and apply it to all Nextcloud nodes in the workflow. Configure Triggers: - For manual execution, edit the Set paths node with your actual source and destination folder paths (e.g., , ). - For webhook, enable the Webhook node and copy the generated URL. Send a POST request with a JSON body like . - For workflow trigger, pass and as parameters when calling this workflow from another. Optional: If you want to delete the source folder after the move, leave the Delete from-folder node connected. If not, you can disable or remove it. Run: Activate the workflow and trigger it using your chosen method. Use Cases & Variations Migrating data between Nextcloud instances (if both are accessible via the same credentials). Archiving old projects by moving entire project folders to an archive directory. Organizing shared folders where users upload files into a drop folder and you want to move them to a structured destination. Handling rate-limited external storage (e.g., Google Drive mounted in Nextcloud) by moving files individually instead of a bulk move. Adaptation: Replace the Nextcloud nodes with other file storage services (e.g., ownCloud, S3, Google Drive) by swapping the node types and adjusting paths accordingly.

32 nodes

Ready to automate with n8n?

Get affordable managed n8n hosting with 24/7 support.