Skip to content

Built-in flows

The flow seeded for each commerce model, how seeding works, and the dashboard scenarios that exercise them.

OrderLoop seeds at least one flow per commerce model. Each is an ordinary flow: open it in the editor, change it and publish a new version.

OrderLoop publishes the built-in flows the first time they are needed: when flows are listed or opened, when an order starts, and before the stock review starts a replenishment order. When a built-in flow changes in a new OrderLoop release, the new version is published over the flow’s draft and over anything you published from the editor since, so keep a customised copy as its own flow. A built-in flow that matches an earlier version is never published again, and orders already running keep the version they pinned.

Purchase request

tpl-purchase-request

Internal procurement: AI spend classification, budget check, tiered approvals, PO, supplier acknowledgement, goods receipt, 3-way match and payment.

  • ModelProcurement
  • ChannelsDashboard, Email, API
  • Nodes22
  • Edges30
Nodes
IdLabelType
requestPurchase requestManual / API
classifyClassify spendClassify
pricePrice linesPrice lines
budgetBudget checkBudget check
needs_mgrOver $5k?Condition
mgrManager approvalApproval
needs_finOver $20k?Condition
finFinance approvalApproval
poGenerate POGenerate PO
sendSend PO to supplierNotify
ackSupplier acknowledgesWait for event
goodsGoods receivedWait for event
match3-way match3-way match
mismatchResolve mismatchApproval
payPay supplierPay supplier
erpPost to ERPERP sync
doneClosedEnd
reject_noteTell requesterNotify
rejectedRejectedEnd
expire_noteTell requesterNotify
expiredNo decisionEnd
stalledSupplier unresponsiveEnd

B2B order

tpl-b2b-order

Inbound PO by email: AI extraction, contract pricing, credit check, an assessment that fast-tracks confidently routine orders, an agent that triages the rest to auto-approve / approval / clarify, stock reservation, net-30 invoice, shipment and a dunning loop.

  • ModelB2B
  • ChannelsEmail, EDI, API, Dashboard
  • Nodes29
  • Edges35
Nodes
IdLabelType
po_inPO receivedInbound email
extractExtract orderExtract order
validateValidateValidate order
priceContract pricingPrice lines
taxTaxCalculate tax
creditCredit checkCredit check
assessAssess: routine?Assess
routerAgent: triageAgent router
clarifyAsk customerNotify
replyCustomer repliesWait for event
approvalSales approvalApproval
reserveReserve stockReserve inventory
invoiceInvoiceGenerate invoice
shipShipCreate shipment
erpPost to ERPERP sync
paidPayment receivedWait for event
dunningDunningLoop
remindPayment reminderNotify
paid_latePayment receivedWait for event
collectionsSend to collectionsNotify
donePaidEnd
unpaidUnpaidEnd
declineDecline orderNotify
declinedDeclinedEnd
expireDecline orderNotify
expiredNo decisionEnd
unansweredDecline orderNotify
no_replyNo replyEnd
backorderOut of stockEnd

Reorder

tpl-reorder

Scheduled replenishment: AI demand forecast for SKUs at their reorder point, PO generation, approval above $10k, supplier acknowledgement, receipt and restock.

  • ModelReplenishment
  • ChannelsSchedule, Dashboard
  • Nodes16
  • Edges18
Nodes
IdLabelType
scheduleDaily stock reviewSchedule
forecastForecast demandDemand forecast
anyAnything to order?Condition
priceSupplier costPrice lines
poReplenishment POGenerate PO
bigOver $10k?Condition
approvalBuyer approvalApproval
submitSubmit to supplierNotify
ackSupplier acknowledgesWait for event
receiptGoods receivedWait for event
restockRestockRestock
erpPost to ERPERP sync
doneRestockedEnd
nothingNothing to orderEnd
skipNot approvedEnd
lateSupplier lateEnd

Subscription

tpl-subscription

Recurring box subscription: authorize, then a billing-period loop (wait → charge → ship) with a dunning retry, continuing as a new run after 12 cycles.

  • ModelSubscription
  • ChannelsWeb, Mobile app, API
  • Nodes18
  • Edges19
Nodes
IdLabelType
signupSubscription signupWebhook
validateValidateValidate order
pricePlan pricePrice lines
taxTaxCalculate tax
authorizeAuthorize cardAuthorize payment
welcomeWelcome emailNotify
initStart yearSet variables
periodsBilling periodsLoop
renewalUntil renewalWait
chargeCharge renewalCharge
retry_waitDunning delayWait
retryRetry chargeCharge
fulfillShip boxCreate shipment
nextNext cycleSet variables
pausePayment failedNotify
pausedPausedEnd
renewNext yearContinue as new
declinedCard declinedEnd

Storefront order

tpl-storefront-order

Card checkout: store policy, authorize, reserve, ship and capture, then a 30-day return window: RMA label, goods received, restock and a full or partial refund.

  • ModelB2C retail
  • ChannelsWeb, Mobile app, API
  • Nodes26
  • Edges26
Nodes
IdLabelType
checkoutStorefront checkoutWebhook
validateValidateValidate order
priceList pricePrice lines
taxTaxCalculate tax
policyStore policyPolicy check
rejectExplain rejectionNotify
rejectedRejectedEnd
authorizeAuthorize cardAuthorize payment
reserveReserve stockReserve inventory
shipShipCreate shipment
captureCapture paymentCapture payment
shippedShipping confirmationNotify
windowReturn windowWait for event
rmaReturn labelReturn label
send_labelSend return labelNotify
backReturn receivedWait for event
restockRestockRestock
refundRefundRefund
refundedRefund confirmationNotify
reviewRefund needs reviewNotify
doneFulfilledEnd
returnedReturnedEnd
lostReturn not receivedEnd
declinedCard declinedEnd
shortOut of stockEnd
uncapturedCapture failedEnd

Marketplace order

tpl-marketplace-order

Multi-seller checkout: fraud check, authorize, split by seller and wait for each seller to accept, ship and capture what was accepted, a return window, then seller payouts net of commission and refunds.

  • ModelMarketplace
  • ChannelsMarketplace, Web, Mobile app, API
  • Nodes30
  • Edges40
Nodes
IdLabelType
checkoutMarketplace checkoutWebhook
validateValidateValidate order
priceList pricePrice lines
taxTaxCalculate tax
riskFraud checkRisk score
trustTrust & safety reviewApproval
authorizeAuthorize cardAuthorize payment
splitSplit by sellerSplit by seller
askAsk sellersNotify
acceptingSeller responsesLoop
respondedSeller respondsWait for event
recordRecord responseSeller response
expireReject unansweredSeller response
reserveReserve stockReserve inventory
shipShipCreate shipment
captureCapture paymentCapture payment
shippedShipping confirmationNotify
windowReturn windowWait for event
rmaReturn labelReturn label
backReturn receivedWait for event
restockRestockRestock
refundRefundRefund
payoutSeller payoutsSeller payouts
doneFulfilledEnd
blockedBlockedEnd
declinedCard declinedEnd
no_sellersNo seller acceptedEnd
unansweredSellers did not answerEnd
shortOut of stockEnd
uncapturedCapture failedEnd

Omnichannel order

tpl-omnichannel-order

A brand’s own store: authorize, then route each order to shipping (from the warehouse or a store), pickup in store with a code, or digital delivery, and capture once every part is fulfilled.

  • ModelDirect to consumer
  • ChannelsWeb, Mobile app, API
  • Nodes23
  • Edges26
Nodes
IdLabelType
checkoutCheckoutWebhook
validateValidateValidate order
priceList pricePrice lines
taxTaxCalculate tax
authorizeAuthorize paymentAuthorize payment
routeRoute fulfillmentRoute fulfillment
reserve_shipReserve stockReserve inventory
shipShipCreate shipment
shippedShipping confirmationNotify
reserve_pickupHold at storeReserve inventory
readyReady for pickupReady for pickup
ready_notePickup readyNotify
collectCustomer collectsWait for event
handoverHand overHand over
deliverDeliver digital goodsDeliver digital goods
deliveredDownload readyNotify
captureCapture paymentCapture payment
doneFulfilledEnd
declinedPayment declinedEnd
unavailableCannot fulfilEnd
shortOut of stockEnd
uncollectedNot collectedEnd
uncapturedCapture failedEnd

Point-of-sale sale

tpl-pos-sale

A sale at the till: take payment, hand the goods over from the store’s own stock (or issue gift card and download codes), capture, and email a receipt when the buyer gives an address.

  • ModelB2C retail
  • ChannelsPoint of sale
  • Nodes16
  • Edges18
Nodes
IdLabelType
saleTill saleWebhook
validateValidateValidate order
priceList pricePrice lines
taxTaxCalculate tax
authorizeTake paymentAuthorize payment
routeStore stockRoute fulfillment
reserveTake from store stockReserve inventory
handoverHand overHand over
deliverIssue codesDeliver digital goods
captureCapture paymentCapture payment
has_emailEmail receipt?Condition
receiptEmail receiptNotify
doneSoldEnd
declinedPayment declinedEnd
unavailableNot in stock hereEnd
uncapturedCapture failedEnd

tpl-marketplace-order is the marketplace model’s flow; Marketplace walks through it. tpl-omnichannel-order is the d2c default and tpl-pos-sale the flow for pos till sales; Fulfillment walks through them.

In workspaces with the demo data loaded, the dashboard’s Demo scenarios start an order on a built-in flow with a canned input. Each exercises a different path:

Scenario Flow Path
Guest checkout tpl-storefront-order A b2c web order with contact and no customer: card checkout, and the shipping and return emails go to the contact address
B2B PO by email tpl-b2b-order AI extracts lines from an email, contract pricing, the credit check passes, the routine assessment is unsure (without the model it always answers 0.5), so the agent router triages and auto-approves; ships, waits for payment
B2B over credit limit tpl-b2b-order cus_contoso is near its limit, so the credit check routes to a person
B2B out of stock tpl-b2b-order meta.simulate: "out_of_stock": the reservation comes up short and the order fails and rolls back
Procurement request tpl-purchase-request Eight laptops: AI classifies spend, manager then finance approve, PO, supplier ack, 3-way match
Reorder (stock review) tpl-reorder The forecast finds SKUs below their reorder point and drafts a replenishment PO
Subscription tpl-subscription Authorize, then a loop of wait → charge → ship
Subscription, card fails tpl-subscription meta.simulate: "charge_fail": the renewal and its retry both fail and the subscription pauses
Storefront order in euros tpl-storefront-order The retail checkout in EUR: USD prices convert at the workspace’s stored EUR rate, and the order, capture and webhooks are in euros
Marketplace order, two sellers tpl-marketplace-order HP-200 from a seller that auto-accepts and KET-01 from one that is asked: the order waits for Kettle & Co, then ships what was accepted and schedules each seller’s payout net of commission. See Marketplace
Buy online, pick up in store tpl-omnichannel-order A monitor held at the SoHo store with a pickup code; the order waits for pickup.collected, then hands it over and captures payment
Ship from store, with an e-book tpl-omnichannel-order The warehouse has no tees, so they ship from the SoHo store, the nearest to the New York ship-to (which carries coordinates); the e-book is delivered as a code, and payment is captured once both parts are done
Split shipment, nearest store tpl-omnichannel-order Eight monitors and three tees to San Francisco: no one place has both, so the monitors ship from the warehouse and the tees from the Mission store, as two shipments
Till sale with a gift card tpl-pos-sale A tee and a gift card at the Mission store: card present, the tee leaves store stock, the gift card gets a code, and the receipt is emailed
Storefront order, returned tpl-storefront-order Ships and captures, then a return: RMA label, restock, refund. A return.requested payload with lines: [{ sku, qty }] restocks only those lines; amount sets a partial refund

The built-in commerce steps read order.meta.simulate, so any order (from the API too) can take a failure path:

Value Effect
out_of_stock Reserve inventory reports every line short
payment_decline Authorize payment takes declined
charge_fail Charge takes failed
three_way_mismatch 3-way match sees an invoice 10% over the PO and takes mismatch

Restarting an order from its page drops meta.simulate, so the retry runs for real.

The stock review runs daily at 06:00 UTC. It scans for SKUs at or below their reorder point and, if there are any, starts one order on tpl-reorder titled Replenish <skus>. Run stock review now on the back office page starts it on demand.