E-commerce & Dropshipping · n8n

Route Each Dropshipping Order to the Best Supplier by Rules

An n8n workflow that, for every order, picks the optimal supplier per product based on your rules — cheapest cost, fastest shipping to that country, or in-stock right now — and sends the fulfillment request to the winner, so you stop hand-picking suppliers and always ship from the smartest source.

difficulty Advancedsetup 65 minresult Every order line is auto-routed to the best supplier by your rules, cutting cost and delivery time without manual choices
  1. 1

    Catch the order

    A Webhook subscribed to orders/create provides the line items and the destination country — the two inputs routing depends on.

  2. 2

    Load supplier options

    A Google Sheets read pulls the supplier table: for each product SKU, the candidate suppliers with their cost, per-region shipping time and live stock flag. A Code node joins these options to each order line.

  3. 3

    Score and pick the winner

    A Code node applies your priority rule — filter to in-stock suppliers, then rank by fastest shipping to the destination country, breaking ties by lowest cost — and selects the best supplier for each line. Out-of-stock everywhere is flagged.

  4. 4

    Submit to the chosen supplier

    A Switch node branches by the selected supplier and an HTTP Request submits the fulfillment request to that supplier's API or order intake, with the product, quantity and shipping address.

  5. 5

    Handle the no-stock case

    An IF routes any line with no available supplier to a Slack alert so you can back-order, substitute or refund. A Google Sheets log records every routing decision, giving you data to renegotiate with suppliers or drop the unreliable ones.

Frequently asked questions

Why source the same product from multiple suppliers?

Resilience and optimization. Relying on one supplier means a stockout or a price hike hits every order. With two or three suppliers for your key products, you can always ship from whoever is cheapest, fastest to the customer's country, or actually in stock today. For a US customer, a US-based supplier may cost more but arrive in days; for a price-sensitive product, the cheapest source wins. Rules let you encode that judgment once and apply it to every order automatically.

How are the routing rules defined?

In a supplier table: each product maps to several suppliers, each with a cost, a shipping-time estimate per region, and a live stock flag. You set a priority — for example 'prefer fastest to the destination country, break ties by cheapest'. A Code node scores the candidate suppliers per order line against that priority and picks the winner. Changing strategy is editing the rule, not the workflow.

How does it actually place the order with the supplier?

Once a supplier is chosen, an HTTP Request submits the fulfillment to that supplier's API (or drops it into their order sheet/portal). Because each supplier has its own endpoint and format, the workflow branches to the right submission node per supplier. The routing decision and the submission are cleanly separated, so adding a new supplier is adding one branch.

What if no supplier has the item in stock?

The scoring step filters out out-of-stock suppliers first. If none remain, the order is flagged and routed to a Slack alert instead of being sent anywhere, so you can back-order, substitute, or refund proactively rather than confirming an order you can't fulfill — which is how stores get chargebacks and bad reviews.

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.