{
  "schema_version": 1,
  "workflow_id": 8,
  "slug": "pos-restock-alert",
  "environment": "Shopify development store, Basic plan, one location",
  "tested_on": "2026-11-19",
  "method": "Installed Shopify's official 'Send notifications for out of stock variants at a single location' template. With Sidekick: matched the location by ID, set a threshold of 5 (alert) and 6 (restocked), changed the alert condition to NONE of the variant metafields flow_stock.variant_out_of_stock == true, set the recipient, and added product, variant, SKU, location and available quantity to both emails. Renamed to POS Restock Alert. Workflow turned on. Inventory was changed in Shopify admin Inventory. Results were read from Shopify Flow run details, including the rendered email input.",
  "test_orders": {
    "NIKE | SWOOSH PRO FLAT PEAK CAP": "1 variant at the selected location: 4 -> 3 -> 2 -> 6, then restored to 4",
    "NIKE | TODDLER ROSHE ONE size 4": "13 -> 12, then restored to 13"
  },
  "configuration": {
    "trigger": "Product variant inventory quantity changed",
    "alert_condition": "ANY inventoryLevel (available <= 5 AND location.id == configured location) AND NONE variant metafield (flow_stock.variant_out_of_stock == true)",
    "alert_actions": "Send internal email to ops@example.com 'Restock needed: {{product}} - {{variant}}'; set variant metafield flow_stock.variant_out_of_stock = true",
    "restocked_condition": "ANY inventoryLevel (available >= 6 AND location.id == configured location) AND ANY variant metafield (flow_stock.variant_out_of_stock == true)",
    "restocked_actions": "Send internal email 'Restocked: {{product}} - {{variant}}'; set variant metafield flow_stock.variant_out_of_stock = false"
  },
  "runs": [
    {
      "case": "selected location low",
      "event": "Cap available 4 -> 3, variant had no flow_stock metafield",
      "run_status": "Completed",
      "result": "2 completed. Condition true (available 3, location matched, metafield list empty). Email input rendered product, variant, SKU, location name and 'Available: 3'. Metafield set to true.",
      "expected": "Send alert",
      "pass": true
    },
    {
      "case": "repeat below threshold",
      "event": "Cap available 3 -> 2",
      "run_status": "Completed",
      "result": "None. Alert condition false because the metafield was already true. Restocked condition false (available below 6). No second email.",
      "expected": "No repeat alert",
      "pass": true
    },
    {
      "case": "restocked",
      "event": "Cap available 2 -> 6",
      "run_status": "Completed",
      "result": "2 completed. Restocked condition true (available 6, metafield true). Restocked email sent. Metafield set to false.",
      "expected": "Send restocked email and reset",
      "pass": true
    },
    {
      "case": "selected location healthy",
      "event": "ROSHE size 4 available 13 -> 12",
      "run_status": "Completed",
      "result": "None. Available 12 is above 5 and no restock memory exists.",
      "expected": "No alert",
      "pass": true
    }
  ],
  "not_run": [
    {
      "case": "different location low",
      "reason": "The test store has one location."
    },
    {
      "case": "missing configured location",
      "reason": "Not run. With no matching inventory level, both ANY conditions are false by construction, so no email is sent; the workflow does not report the configuration issue."
    }
  ],
  "limits": "The location ID and threshold are this test store's values; a merchant must replace gid://shopify/Location/57257525424 and the 5/6 thresholds after import. The original Shopify template only alerted when the metafield already existed with value false, so a variant that never had the metafield never alerted; the shipped version uses NONE ... == true to fix this. Restoring the cap to 4 after testing triggered one more alert, as designed."
}
