Skip to main content
The two plan-building actions create (or reuse) a plan and then fill it. The other two actions — webhook and email — are on the Integrations page.

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.
{
  "actionType": "CREATE_OR_GET_PLAN",
  "planType": "RESTOCK",
  "brandSource": { "kind": "static", "brandId": "<uuid>" },
  "collectionSource": { "kind": "static", "collectionId": "<uuid>" },
  "deadline": { "kind": "relative", "offsetDays": 30 }
}
brandSource and collectionSource are each { kind: "static", … } or { kind: "fromTrigger" } (resolve from the triggering entity). deadline is a date offset.
{
  "planType": "REBALANCE",
  "outgoingShopId": "<uuid>",
  "ingoingShopId": "<uuid>",
  "collectionSource": { "kind": "fromTrigger" },
  "deadline": { "kind": "relative", "offsetDays": 14 }
}
outgoingShopId / ingoingShopId (source / destination) are required.
{
  "planType": "MARKDOWN",
  "season": "SS26",
  "startDate": { "kind": "relative", "offsetDays": 0 },
  "endDate": { "kind": "relative", "offsetDays": 30 },
  "collectionSource": { "kind": "fromTrigger" }
}
season, startDate, endDate are optional.
{ "planType": "SUPPLIER_RETURN", "supplierId": "<uuid>", "sourceShopId": "<uuid>", "deadline": { "kind": "relative", "offsetDays": 21 } }
supplierId is the required discriminator for find-or-create; sourceShopId is optional.
{ "planType": "SUPPLIER_EXCHANGE", "supplierId": "<uuid>", "sourceShopId": "<uuid>", "destinationShopId": "<uuid>", "deadline": { "kind": "relative", "offsetDays": 21 } }
supplierId required; sourceShopId (RETURN side) and destinationShopId (RECEIVE side) optional.
Output: planId, planType, planName, isNew — available downstream as {{steps.<nodeId>.output.planId}} etc.

ADD_ITEMS_TO_PLAN

Adds items to the plan created by a CREATE_OR_GET_PLAN node. Common fields:
FieldMeaning
sourcePlanNodeIdThe id of the create-plan node this fills.
planTypeMust match the source plan.
entityFiltersOptional { includeTags, excludeTags } to narrow which entities become items.
maxItemsOptional 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

{ "kind": "fixed", "quantity": 10 }
{ "kind": "fillToTarget", "target": 50 }
{ "kind": "scoreDriven" }
  • fixed — add a literal quantity per item.
  • fillToTarget — top each item up to target (only the delta is added).
  • scoreDriven — the data platform’s resolver reads the decision vector to set the quantity (no app-side parameters).
{ "kind": "fixed" }
{ "kind": "scoreDriven" }
scoreDriven routes to the rebalance matching resolver (surplus/deficit/transfer-urgency scores → bipartite matching of source to destination shops).
{ "kind": "fixed", "percent": 30 }
{ "kind": "scoreDriven" }
{ "kind": "recommended", "fallbackPercent": 15, "maxDiscountPct": 70, "marginFloorPct": 0 }
  • fixed — apply a literal percent (0–100).
  • scoreDriven — the decision layer’s recommended-discount resolver.
  • recommended — decision-layer discount with three bounded knobs; defaults shown (fallbackPercent 15, maxDiscountPct 70, marginFloorPct 0).

Per-plan-type fields

Plan typeItem config
RESTOCKquantityStrategy, shopScope, sizeScope
REBALANCEquantityStrategy, sizeScope, matchingStrategy (no shop scope)
MARKDOWNdiscountStrategy, shopScope, sizeScope
SUPPLIER_RETURNquantityStrategy, reasonCode (applied to every item)
SUPPLIER_EXCHANGEside (RETURN/RECEIVE), quantityStrategy
Output: 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.