High-Speed E-Commerce Competitor Price & Stock Tracker -> Telegram Alerts (Apify + n8n)

# :rocket: High-Speed E-Commerce Competitor Price & Stock Tracker → Telegram Alerts (Apify + n8n)

Hi everyone! :waving_hand:

I built a production-ready **n8n workflow + Apify Actor** setup designed to track competitor e-commerce price drops and out-of-stock events across **Shopify, WooCommerce, Salesforce Commerce Cloud, Magento, and D2C brand stores**, sending instant formatted Markdown alerts directly to Telegram (or Discord/Slack).

Traditional SaaS tools like Prisync cost $200+/month, and heavy Puppeteer scrapers consume massive RAM. This setup uses a **lightweight HTTP/JSON-LD engine (consuming only ~90 MB RAM)**, making it ultra-fast and extremely cost-effective.

-–

## :high_voltage: What This Workflow Does

1. **Monitors E-Commerce URLs:** Tracks price drops, price increases, and stock status changes (In Stock ↔ Out of Stock).

2. **Stateful Diffing:** Only triggers alerts when an actual price or stock change occurs (ignores redundant runs).

3. **Instant Telegram Alerts:** Sends beautiful Markdown messages complete with emojis, old vs. new price deltas, and direct product links.

-–

## :package: Copy-Paste n8n Workflow Template

Copy the JSON code below and paste it directly into your n8n workflow canvas (`Ctrl+V` or `Cmd+V`):

```json

{

“name”: “E-Commerce Price & Stock Monitor to Telegram”,

“nodes”: [

{

  "parameters": {

    "httpMethod": "POST",

    "path": "ecommerce-price-alert",

    "options": {}

  },

  "name": "Apify Webhook Trigger",

  "type": "n8n-nodes-base.webhook",

  "typeVersion": 1,

  "position": \[250, 300\]

},

{

  "parameters": {

    "conditions": {

      "boolean": \[

        {

          "value1": "={{ $json.body.totalAlerts > 0 }}",

          "value2": true

        }

      \]

    }

  },

  "name": "Has Price/Stock Alerts?",

  "type": "n8n-nodes-base.if",

  "typeVersion": 1,

  "position": \[470, 300\]

},

{

  "parameters": {

    "chatId": "YOUR_TELEGRAM_CHAT_ID",

    "text": "={{ $json.body.formattedText }}",

    "additionalFields": {

      "parse_mode": "Markdown"

    }

  },

  "name": "Send Telegram Alert",

  "type": "n8n-nodes-base.telegram",

  "typeVersion": 1,

  "position": \[690, 200\]

}

],

“connections”: {

"Apify Webhook Trigger": {

  "main": \[

    \[

      {

        "node": "Has Price/Stock Alerts?",

        "type": "main",

        "index": 0

      }

    \]

  \]

},

"Has Price/Stock Alerts?": {

  "main": \[

    \[

      {

        "node": "Send Telegram Alert",

        "type": "main",

        "index": 0

      }

    \]

  \]

}

}

}

```

-–

## :gear: 3-Step Setup Guide

### Step 1: Import Workflow into n8n

1. Create a new workflow in n8n.

2. Copy the JSON snippet above and paste (`Ctrl+V`) into your n8n editor.

3. Save the workflow and **toggle the Active switch to ON** (Crucial: ensure you use the Production Webhook URL, not the test one!).

### Step 2: Configure Apify Actor

1. Open the [Smart E-Commerce Price & Stock Monitor Actor on Apify]( Smart E-Commerce Price & Stock Monitor · Apify ).

2. Paste the e-commerce product URLs you want to track in **Product URLs to Monitor**.

3. Copy your n8n Production Webhook URL and paste it into **Webhook Target URL**.

### Step 3: Connect Telegram

1. Replace `YOUR_TELEGRAM_CHAT_ID` in the n8n Telegram node with your actual Telegram Chat ID or Channel ID.

2. Hit **Start** in Apify or schedule it to run every 6-12 hours!

-–

## :hammer_and_wrench: Tech Stack & Features

- **Engine:** `got-scraping` + `CheerioCrawler` (No heavy Chrome/Puppeteer overhead).

- **Auto-Detection:** Schema.org JSON-LD microdata parsing + 25+ CSS fallback selectors.

- **Security:** Built-in Anti-SSRF private IP protection & optional HMAC-SHA256 request signatures.

Hope this workflow helps agency owners and e-commerce managers automate competitor tracking! Let me know if you have any questions or feedback.

Nice writeup. The RAM comparison against Puppeteer setups is the part most people underestimate.

Three things that tend to bite this pattern once it runs for a few weeks, in case they are useful:

Sites change their JSON-LD without warning. A store switches themes or moves price into a nested offers array, your parser returns null, and the workflow keeps “succeeding” with nothing in it. Worth adding a check that fails loudly when a scrape returns zero products rather than letting it pass silently.

Duplicate alerts. If a product hovers around a threshold you can get the same price drop pinging Telegram several times an hour. Storing a hash of product plus price and skipping anything you already sent that day fixes most of it.

Rate limiting per domain rather than globally. One slow store can stall the whole run if everything shares a single queue.

How are you handling stores that render price client side only? That is usually where the lightweight HTTP approach stops working and people fall back to a browser, which kills the RAM advantage.

Appreciate the detailed breakdown @Cloudrocket! You’re totally right — those 4 edge cases are usually what break scrapers in production after a few weeks.

I actually refined the Actor to handle those exact points:

  1. Schema shifts: If JSON-LD breaks, it falls back to ~25 CSS selectors. I also added a “fail loudly” check so if zero valid products are extracted, it fires an explicit warning alert via webhook instead of passing silently.
  2. Alert spam: Added 24h MD5 hash deduplication (url + price + stock) on top of the percentage threshold, so price oscillations won’t spam Telegram.
  3. Queue stalling: Crawlee manages per-domain delays (1.5s) natively, so a slow site won’t hold up the rest of the queue.
  4. SPAs: It flags jsRenderingRequired: true in the output when static parsing misses data, making it super clear when a browser setup is needed.

Really appreciate people in the community sharing real-world gotchas like this. If you ever get a chance to test it out on Apify, I’d love to hear your thoughts!

Good fixes. That covers most of what I have seen go wrong with these setups in production.

One small thing on the dedup: hashing url + price + stock means a genuine repeat event inside the 24h window gets swallowed. Say a price drops, reverts for a few hours, then drops to the same number again. The second drop is real news for whoever is watching, but it hashes identical to the first and gets skipped. Adding a direction flag or a coarse time bucket to the hash keeps the spam protection without hiding that case.

The jsRenderingRequired flag is a nice touch. Most scrapers just return nulls and leave you guessing whether the parser broke or the page actually needs a browser.

I will run the Actor against a couple of stores I already watch when I get some time and post back if anything interesting turns up.

Ah damn, great point on the price bounce-back. Completely missed that a drop → revert → drop scenario within 24h would get swallowed by the hash.

Updating the hash logic to track the transition (prevPrice->currentPrice) instead of just the target state so those legit alerts still go through.

Thanks for catching that! Let me know how the tests go when you get round to it.

Quick update, I’ve cleaned up the n8n JSON workflow template code so it can now be copied and pasted directly (Ctrl+V) into your n8n workflow canvas with zero formatting errors:

Also updated the underlying Apify Actor engine to handle price bounce-back transitions cleanly.