n8n Tutorial: Build a Dynamic Pricing Alert System

Tracking prices manually is a waste of time. Whether you're monitoring competitors, watching supplier costs, or keeping tabs on your own product margins, the pattern is always the same: someone opens

n8n Tutorial: Build a Dynamic Pricing Alert System

Tracking prices manually is a waste of time. Whether you're monitoring competitors, watching supplier costs, or keeping tabs on your own product margins, the pattern is always the same: someone opens a spreadsheet, refreshes a page, writes a number down. An hour later, it's already stale. A dynamic pricing alert system built in n8n eliminates that loop entirely — and you can have it running in under an afternoon.

What You're Building

The goal is a workflow that checks one or more URLs on a schedule, extracts the relevant price, compares it against a baseline or threshold, and fires an alert the moment something changes. The alert goes wherever you actually pay attention — Slack, email, WhatsApp, a Google Sheet, or all of the above.

The core components are:

  • A Schedule Trigger — runs every hour, every 15 minutes, or whatever cadence your use case demands
  • An HTTP Request node — fetches the target page or API endpoint
  • A Code node — extracts the price from the response using a CSS selector or JSON path
  • A Compare node or IF node — checks whether the price crossed your threshold
  • A Notification node — Slack, Gmail, or Telegram, depending on where you work

Setting Up the Price Fetch

Start with the HTTP Request node pointed at your target. If the source is a public API — like a supplier catalog or a platform with price endpoints — set the method to GET and parse the JSON response directly. If it's a web page, you'll get raw HTML back and need to extract the number yourself.

In the Code node, a few lines of JavaScript handle the extraction:

  • Use items[0].json.body to access the raw HTML string
  • Match the price with a regex like /\$([0-9,]+\.\d{2})/ or a more targeted pattern based on the page structure
  • Parse it to a float and pass it forward as a clean number

For pages that load prices via JavaScript after initial render, a headless browser approach works better — but for most static or server-rendered pages, the HTTP Request node is sufficient and faster.

Storing the Baseline and Triggering Alerts

The comparison logic needs a reference point. There are two clean ways to handle this in n8n:

  • Static node data: hardcode your threshold directly in an IF node. Good for simple "alert me if price drops below $50" scenarios.
  • Google Sheets or Airtable as a price log: append the current price on every run, then compare against the previous row. This gives you a history and enables percentage-change alerts instead of fixed thresholds.

The IF node condition is straightforward: if currentPrice is less than threshold, route to the notification branch. If not, route to a no-op or a simple log entry.

For percentage-based alerts — "notify me if price drops more than 10% from yesterday" — the Code node handles the math before the IF check:

  • Pull previous price from your sheet via a Google Sheets Read node
  • Calculate ((previousPrice - currentPrice) / previousPrice) * 100
  • Pass the percentage drop into the IF node condition

Scaling Across Multiple Products

A single-product alert is useful. A multi-product monitor that runs in parallel is where this becomes genuinely powerful. n8n handles this with a Split In Batches node upstream of your HTTP Request node.

Store your product list — URLs, thresholds, names — in a Google Sheet or as a JSON array in a Set node. Feed that list into Split In Batches, then run each item through the same fetch-extract-compare chain. The notification at the end includes the product name so you know exactly what triggered.

Keep a few things in mind when scaling:

  • Add a Wait node between HTTP requests if you're scraping the same domain — 1–2 seconds prevents rate limiting
  • Store failed requests in a separate sheet for review rather than silently dropping them
  • Use n8n's built-in error workflow to catch node failures and route them to a fallback alert

If you'd rather skip the build and start with something production-ready, ready-made n8n templates cover this pattern and dozens of others — already wired up, documented, and ready to drop into your n8n instance.

A dynamic pricing alert system isn't a complex build, but the details matter: clean extraction logic, reliable comparison, and notifications that reach you fast enough to act on. Get those three things right and you've eliminated an entire category of manual monitoring from your week.

Competitor Intelligence Monitor
PRONTO PARA USAR

Ja construimos isso pra voce

Nao comece do zero. O Competitor Intelligence Monitor e um workflow n8n pronto para instalar que faz exatamente isso — em minutos, nao horas.

Instalar por $59 →