E-commerce & Dropshipping · n8n

Auto-Reprice Shopify Products When AliExpress Supplier Costs Rise

An n8n workflow that watches your AliExpress supplier costs, recalculates each product's real margin, and either updates the Shopify price to protect your target margin or pauses the listing when the numbers no longer work — so a silent supplier price hike never quietly turns your best-seller into a money-loser.

difficulty Advancedsetup 70 minresult Rising supplier costs automatically trigger a Shopify price update or a listing pause, so every sale keeps its target margin
  1. 1

    Schedule a daily cost check

    Add a Schedule Trigger set to Days at an early hour. A Google Sheets read pulls your product map: each row holds the Shopify product/variant ID, the mapped AliExpress URL, the last known cost, your target margin and your floor margin. Keeping this mapping in one sheet makes it trivial to add products or tweak thresholds without touching the workflow logic.

  2. 2

    Fetch current AliExpress costs

    An Item Lists node splits the products, then an HTTP Request runs an Apify AliExpress scraper for each mapped URL and returns today's cost (including any shipping you factor into COGS). Scraping per product keeps the data accurate even when a supplier changes only some SKUs.

  3. 3

    Recalculate the real margin

    A Code node computes the new margin from the current retail price and the fresh cost: margin = (price - cost - fees) / price. It compares against your tolerance so tiny fluctuations are ignored, and classifies each product as ok, reprice, or pause based on your target and floor margins.

  4. 4

    Reprice or pause in Shopify

    An IF/Switch routes each product. For reprice, an HTTP Request to the Shopify Admin API updates the variant price to hit your target margin, rounded to a clean price point. For pause, it sets the product status to draft so you stop selling at a loss. The ok branch simply updates the stored cost and exits.

  5. 5

    Log changes and alert on pauses

    A Google Sheets node records every price change and pause with old vs new cost and margin, giving you an audit trail and a view of which suppliers keep hiking. A Slack node fires only on pauses — the events that need a human decision (renegotiate, re-source, or discontinue), so you're alerted to problems, not spammed with routine updates.

Frequently asked questions

Why is margin erosion such a big deal in dropshipping?

Dropshipping margins are thin to begin with — often 15-30%. AliExpress suppliers change prices constantly, and a 20% cost increase on a product you sell at a 25% margin can wipe out your profit entirely while you keep happily taking orders. The danger is that nothing breaks: sales keep coming, but each one now loses money. This workflow makes an invisible problem visible and acts on it before it drains your bank account.

How does it get current AliExpress prices?

Through an AliExpress product scraper actor on Apify (or the AliExpress dropshipping API if you have access). You feed it your mapped product URLs and it returns the current cost. The workflow compares that to the cost stored on your product record. Because scraping happens on a schedule, you catch changes within a day rather than at month-end when the damage is done.

What decides between repricing and pausing?

You set a target margin and a floor margin. If the new cost still leaves you above the target after repricing, the workflow updates the Shopify price and moves on. If even at your maximum acceptable retail price the margin would fall below the floor, it pauses the listing (sets it to draft) and alerts you, because selling below the floor is worse than not selling at all. Both thresholds live in a config sheet you control.

Won't constant price changes hurt conversions?

That's why the workflow only acts on meaningful changes — a small tolerance (e.g. ignore sub-2% cost moves) prevents price flapping. It also rounds to psychological price points ($19.99, not $19.63). The goal is protecting margin on genuine cost shifts, not micro-adjusting prices every day, which would indeed unsettle shoppers and hurt trust.

About this recipe. Recipes on FlowRecipesHub are written for business owners, not developers, and are tested before publishing — how recipes get made. Some ingredient links are affiliate links that cost you nothing — full disclosure.