Skip to main content

Real-time public transport delay tracking with ScrapeGraphAI, Teams & Dropbox

Workflow preview

Workflow preview
100%
Real-time public transport delay tracking with ScrapeGraphAI, Teams & Dropbox preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Public Transport Schedule & Delay Tracker with Microsoft Teams and Dropbox ![Workflow Preview Image](https://via.placeholder.com/800x400/4CAF50/FFFFFF?text=Public+Transport+Schedule+%26+Delay+Track...

Best for

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

Tools used

n8n-nodes-base.webhook, n8n-nodes-base.code, n8n-nodes-base.splitinbatches, n8n-nodes-scrapegraphai.scrapegraphai, n8n-nodes-base.merge, n8n-nodes-base.if, n8n-nodes-base.microsoftteams, 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
Real-time public transport delay tracking with ScrapeGraphAI, Teams & Dropbox
Workflow name
Real-time public transport delay tracking with ScrapeGraphAI, Teams & Dropbox

Public Transport Schedule & Delay Tracker with Microsoft Teams and Dropbox

⚠️ 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 scrapes public transport websites or apps for real-time schedules and service alerts, then pushes concise delay notifications to Microsoft Teams while archiving full-detail JSON snapshots in Dropbox. Ideal for commuters and travel coordinators, it keeps riders informed and maintains a historical log of disruptions.

Pre-conditions/Requirements

Prerequisites

  • n8n instance (self-hosted or n8n.cloud)
  • ScrapeGraphAI community node installed
  • Microsoft Teams incoming webhook configured
  • Dropbox account with an app token created
  • Public transit data source (website or API) that is legally scrapable or offers open data

Required Credentials

  • ScrapeGraphAI API Key – enables web scraping
  • Microsoft Teams Webhook URL – posts messages into a channel
  • Dropbox Access Token – saves JSON files to Dropbox

Specific Setup Requirements

Item Example Notes
Transit URL(s) https://mycitytransit.com/line/42 Must return the schedule or service alert data you need
Polling Interval 5 min Adjust via Cron node or external trigger
Teams Channel #commuter-updates Create an incoming webhook in channel settings

How it works

This workflow automatically scrapes public transport websites or apps for real-time schedules and service alerts, then pushes concise delay notifications to Microsoft Teams while archiving full-detail JSON snapshots in Dropbox. Ideal for commuters and travel coordinators, it keeps riders informed and maintains a historical log of disruptions.

Key Steps:

  • Webhook Trigger: Starts the workflow (can be replaced with Cron for polling).
  • Set Node: Stores target route IDs, URLs, or API endpoints.
  • SplitInBatches: Processes multiple routes one after another to avoid rate limits.
  • ScrapeGraphAI: Scrapes each route page/API and returns structured schedule & alert data.
  • Code Node (Normalize): Cleans & normalizes scraped fields (e.g., converts times to ISO).
  • If Node (Delay Detected?): Compares live data vs. expected timetable to detect delays.
  • Merge Node: Combines route metadata with delay information.
  • Microsoft Teams Node: Sends alert message and rich card to the selected Teams channel.
  • Dropbox Node: Saves the full JSON snapshot to a dated folder for historical reference.
  • StickyNote: Documents the mapping between scraped fields and final JSON structure.

Set up steps

Setup Time: 15-25 minutes

  1. Clone or Import the JSON workflow into your n8n instance.
  2. Install ScrapeGraphAI community node if you haven’t already (Settings → Community Nodes).
  3. Open the Set node and enter your target routes or API endpoints (array of URLs/IDs).
  4. Configure ScrapeGraphAI:
    • Add your API key in the node’s credentials section.
    • Define CSS selectors or API fields inside the node parameters.
  5. Add Microsoft Teams credentials:
    • Paste your channel’s incoming webhook URL into the Microsoft Teams node.
    • Customize the message template (e.g., include route name, delay minutes, reason).
  6. Add Dropbox credentials:
    • Provide the access token and designate a folder path (e.g., /TransitLogs/).
  7. Customize the If node logic to match your delay threshold (e.g., ≥5 min).
  8. Activate the workflow and trigger via the webhook URL, or add a Cron node (every 5 min).

Node Descriptions

Core Workflow Nodes:

  • Webhook – External trigger for on-demand checks or recurring scheduler.
  • Set – Defines static or dynamic variables such as route list and thresholds.
  • SplitInBatches – Iterates through each route to control request volume.
  • ScrapeGraphAI – Extracts live schedule and alert data from transit websites/APIs.
  • Code (Normalize) – Formats scraped data, merges dates, and calculates delay minutes.
  • If (Delay Detected?) – Branches the flow based on presence of delays.
  • Merge – Re-assembles metadata with computed delay results.
  • Microsoft Teams – Sends formatted notifications to Teams channels.
  • Dropbox – Archives complete JSON payloads for auditing and analytics.
  • StickyNote – Provides inline documentation for maintainers.

Data Flow:

  1. WebhookSetSplitInBatchesScrapeGraphAICode (Normalize)If (Delay Detected?)
    ├─ true → MergeMicrosoft TeamsDropbox
    └─ false → Dropbox

Customization Examples

Change to Slack instead of Teams

// Replace Microsoft Teams node with Slack node
{
  "text": `🚊 *${$json.route}* is delayed by *${$json.delay}* minutes.`,
  "channel": "#commuter-updates"
}

Filter only major delays (>10 min)

// In If node, use:
return $json.delay >= 10;

Data Output Format

The workflow outputs structured JSON data:

{
  "route": "Line 42",
  "expected_departure": "2024-04-22T14:05:00Z",
  "actual_departure": "2024-04-22T14:17:00Z",
  "delay": 12,
  "status": "delayed",
  "reason": "Signal failure at Main Station",
  "scraped_at": "2024-04-22T13:58:22Z",
  "source_url": "https://mycitytransit.com/line/42"
}

Troubleshooting

Common Issues

  1. ScrapeGraphAI returns empty data – Verify CSS selectors/API fields match the current website markup; update selectors after site redesigns.
  2. Teams messages not arriving – Ensure the Teams webhook URL is correct and the incoming webhook is still enabled.
  3. Dropbox writes fail – Check folder path, token scopes (files.content.write), and available storage quota.

Performance Tips

  • Limit SplitInBatches to 5-10 routes per run to avoid IP blocking.
  • Cache unchanged schedules locally and fetch only alert pages for faster runs.

Pro Tips:

  • Use environment variables for API keys & webhook URLs to keep credentials secure.
  • Attach a Cron node set to off-peak hours (e.g., 4 AM) for daily full-schedule backups.
  • Add a Grafana dashboard that reads the Dropbox archive for long-term delay analytics.

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 - Webhook Listener

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

Block 2 - Prepare Source URLs

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

Block 3 - Split URLs

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

Block 4 - Scrape Transit Data

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

Block 5 - Merge Results

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

Block 6 - Normalize & Deduplicate

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

Block 7 - Significant Delay?

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

Block 8 - Send Teams Alert

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

Block 9 - Prepare File for Dropbox

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

Block 10 - Archive to Dropbox

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

Block 11 - Workflow Overview

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

Block 12 - Section – Trigger & URLs

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

Block 13 - Section – Scraping Layer

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

Block 14 - Section – Processing & Alerts

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

Block 15 - Section – Storage & Archiving

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

3. Summary Table

Workflow Real-time public transport delay tracking with ScrapeGraphAI, Teams & Dropbox
Complexity advanced
Nodes 15
Categories Miscellaneous, AI Summarization
Author vinci-king-01
Published 09 Dec 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11634/11634.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 Real-time public transport delay tracking with ScrapeGraphAI, Teams & Dropbox do?

Public Transport Schedule & Delay Tracker with Microsoft Teams and Dropbox ![Workflow Preview Image](https://via.placeholder.com/800x400/4CAF50/FFFFFF?text=Public+Transport+Schedule+%26+Delay+Track...

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