Dynamic PDF Summarization and Tracking via Llama AI - n8n Workflow

Automate scraping websites for new PDFs, extracting content, generating executive summaries using AI (Llama via OpenRouter), and tracking processing status in Google Sheets with this n8n workflow.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

• Financial analysts and researchers who need to monitor company reports and filings.
• Automation specialists looking for advanced n8n templates combining web scraping, AI, and structured data management.
• Users seeking to build custom knowledge base or news aggregation services using an n8n workflow.
• Developers needing an example of using the OpenRouter n8n node for large language models.

Overview

Keeping track of new company reports or regulatory filings published on various websites can be a massive manual effort. This advanced n8n workflow provides a fully automated solution. It systematically scrapes a target website for new PDF links, downloads the files, and uses a powerful Large Language Model (specifically Llama 4 Maverick via the OpenRouter n8n node) to generate concise, investor-focused executive summaries.

By leveraging Google Sheets for tracking, the n8n workflow ensures that no document is processed twice. This automation saves significant time, provides immediate insights via Discord, and demonstrates the power of combining web scraping and AI within a single, reliable n8n template.

How it Works

This comprehensive n8n workflow utilizes multiple steps for automated processing.


  1. Initiation: The flow is triggered either manually or automatically using the Schedule Trigger n8n trigger (set weekly in this template).

  2. Scraping and Discovery: An HTTP Request n8n node fetches the target website's content. The subsequent HTML n8n node extracts all links ending in .pdf (PDF links) from the HTML source.

  3. URL Management: A Code n8n node normalizes the relative links into absolute URLs. Simultaneously, the Get row(s) in sheet n8n node fetches previously tracked URLs from Google Sheets. These lists are combined and processed by Merge and Append or update row in sheet to ensure only new, unique URLs proceed.

  4. Content Extraction: For each new URL, an HTTP Request1 n8n node downloads the file. The Extract from File n8n node then converts the binary PDF into raw text content.

  5. AI Summarization: The text is fed into the AI Agent n8n node. This agent uses the OpenRouter Chat Model (Llama) and Simple Memory to follow a predefined prompt, generating an executive summary focusing on key actions and financial impacts.

  6. Notification: A secondary Code n8n node is used to split the lengthy AI summary into smaller chunks (max 1900 characters) suitable for posting. The final summary is delivered via the Discord n8n node.

  7. Tracking Completion: The n8n workflow concludes by setting the enviado_discord flag to true using Edit Fields1 and updating the corresponding row in Google Sheets via the Update row in sheet n8n node, confirming successful completion.

Installation Guide

To implement this n8n workflow, follow these steps:


  1. Import: Copy the provided JSON data and import it into your n8n instance as a new workflow.

  2. Credentials Setup:

Google Sheets: You must connect to the Google Cloud API and enable both Drive and Sheets services. Create a new Google Sheet to track the PDFs and establish credentials in your n8n instance.
OpenRouter: Register on OpenRouter to obtain an API key. Configure a new OpenRouter credential in n8n for use with the OpenRouter Chat Model n8n node.
Discord: Create a webhook integration in your target Discord channel/server. Provide this webhook URL to the Discord n8n node.

  1. Configuration:

Update the HTTP Request n8n node with the URL of the website you wish to scrape.
Review and configure the base URL within the initial Code n8n node if the extracted PDF links are relative (currently set to https://www.playway.com).
Customize the prompt within the AI Agent n8n node to tailor the executive summary to your specific analytical needs.

  1. Activation: Ensure the n8n workflow is active, and test the flow using the manual trigger.

Node Details

Schedule Trigger / Manual Trigger (n8n trigger): Defines the start of the n8n workflow, allowing for scheduled weekly execution or immediate manual runs.
HTTP Request (Scraper): Downloads the raw HTML content of the target website. Key configuration: Requires the target URL input.
HTML (n8n node): Extracts PDF links using the CSS selector a[href$=".pdf"] and returns them as an array of attributes (href).
Code (Listar los pdfs): A crucial custom script that iterates through the extracted links and constructs absolute URLs by prepending a defined base URL. This transforms the input for subsequent download steps.
Google Sheets (Get row(s), Append or update row, Update row): Used extensively for persistence. It checks for previously processed URLs, tracks new discoveries, and marks records as enviado_discord: true upon successful summarization.
HTTP Request1 (Downloader): Downloads the actual PDF file content based on the URL provided by the previous n8n node. Key configuration: Response format is set to file.
Extract from File (n8n node): Reads the downloaded PDF file data and extracts all contained text.
OpenRouter Chat Model (n8n node): Connects to the LLM (Llama 4 Maverick is pre-selected) via the OpenRouter API to provide the language processing capabilities for the AI Agent.
AI Agent (n8n node): Orchestrates the summarization process using the extracted text and the specified Llama model, adhering to a detailed executive summary prompt.
Code (Filtro caracteres max): Splits the large AI output text into smaller, Discord-compliant message sizes (chunks of 1900 characters).


  • Discord (n8n node): Publishes the final executive summary chunks to a designated channel via webhook.

Related n8n Workflows

Free

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

Técnico en automatización y robótica, compartiré todo tipo de automatizaciones con la comunidad hispanohablante a través de youtube.

Featured*