Skip to main content

Healthcare policy monitoring with ScrapeGraphAI, Pipedrive and Matrix alerts

Workflow preview

Workflow preview
100%
Healthcare policy monitoring with ScrapeGraphAI, Pipedrive and Matrix alerts preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Medical Research Tracker with Matrix and Pipedrive ️ COMMUNITY TEMPLATE DISCLAIMER: This is a community contributed template that uses ScrapeGraphAI (a community node). Please ensure you have the ...

Best for

  • Market Research automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger, n8n-nodes-base.code, n8n-nodes-base.splitinbatches, n8n-nodes-scrapegraphai.scrapegraphai, n8n-nodes-base.merge, n8n-nodes-base.if, n8n-nodes-base.set

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by vinci-king-01.

Original n8n.io source

1.1 Workflow description

Title
Healthcare policy monitoring with ScrapeGraphAI, Pipedrive and Matrix alerts
Workflow name
Healthcare policy monitoring with ScrapeGraphAI, Pipedrive and Matrix alerts

Medical Research Tracker with Matrix and Pipedrive

⚠️ 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 automatically monitors selected government and healthcare-policy websites, extracts newly published or updated policy documents, logs them as deals in a Pipedrive pipeline, and announces critical changes in a Matrix room. It gives healthcare administrators and policy analysts a near real-time view of policy developments without manual web checks.

Pre-conditions/Requirements

Prerequisites

  • n8n instance (self-hosted or n8n cloud)
  • ScrapeGraphAI community node installed
  • Active Pipedrive account with at least one pipeline
  • Matrix account & accessible room for notifications
  • Basic knowledge of n8n credential setup

Required Credentials

  • ScrapeGraphAI API Key – Enables the scraping engine
  • Pipedrive OAuth2 / API Token – Creates & updates deals
  • Matrix Credentials – Homeserver URL, user, access token (or password)

Specific Setup Requirements

Variable Description Example
POLICY_SITES Comma-separated list of URLs to scrape https://health.gov/policies,https://who.int/proposals
PD_PIPELINE_ID Pipedrive pipeline where deals are created 5
PD_STAGE_ID_ALERT Stage ID for “Review Needed” 17
MATRIX_ROOM_ID Room to send alerts (incl. leading !) !policy:matrix.org

Edit the initial Set node to provide these values before running.

How it works

This workflow automatically monitors selected government and healthcare-policy websites, extracts newly published or updated policy documents, logs them as deals in a Pipedrive pipeline, and announces critical changes in a Matrix room. It gives healthcare administrators and policy analysts a near real-time view of policy developments without manual web checks.

Key Steps:

  • Scheduled Trigger: Runs every 6 hours (configurable) to start the monitoring cycle.
  • Code (URL List Builder): Generates an array from POLICY_SITES for downstream batching.
  • SplitInBatches: Iterates through each policy URL individually.
  • ScrapeGraphAI: Scrapes page titles, publication dates, and summary paragraphs.
  • If (New vs Existing): Compares scraped hash with last run; continues only for fresh content.
  • Merge (Aggregate Results): Collects all “new” policies into a single payload.
  • Set (Deal Formatter): Maps scraped data to Pipedrive deal fields.
  • Pipedrive Node: Creates or updates a deal per policy item.
  • Matrix Node: Posts a formatted alert message in the specified Matrix room.

Set up steps

Setup Time: 15-20 minutes

  1. Install Community Node
    – In n8n, go to Settings → Community Nodes → Install and search for ScrapeGraphAI.

  2. Add Credentials
    Create New credentials for ScrapeGraphAI, Pipedrive, and Matrix under Credentials.

  3. Configure Environment Variables
    – Open the Set (Initial Config) node and replace placeholders (POLICY_SITES, PD_PIPELINE_ID, etc.) with your values.

  4. Review Schedule
    – Double-click the Schedule Trigger node to adjust the interval if needed.

  5. Activate Workflow
    – Click Activate. The workflow will run at the next scheduled interval.

  6. Verify Outputs
    – Check Pipedrive for new deals and the Matrix room for alert messages after the first run.

Node Descriptions

