AI-Powered Agent for Discovering and Logging Reports - n8n Workflow

Automate web scraping using n8n and an AI agent. This n8n workflow analyzes publication pages, extracts direct download links for the latest reports, and logs results to Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Market Researchers needing automatic discovery of competitive intelligence and downloadable reports.
Data Analysts who want to continuously monitor industry publications for new studies.
Users looking for advanced examples of combining AI (LLMs) with web extraction tasks in an n8n workflow.
n8n automation specialists seeking robust, reusable n8n templates for complex data processing.

Overview

Manually checking numerous publication websites daily for the newest downloadable research reports or white papers is incredibly time-consuming. This sophisticated n8n workflow solves this inefficiency by deploying a specialized AI Report Discovery Agent.

The automation starts by reading a list of target source URLs from a Google Sheet. It uses an n8n node to fetch the webpage content and converts it into a clean Markdown format suitable for precise AI analysis. The core of this n8n automation is the Language Model (LLM) Agent, which is carefully prompted to filter, prioritize (by recency), and extract the direct download link and metadata for the most relevant report found on the page.

Crucially, this n8n template includes custom validation logic to ensure the extracted link is a valid, absolute URL and not a generic navigation link. Results are automatically categorized and logged into dedicated Google Sheets (one for discovered reports and another for logging pages where no report was found). This provides a reliable, scalable, and fully auditable report discovery system built entirely within n8n.

How it Works

The process flow of this complex n8n workflow operates in five main phases, ensuring thorough discovery and logging:


  1. Trigger and Source Input: The n8n workflow can be initiated manually, via a daily scheduled n8n trigger, or called as a subroutine from another process. The Read Active Sources n8n node fetches the list of target publication URLs from the configured "Report Sources" Google Sheet.

  2. Looping and Fetching: The Loop Over Sources n8n node splits the list into individual items, allowing the n8n node chain to process each URL sequentially. The Fetch Publication Page n8n node then performs an HTTP request to retrieve the target webpage HTML.

  3. AI Preprocessing: The raw, often noisy, HTML is fed into the Convert HTML to Markdown n8n node, simplifying the structure and improving the quality of the input data for the LLM.

  4. AI Extraction: The AI Report Discovery Agent connects to an LLM (like GPT-5.1) using an n8n node and a Structured Output Parser. This agent strictly analyzes the Markdown content to identify the most recent report link and extracts structured JSON metadata (Title, Link, File Type, Description), based on highly specific instructions within the system prompt.

  5. Validation and Logging: The Validate & Normalize Output n8n code node inspects the AI's JSON output for validity, checking that the link is absolute and that a report was truly found. A subsequent Valid Report Found? n8n node routes the data: successful discoveries are saved to the "Discovered Reports" Google Sheet, while failures or pages where no report was found are logged to the "Discovery Log" sheet, providing comprehensive audit records for this n8n workflow.

Installation Guide

To implement this powerful n8n workflow, follow these steps:


  1. Import the n8n template: Copy the provided JSON code and import it directly into your n8n instance.

  2. Set up Google Sheets Credentials: Navigate to the Read Active Sources, Save Discovered Report, and Log No Report Found n8n nodes. Click the Credentials field and securely connect your Google Sheets account.

  3. Configure Spreadsheets: Ensure your target Google Sheet is ready. Update the documentId parameter in all Google Sheets n8n nodes to point to your specific spreadsheet ID. You must set the sheet names for "Report Sources", "Discovered Reports", and "Discovery Log".

  4. Configure AI Credentials: Open the OpenAI GPT-5.1 n8n node and provide your OpenAI API key credentials.

  5. Prepare Input Sheet: Create a sheet named "Report Sources" in your linked spreadsheet with required columns like SourceURL and SourceName. Populate this sheet with the URLs you wish the n8n workflow to monitor.

  6. Activate: Choose your preferred n8n trigger method (Manual or Schedule) and activate the n8n workflow to begin running the discovery agent.

Node Details

This n8n workflow leverages several specialized n8n node types to achieve robust automation:

Schedule (Daily) / Manual Trigger: Provides the starting n8n trigger point for the automation, allowing both immediate testing and reliable daily scheduled execution.
Google Sheets (Read Active Sources): This n8n node reads the list of target website URLs from the "Report Sources" sheet, initializing the data payload for the entire n8n workflow.
Split In Batches (Loop Over Sources): An essential flow control n8n node that iterates over each source URL independently, enabling sequential processing and allowing individual error handling per source.
HTTP Request (Fetch Publication Page): Fetches the raw HTML content of the target URL. It includes configuration for custom headers (like a User-Agent) to enhance scraping reliability within the n8n node.
Markdown (Convert HTML to Markdown): This n8n node cleans and structures the raw HTML into a digestible Markdown format, which significantly improves the comprehension and accuracy of the subsequent AI processing.
AI Report Discovery Agent (Langchain Agent): The central intelligence n8n node. It utilizes a highly structured system prompt to analyze the page content and execute the core report discovery logic, enforcing strict JSON output adherence.
OpenAI GPT-5.1 (Langchain LLM): Provides the underlying large language model powering the agent. It is configured with a low temperature (0.1) for consistent, deterministic extraction behavior, ideal for this n8n template.
Code (Validate & Normalize Output): A custom JavaScript n8n node performing crucial post-extraction validation. It verifies link integrity, checks the title validity, and sets the final status and isValid flags used for result routing.
IF (Valid Report Found?): This logical n8n node routes the workflow execution based on the isValid flag generated by the Code node, ensuring data is directed either to the success sheet or the audit log.
Google Sheets (Save Discovered Report / Log No Report Found): These final n8n nodes write the extracted metadata or the failure logs to their respective destination sheets, completing the audit trail of the n8n workflow.

Related n8n Workflows

Free

Nodes: 14 Nodes
Updated: December 26 2025
View all
Created by

n8n Expert with deep experience in designing and implementing automation workflows that optimize business processes, reduce manual effort, and improve scalability. Skilled in integrating n8n with diverse platforms, APIs, and enterprise systems to deliver end-to-end automation solutions. With 13+ years of background in web development (PHP & JavaScript), I bring strong technical expertise to create custom, reliable, and efficient workflows.

Featured*