⚡ Track & alert public transport delays using ScrapeGraphAI, Teams and Todoist

59 views · ⚡ Personal Productivity

💡 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

Public Transport Delay Tracker with Microsoft Teams and Todoist

⚠️ 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 continuously monitors public-transportation websites and apps for real-time schedule changes and delays, then posts an alert to a Microsoft Teams channel and creates a follow-up task in Todoist. It is ideal for commuters or travel coordinators who need instant, actionable updates about transit disruptions.

Pre-conditions/Requirements

Prerequisites

Required Credentials

Specific Setup Requirements

ResourceWhat you need
Teams ChannelCreate a channel → Add “Incoming Webhook” → copy the URL
Todoist ProjectCreate “Transit Alerts” project and note its Project ID
Transit URLs/APIsConfirm the URLs/pages contain the schedule & delay elements

How it works

This workflow continuously monitors public-transportation websites and apps for real-time schedule changes and delays, then posts an alert to a Microsoft Teams channel and creates a follow-up task in Todoist. It is ideal for commuters or travel coordinators who need instant, actionable updates about transit disruptions.

Key Steps:

Set up steps

Setup Time: 15–20 minutes

  1. Install community node: In n8n, go to “Manage Nodes” → “Install” → search for “ScrapeGraphAI” → install and restart n8n.
  2. Create Teams webhook: In Microsoft Teams, open target channel → “Connectors” → “Incoming Webhook” → give it a name/icon → copy the URL.
  3. Create Todoist API token: Todoist → Settings → Integrations → copy your personal API token.
  4. Add credentials in n8n: Settings → Credentials → create new for ScrapeGraphAI, Microsoft Teams, and Todoist.
  5. Import workflow template: File → Import Workflow JSON → select this template.
  6. Configure Set node: Replace example transit URLs with those of your local transit authority.
  7. Adjust delay threshold: In the Code node, edit const MAX_DELAY_MINUTES = 5; as needed.
  8. Activate workflow: Toggle “Active”. Monitor executions to ensure messages and tasks are created.

Node Descriptions

Core Workflow Nodes:

Data Flow:

  1. WebhookSetScrapeGraphAICodeIF
    a. IF (true branch)Microsoft TeamsTodoist
    b. IF (false branch) → (workflow ends)

Customization Examples

Change alert message formatting

// In the Code node
const message = `⚠️ Delay Alert:
Route: ${item.route}
Expected: ${item.scheduled}
New Time: ${item.newTime}
Delay: ${item.delay} min
Link: ${item.url}`;
return [{ json: { message } }];

Post to multiple Teams channels

// Duplicate the Microsoft Teams node and reference a different credential
items.forEach(item => {
  item.json.webhookUrl = $node["Set"].json["secondaryChannelWebhook"];
});
return items;

Data Output Format

The workflow outputs structured JSON data:

{
  "route": "Blue Line",
  "scheduled": "2024-12-01T14:25:00Z",
  "newTime": "2024-12-01T14:45:00Z",
  "delay": 20,
  "status": "Delayed",
  "url": "https://transit.example.com/blue-line/status"
}

Troubleshooting

Common Issues

  1. Scraping returns empty data – Verify CSS selectors/XPath in the Set node and ensure the target site hasn’t changed its markup.
  2. Teams message not sent – Check that the stored webhook URL is correct and the connector is still active.
  3. Todoist task duplicated – Add a unique key (e.g., route + timestamp) to avoid inserting duplicates.

Performance Tips

Pro Tips:

🔗 Nodes Used

Webhook, Todoist, Microsoft Teams

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup