Try Reallocate on Cancel
Reallocate an order to the nearest warehouse with stock when a fulfillment location cancels.
Overview
The Try Reallocate on Cancel step handles order reallocation when a fulfillment location cancels an order or shipment. It finds the nearest available warehouse based on zip code and transfers the order there, typically restarting the workflow from the beginning.
Identifier
| Property | Value |
|---|---|
| Key | TryReallocateOnCancel |
| Group | Reallocate |
| Applicable Statuses | New |
Configuration Properties
| Property | Type | Required | Description |
|---|---|---|---|
retryLimit | number | No | Maximum number of reallocation attempts |
StoreRoles | string | No | Filter eligible warehouses by role |
Behavior
What It Does
- Checks if reallocation should be skipped (
context.SkipReallocation) - Uses zip code proximity to find the nearest warehouse with stock
- If successful, logs an event and triggers status change back to "New"
- Sets
CancelWorkflow = trueto stop current workflow and restart
Prerequisites
- Order must have sufficient inventory somewhere in the network
context.SkipReallocationmust not be set to true
Side Effects
- Changes warehouse assignment
- Records reallocation event with from/to warehouses
- Triggers status change to "New" to restart order processing
- Cancels the current workflow to prevent further steps
Business Cases
When to Use
- Store cancellation: When a store can't fulfill a click-and-collect order
- Out of stock discovery: When picking reveals inventory discrepancy
- Capacity issues: When a warehouse can't handle the order in time
Example Scenarios
Scenario 1: Store Cancellation A store cancels a click-and-collect order. The step finds the next closest store with stock and reassigns the order.
Scenario 2: Retry Limit
Configure retryLimit = 3 to prevent infinite reallocation loops if multiple locations cancel.
Scenario 3: Skip Reallocation
If context.SkipReallocation = true (set by previous logic), the step does nothing.
Error Handling
| Condition | Result | Continues Workflow? |
|---|---|---|
| Reallocation skipped | Success | Yes |
| No alternative warehouse | Warning | Yes |
| Successful reallocation | Success (triggers New status) | No (cancels workflow) |
Related Steps
- Try Reallocate on Cancel Using Geo Location - Uses coordinates instead of zip
- Set Try Reallocate Deadline - Sets automatic trigger for this
