Build an inventory replenishment process that automatically replenishes product items based on their applicable inventory replenishment policies. Use a preconfigured batch job definition and create a flow to schedule and invoke the replenishment process.
Required Editions
| Available in: Lightning Experience |
| Available in: Automotive Cloud, Communications Cloud, Consumer Goods, Energy and Utilities Cloud, Manufacturing Cloud, Service Cloud, and Media Cloud. View edition availability. |
Key Components of an Automated Replenishment Process
You can build an automated inventory replenishment process by using these capabilities.
- Flow: Flow Builder is a declarative tool for building complex automated workflows. Inventory Replenishment comes with a preconfigured flow called Replenish Inventory. See Automate Tasks with Flows.
- Batch Jobs: Batch Management helps flows process a large number of records. Inventory Replenishment comes with a preconfigured batch job definition called Replenish Inventory. Batch Management.
Workflow of an Automated Replenishment Process
An automated process periodically replenishes your inventory in batches. Here are the high-level steps in the workflow of the automated process.
| stage | purpose | Implementation |
|---|---|---|
| 1 | A schedule-triggered flow runs at regular intervals to invoke a batch job. | Create a schedule-triggered flow. |
| 2 | A batch job creates batches of product items to be processed in another flow. | Use the preconfigured Replenish Inventory batch job definition or create a batch job definition. |
| 3 | A flow processes one product item in a batch at a time. It identifies the product item's applicable policy, determines if the product item requires replenishment, and performs replenishment actions accordingly. | Use the preconfigured Replenish Inventory flow or create a flow. |
Flow to Periodically Run a Replenishment Process
For your automated inventory replenishment process, create a schedule-triggered flow that invokes the replenishment batch job.
- From Setup, go to Flows, and click New Flow.
- Select Schedule-Triggered Flow.
- Configure the Start element:
- Set the start date and time.
- Define the run frequency (for example, daily).
- Add an Action element.
- Select the Replenish Inventory batch job definition.
- Save and activate the flow. The flow runs at scheduled intervals and invokes the batch job, which processes product items and performs replenishment based on applicable policies
Batch Job to Process Product Items
For your automated inventory replenishment process, use the preconfigured Replenish Inventory batch job definition or create a batch job definition.
The preconfigured batch job processes product items in batches and invokes the Replenish Inventory autolaunched flow to perform replenishment actions.
You can create a custom batch job definition to process product items based on specific criteria.
When creating a batch job, configure these fields:
- Process Type: Flow
- Group: Inventory
- Execution Process: A flow that replenishes inventory, such as Replenish Inventory
- Flow Input Variable: A variable for Product Item ID
- Object: Product Item
Define the filter criteria for adding product items to batches. For example, you can filter product items with the Compactor D21 product to be added to batches.
Track the progress and status of batch job runs by using Monitor Workflow Services in Setup. See Monitor Your Batch Jobs .
Flow to Replenish Inventory
Inventory Replenishment includes a prebuilt autolaunched flow named Replenish Inventory. This flow is used internally by the batch job to process product items. Don't modify this flow.
The Replenish Inventory flow evaluates each product item based on its applicable inventory replenishment policy. It uses the Replenish Inventory Using Policy invocable action to determine whether replenishment is required. The flow evaluates inventory based on the Replenishment Quantity Basis field in the policy, which determines whether to use Quantity On Hand or Quantity Available for replenishment decisions.
When you configure a replenishment policy, the Replenishment Quantity Formula must reference the quantity field that matches your Replenishment Quantity Basis:
Basis: Quantity On Hand
MaximumInventoryQuantity - ProductItem.QuantityOnHand
Use this basis if you want replenishment to be based on total physical stock regardless of usability.
Basis: Quantity Available
MaximumInventoryQuantity - ProductItem.QuantityAvailable
Use this basis if you want replenishment to automatically account for unusable stock, such as damaged or expired inventory, without adjusting your formula. Quantity Available excludes both unusable and allocated quantities.
If the evaluated quantity is less than or equal to the minimum inventory quantity defined in the policy, the flow performs the configured replenishment action, such as creating a product request. The flow also determines the replenishment quantity and source location based on the policy.
To process a product item individually for testing or troubleshooting, you can run the Replenish Inventory flow.