Recalculate Reserved Inventory
Recalculate reserved inventory counts for products in the order.
Overview
The Recalculate Reserved Inventory step triggers a full recalculation of reserved inventory for all SKUs in the order. This ensures reserved inventory counts are accurate by recalculating from all open orders.
Identifier
| Property | Value |
|---|---|
| Key | RecalculateReservedInventory |
| Group | Shipments |
Configuration Properties
This step has no configurable properties.
Recommended Settings
Set RunAfterOrderIsSaved to true. This step fetches orders directly from the database rather than using the order passed by the workflow engine, so it must run after the order is persisted to see the latest state.
Behavior
What It Does
- Checks if all order lines are virtual products (skips if so)
- Collects SKU codes from all non-virtual product line items
- Recalculates reserved inventory quantities for the SKU list by checking all open orders
- The service recalculates reserved quantities by checking all orders in non-delivered, non-canceled statuses
Order type config required: Recalculation determines which orders to skip by reading the order type config. Only orders in statuses marked with IsDeliveredStatus: true or IsCanceledStatus: true are excluded. If an order has a status that does not appear in its order type config at all, it will be counted as having reserved inventory — even if the status name semantically implies completion.
Prerequisites
- Order must have non-virtual product line items
- Inventory service must be configured
Side Effects
- Reserved inventory counts are recalculated from order data
- May adjust reserved counts up or down based on actual orders
- Affects all warehouses where the SKUs exist
Business Cases
When to Use
- Inventory correction: When reserved counts have drifted from reality
- After bulk operations: Following imports or bulk updates
- Order modifications: After significant changes to order quantities
- System recovery: After data issues or migrations
Example Scenarios
Scenario 1: Data Correction Reserved inventory counts are incorrect due to a previous bug. Running this step recalculates correct values from current order data.
Scenario 2: Return Processing Order is returned. Step recalculates reserved inventory to reflect the changed order state.
Scenario 3: Order Completion Order marked complete. Step recalculates to ensure reserved counts exclude this now-completed order.
Scenario 4: All Virtual Products Order contains only digital/virtual products. Step returns success immediately without processing.
Error Handling
| Condition | Result | Continues Workflow? |
|---|---|---|
| All virtual products | Success (no action) | Yes |
| No order lines | Warning | Yes |
| Recalculation successful | Success | Yes |
Related Steps
- Increase Reserved Inventory - Incremental reservation
- Reduce Reserved Inventory - Incremental release
