Stock level to zero, product quantity variant update using Shopify Flow

Topic summary

Goal: Automatically set variant inventory to 0 when stock drops to 10 to prevent overselling during product drops, and limit the change to specific products.

Key steps and fixes:

  • Root cause of failures: missing write_inventory permission on the custom app. Store owner approval required. After enabling, the Flow ran successfully.
  • Targeting specific items: add Flow conditions filtering by product/variant ID, handle, or product tag. Use dynamic variables (e.g., {{productVariant.id}}). OP implemented conditions for 9 variants; solution validated.

Alternatives and improvements:

  • Safety stock: Configure a reserved threshold (e.g., 10) so checkout is blocked below that level, mitigating overselling without setting inventory to zero. Link provided.
  • Simpler API calls: Use Flow’s “Send Admin API request” action (handles scopes/API key). For quantity changes, call the Admin GraphQL mutation inventoryAdjustQuantities.
  • Loop prevention: If triggering on inventory updates and then updating inventory, compare before/after quantities to avoid infinite loops.

Additional notes:

  • Screenshots of Flow setup and permissions were shared but are not essential to follow the solution.

Status: OP’s Flow now works for selected variants. Further optimization may include adopting Safety Stock or the new Admin API action. Discussion remains open for refinements.

Summarized with AI on December 21. AI used: gpt-5.

Hey @Bekind24

Do you ticked up write and read inventory permission for your custom app?