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.
- 1
Catch the order
A
Webhooksubscribed toorders/createprovides the line items and the destination country — the two inputs routing depends on. - 2
Load supplier options
A
Google Sheetsread pulls the supplier table: for each product SKU, the candidate suppliers with their cost, per-region shipping time and live stock flag. ACodenode joins these options to each order line. - 3
Score and pick the winner
A
Codenode 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
Submit to the chosen supplier
A
Switchnode branches by the selected supplier and anHTTP Requestsubmits the fulfillment request to that supplier's API or order intake, with the product, quantity and shipping address. - 5
Handle the no-stock case
An
IFroutes any line with no available supplier to aSlackalert so you can back-order, substitute or refund. AGoogle Sheetslog 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.