Core Workflow Nodes:

  • stickyNote – Provides an at-a-glance description of the workflow logic directly on the canvas.
  • scheduleTrigger – Fires the workflow periodically (default 6 hours).
  • code (URL List Builder) – Splits the POLICY_SITES variable into an array.
  • splitInBatches – Ensures each URL is processed individually to avoid timeouts.
  • scrapegraphAi – Parses HTML and extracts policy metadata using XPath/CSS selectors.
  • if (New vs Existing) – Uses hashing to ignore unchanged pages.
  • merge – Combines all new items so they can be processed in bulk.
  • set (Deal Formatter) – Maps scraped fields to Pipedrive deal properties.
  • matrix – Sends formatted messages to a Matrix room for team visibility.
  • pipedrive – Creates or updates deals representing each policy update.

Data Flow:

  1. scheduleTriggercodesplitInBatchesscrapegraphAiifmergesetpipedrivematrix

Customization Examples

1. Add another data field (e.g., policy author)

// Inside ScrapeGraphAI node → Selectors
{
  "title": "//h1/text()",
  "date": "//time/@datetime",
  "summary": "//p[1]/text()",
  "author": "//span[@class='author']/text()"   // new line
}

2. Switch notifications from Matrix to Email

// Replace Matrix node with “Send Email”
{
  "to": "[email protected]",
  "subject": "New Healthcare Policy Detected: {{$json.title}}",
  "text": "Summary:\n{{$json.summary}}\n\nRead more at {{$json.url}}"
}

Data Output Format

The workflow outputs structured JSON data for each new policy article:

{
  "title": "Affordable Care Expansion Act – 2024",
  "url": "https://health.gov/policies/acea-2024",
  "date": "2024-06-14T09:00:00Z",
  "summary": "Proposes expansion of coverage to rural areas...",
  "source": "health.gov",
  "hash": "2d6f1c8e3b..."
}

Troubleshooting

Common Issues

  1. ScrapeGraphAI returns empty objects
    – Verify selectors match the current HTML structure; inspect the site with developer tools and update the node configuration.

  2. Duplicate deals appear in Pipedrive
    – Ensure the “Find or Create” option is enabled in the Pipedrive node, using the page hash or url as a unique key.

Performance Tips

  • Limit POLICY_SITES to under 50 URLs per run to avoid hitting rate limits.
  • Increase Schedule Trigger interval if you notice ScrapeGraphAI rate-limiting.

Pro Tips:

  • Store historical scraped data in a database node for long-term audit trails.
  • Use the n8n Workflow Executions page to replay failed runs without waiting for the next schedule.
  • Add an Error Trigger node to emit alerts if scraping or API calls fail.

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 - Workflow Overview

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

Block 2 - Section – Trigger & URL Prep

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

Block 3 - Section – Scraping

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

Block 4 - Section – Processing & Detection

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

Block 5 - Section – Storage & Alerts

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

Block 6 - Daily Policy Check

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

Block 7 - Define Policy URLs

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

Block 8 - Split URLs

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

Block 9 - Fetch Policy Data

Type / Role
n8n-nodes-scrapegraphai.scrapegraphAi - scrapegraphAi
Config choices
Version 1

Block 10 - Normalize Data

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

Block 11 - Merge Results

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 2.1

Block 12 - Deduplicate Policies

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

Block 13 - Is New Policy?

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

Block 14 - Prepare Matrix Message

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

Block 15 - Send Matrix Alert

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

Block 16 - Upsert Policy Deal

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

3. Summary Table

Workflow Healthcare policy monitoring with ScrapeGraphAI, Pipedrive and Matrix alerts
Complexity advanced
Nodes 16
Categories Market Research, AI Summarization
Author vinci-king-01
Published 11 Dec 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11722/11722.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 Healthcare policy monitoring with ScrapeGraphAI, Pipedrive and Matrix alerts do?

Medical Research Tracker with Matrix and Pipedrive ️ COMMUNITY TEMPLATE DISCLAIMER: This is a community contributed template that uses ScrapeGraphAI (a community node). Please ensure you have the ...

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 Market Research, AI Summarization use case.