πŸ“Š Monitor regulatory updates with ScrapeGraphAI and send alerts via Telegram

⚑ 23 views Β· πŸ“Š Market Research & Insights

πŸ’‘ 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

Breaking News Aggregator with Telegram and Redis

⚠️ COMMUNITY TEMPLATE DISCLAIMER: This is a community-contributed template that uses ScrapeGraphAI (a community node). Please ensure you have the ScrapeGraphAI community node installed in your n8n instance before using this template.

This workflow monitors selected government websites, regulatory bodies, and legal-news portals for new or amended regulations relevant to specific industries. It scrapes the latest headlines, compares them against previously recorded items in Redis, and pushes real-time compliance alerts to a Telegram channel or chat.

Pre-conditions/Requirements

Prerequisites

Required Credentials

Redis Setup Requirements

Key NameDescriptionExample
latestRegIdsRedis Set used to store hashes/IDs of the most recent regulatory articles processedlatestRegIds

> Hint: Use a dedicated Redis DB (e.g., DB 1) to keep workflow data isolated from other applications.

How it works

This workflow monitors selected government websites, regulatory bodies, and legal-news portals for new or amended regulations relevant to specific industries. It scrapes the latest headlines, compares them against previously recorded items in Redis, and pushes real-time compliance alerts to a Telegram channel or chat.

Key Steps:

Set up steps

Setup Time: 10-15 minutes

  1. Install community nodes: In n8n, go to Settings β†’ Community Nodes and install n8n-nodes-scrapegraphai.
  2. Create credentials:
    a. Telegram β†’ Credentials β†’ Telegram API β†’ paste your bot token.
    b. Redis β†’ Credentials β†’ Redis β†’ fill host, port, password, DB.
    c. ScrapeGraphAI β†’ Credentials β†’ ScrapeGraphAI API β†’ enter your key.
  3. Configure the β€œDefine Sources” Code node: Replace the placeholder URLs with the regulatory pages you need to monitor.
  4. Update Telegram chat ID: Open any chat with your bot and use https://api.telegram.org/bot<token>/getUpdates to find the chat.id. Insert this value in the Telegram node.
  5. Adjust frequency: Replace the Manual Trigger with a Cron node (e.g., daily 06:00 UTC).
  6. Test the workflow: Execute once manually; confirm messages appear in Telegram and that Redis keys are created.
  7. Activate: Enable the workflow so it runs automatically according to your schedule.

Node Descriptions

Core Workflow Nodes:

Data Flow:

  1. Manual Trigger β†’ Code (Define Sources) β†’ SplitInBatches β†’ ScrapeGraphAI
  2. ScrapeGraphAI β†’ Merge β†’ If (Check Redis)
  3. If (true) β†’ Set β†’ Telegram β†’ Redis

Customization Examples

Change industries or keywords

// Code node snippet
return [
  {
    url: "https://regulator.gov/energy-updates",
    industry: "Energy",
    keywords: ["renewable", "grid", "tariff"]
  },
  {
    url: "https://financewatch.gov/financial-rules",
    industry: "Finance",
    keywords: ["AML", "KYC", "cryptocurrency"]
  }
];

Modify Telegram message formatting

// Set node β€œParameters β†’ Value”
items[0].json.message = `πŸ›‘οΈ *${$json.industry} Regulation Update*\n\n*${$json.title}*\n${$json.date}\n${$json.url}`;
return items;

Data Output Format

The workflow outputs structured JSON data:

{
  "title": "EU Proposes New ESG Disclosure Rules",
  "date": "2024-04-18",
  "url": "https://europa.eu/legal/eu-proposes-esg-disclosure",
  "industry": "Finance"
}

Troubleshooting

Common Issues

  1. Empty scraped data – Verify CSS selectors/XPath in the ScrapeGraphAI node; website structure may have changed.
  2. Duplicate alerts – Ensure Redis credentials point to the same DB across nodes; otherwise IDs are not shared.

Performance Tips

Pro Tips:

πŸ”— Nodes Used

Redis, Telegram

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup