CREATE_OR_GET_PLAN
Creates a plan, or reuses a matching one, for the run. Common fields:name and
description (both interpolated). The rest depends on planType.
RESTOCK
RESTOCK
brandSource and collectionSource are each { kind: "static", … } or
{ kind: "fromTrigger" } (resolve from the triggering entity). deadline is a
date offset.REBALANCE
REBALANCE
outgoingShopId / ingoingShopId (source / destination) are required.MARKDOWN
MARKDOWN
season, startDate, endDate are optional.SUPPLIER_RETURN
SUPPLIER_RETURN
supplierId is the required discriminator for find-or-create; sourceShopId is optional.SUPPLIER_EXCHANGE
SUPPLIER_EXCHANGE
supplierId required; sourceShopId (RETURN side) and destinationShopId (RECEIVE side) optional.planId, planType, planName, isNew — available downstream as
{{steps.<nodeId>.output.planId}} etc.
ADD_ITEMS_TO_PLAN
Adds items to the plan created by aCREATE_OR_GET_PLAN node. Common fields:
| Field | Meaning |
|---|---|
sourcePlanNodeId | The id of the create-plan node this fills. |
planType | Must match the source plan. |
entityFilters | Optional { includeTags, excludeTags } to narrow which entities become items. |
maxItems | Optional hard cap on how many items are added. |
Scopes
- Shop scope (
shopScope):{ kind: "all" },{ kind: "specific", shopIds: [...] }, or{ kind: "fromTrigger" }. (Not used for rebalance — shops come from the plan header.) - Size scope (
sizeScope):{ kind: "all" }or{ kind: "belowStockThreshold", threshold: <n> }.
Strategies
Quantity strategy (restock / rebalance / supplier)
Quantity strategy (restock / rebalance / supplier)
fixed— add a literal quantity per item.fillToTarget— top each item up totarget(only the delta is added).scoreDriven— the data platform’s resolver reads the decision vector to set the quantity (no app-side parameters).
Matching strategy (REBALANCE only)
Matching strategy (REBALANCE only)
scoreDriven routes to the rebalance matching resolver (surplus/deficit/transfer-urgency
scores → bipartite matching of source to destination shops).Discount strategy (MARKDOWN only)
Discount strategy (MARKDOWN only)
fixed— apply a literalpercent(0–100).scoreDriven— the decision layer’s recommended-discount resolver.recommended— decision-layer discount with three bounded knobs; defaults shown (fallbackPercent15,maxDiscountPct70,marginFloorPct0).
Per-plan-type fields
| Plan type | Item config |
|---|---|
RESTOCK | quantityStrategy, shopScope, sizeScope |
REBALANCE | quantityStrategy, sizeScope, matchingStrategy (no shop scope) |
MARKDOWN | discountStrategy, shopScope, sizeScope |
SUPPLIER_RETURN | quantityStrategy, reasonCode (applied to every item) |
SUPPLIER_EXCHANGE | side (RETURN/RECEIVE), quantityStrategy |
addedCount, skippedCount — available as
{{steps.<nodeId>.output.addedCount}}.
Items added by a workflow carry their decision-vector attribution into the plan’s
activity log, and the same
business rules apply as for manual edits.

