Skip to content

n8n Price Monitoring Workflow: Price Drop Alerts With Targets

An n8n price monitoring workflow that reads the new price from AyeWatch's webhook, compares it with your target price in a Code node, logs every change and pings Slack only on a real drop.

By AyeWatch Team5 min read

Short answer: For an n8n price monitoring workflow, let AyeWatch monitor each product page and send a signed webhook when the price changes. In n8n, a Code node reads the new price from the alert and compares it with your target for that topic_id. Every change goes to Google Sheets; Slack hears only when the price is at or below target.

When plain n8n is enough

For one simple page you may not need a monitoring service. A Schedule Trigger, an HTTP Request node and the HTML node can fetch a page and pull the price out with a CSS selector, and that costs nothing beyond your n8n plan.

It stops working when the shop builds its prices with JavaScript, blocks requests that do not look like a browser, or renames the class your selector depends on. You also have to store the last price yourself to know whether it changed. AyeWatch reads the page, compares it with the last check and describes the change in plain words, so your workflow does not depend on the page's HTML.

Set up the monitors

Create one web page monitor per product, for example https://shop.example/espresso-grinder-pro. One product per monitor keeps the topic_id to target mapping simple. Each check costs 1 credit.

A rule on the monitor drops changes you do not care about, and on a page monitor it adds no credits: Only alert me when the price changes or the item comes back in stock. Ignore reviews, shipping banners and related products. Pages with rotating banners need it most.

The n8n workflow

The first four nodes are the same in every recipe in this series. The n8n webhook setup guide walks through them; here is the short version.

  1. Webhook: HTTP Method POST, Respond set to Immediately, and Raw Body turned on under Options. Its Production URL goes into AyeWatch's webhook settings.
  2. Crypto: Action Hmac, Binary File on with Binary Property Name data, Type SHA256, Property Name signature, Encoding HEX. Your AyeWatch signing secret goes into a Crypto credential as the Hmac Secret.
  3. Check signature: a Code node that compares sha256= plus that value with the x-ayewatch-signature header in constant time, drops the item if they differ, and passes on flat fields: topic_id, topic_name, update_id, headline, content, source_url (the first evidence link, when there is one) and created_at. The code is in the HMAC verification recipe.
  4. Remove Duplicates: Operation Remove Items Processed in Previous Executions, Keep Items Where Value Is New, Value to Dedupe On {{ $json.update_id }}. The reasons are in the dedupe recipe.

Then the price nodes:

  1. Code, "Read the price": pulls a number out of the alert and compares it with the target (code below).
  2. Google Sheets: Append Row into a price log with created_at, topic_name, price, target, hit and source_url. Connect it straight from the Code node.
  3. If: also from the Code node, Boolean condition {{ $json.hit }} is true.
  4. Slack, on the true branch: {{ $json.topic_name }} is now {{ $json.price }} (target {{ $json.target }}) and the link.
// Code node "Read the price". Mode: Run Once for Each Item.
// Target price per monitor, keyed by AyeWatch topic_id.
const TARGETS = { 5301: 129, 5302: 899, 5303: 45 };
const AFTER_WORD = /(?:to|now|at)\s+[$£€]\s?(\d[\d,]*(?:\.\d{1,2})?)/i;
const ANY = /[$£€]\s?(\d[\d,]*(?:\.\d{1,2})?)/;

function readPrice(text) {
  const s = text || '';
  const m = s.match(AFTER_WORD) || s.match(ANY);
  return m ? Number(m[1].replace(/,/g, '')) : null;
}

const price = readPrice($json.headline) ?? readPrice($json.content);
const target = TARGETS[$json.topic_id] ?? null;
return {
  json: {
    ...$json,
    price,
    target,
    hit: price !== null && target !== null && price <= target,
  },
};

A made-up alert headline such as Espresso grinder dropped from $159 to $129 gives price: 129. With a target of 129, hit is true and Slack gets a message.

How the parser reads prices, and where it fails

The parser looks first for a price that follows "to", "now" or "at", so "from $159 to $129" gives the new price, not the old one. If there is no such phrase, it takes the first price with a $, £ or € sign. It reads the headline before the content because AyeWatch headlines usually state the change in one line.

It will be wrong sometimes:

  • A page with several sizes or bundles may produce the price of the wrong one.
  • Other currencies need their sign added to both character classes, for example [$£€₹].
  • A price written as "129 dollars" has no sign and returns null.

When the price is null, the row still lands in the sheet with an empty price, so you can check that alert by hand. That is the reason the sheet takes every alert and Slack only the hits.

Credit budget

Credits per check times checks, 30-day month:

  • Pro: three products every 6 hours, 3 × 1 × 120 = 360 credits.
  • Pro+: two fast-moving products hourly, 2 × 720 = 1,440 credits.
  • A rule on each of the three Pro monitors is part of the check, so the total stays at 360.

AyeWatch Pro is $9/mo with 50 topics and hourly checks; Pro+ is $19/mo with 200 topics and ASAP mode. Every plan starts with a 7-day free trial.

What this won't catch

  • Prices shown only after sign-in, in a cart or with a member card.
  • Regional prices that depend on where the reader is.
  • A flash sale that starts and ends between two checks.
  • Sites that block automated readers. The first check shows if a page is one of them.
  • Buying. The workflow tells you; you decide and check out yourself.

Build it

  1. Create one AyeWatch web page monitor per product and note each topic_id.
  2. Run each monitor once and read the first check to be sure the page is readable.
  3. Build the front four nodes in n8n, publish, and paste the Production URL into AyeWatch's webhook settings.
  4. Add the Read the price Code node with your topic IDs and target prices.
  5. Connect Google Sheets and the If node to the Code node, then Slack to the If node's true branch.
  6. Send a test alert, check the sheet row and the hit value, then leave it running.
ApproachWorks onBreaks whenCost
Schedule Trigger + HTTP Request + HTML nodeStatic pages with a stable price elementPrices load with JavaScript, the site blocks bots, the class name changesFree beyond n8n
AyeWatch page monitor + Webhook nodeMost public product pagesThe price needs a login, or the site blocks automated readers1 credit a check, rule included

Start a monitor in under a minute

Describe a topic or paste a URL. Cancel before the trial ends and you pay nothing.

Try it free for 7 days

The bottom line

Set targets you would actually buy at, not just lower numbers, and let the sheet collect every change. After a month the log shows how often each item really drops, which is the best guide to a sensible target.

FAQ

Can n8n track prices on its own?

Yes, for simple static pages, with a Schedule Trigger, an HTTP Request node and the HTML node. Pages that load prices with JavaScript or block bots need a monitoring service in front of n8n.

How do I alert only below a target price in n8n?

Read the price from the alert in a Code node, compare it with a target stored per topic_id, set a hit flag, and connect Slack to the true branch of an If node on that flag.

How do I pull a price out of text in an n8n Code node?

Use a regular expression that matches a currency sign and digits, strip the commas, and turn it into a number. Look for words like to or now first so you get the new price.

How many credits does price monitoring use?

A web page monitor costs 1 credit a check. Three products checked every 6 hours use 360 credits in a 30-day month.

Can AyeWatch monitor prices behind a login?

No. It reads public pages only.

n8n price monitoring workflown8n price trackerprice drop alerts n8nn8n code node priceprice change webhook

Related articles