# Real-world scenarios

## Overview

This article walks through the Inventory Replenisher in action, illustrating how it processes a batch of purchase requisition lines, validating each one against configured business rules, creating purchase orders for lines that meet all conditions, and flagging the rest for planner review. It also covers how the system can be triggered manually for visibility into its decision-making, and how it runs as a background worker in normal operation.

### Scenario: Automated Requisition Processing with Mixed Results

This scenario covers a typical replenishment run where the Digital Worker processes a batch of purchase requisition lines, some of which meet all configured conditions and some of which do not.

#### Setup: Configuring Business Rules

Before the Digital Worker runs, administrators configure the business rules that govern which requisition lines can be processed automatically. These rules act as the control center for the replenishment process and can include:

* Supplier validity requirements (only process lines where the supplier is active and approved)
* Minimum order quantity conditions (lines must meet the supplier's MOQ to proceed)
* Price threshold limits (line totals or order values must fall within acceptable ranges)
* Supplier exclusions (automatically reject requisitions from blocked suppliers)
* Freight load grouping logic (how lines should be grouped into purchase orders)

These rules are configured once and applied consistently to every processing run. They can be updated at any time as business requirements change.

#### Normal Operation: Background Processing

In normal operation, the Inventory Replenisher runs on a configured schedule, every hour, every day, every week, or triggered by a specific event. It processes in the background continuously, retrieving planned requisition lines from IFS Cloud, applying the configured business rules, creating purchase orders for valid lines, and notifying planners of any exceptions, all without requiring any manual initiation.

#### Manual Trigger for Visibility

For teams who want to observe the Digital Worker's decision-making process in real time, such as during initial setup or validation, the system can also be triggered manually via Microsoft Teams. When invoked through Teams, the Digital Worker fetches the current planned requisition lines and returns a detailed report showing how each line was evaluated before any purchase orders are created. This gives planners full visibility into which lines matched which conditions and why, so they can verify the logic before instructing the system to proceed.

#### Processing the Requisition Lines

In this example, the Digital Worker is triggered and retrieves 10 purchase requisition lines currently in planned status. For each line, it pulls the part number, ordered quantity, minimum order quantity, supplier details, and pricing, and evaluates every line against the full set of configured business rules simultaneously.

The results come back within seconds:

* 3 lines are valid, each one meets the supplier validity condition, the minimum order quantity condition, and the price threshold condition. These lines are ready to be converted to a purchase order.
* 7 lines are invalid, each one fails one or more conditions. The Digital Worker identifies exactly which condition each line failed and reports this clearly, so planners know precisely what needs to be resolved before those lines can be processed.

#### Purchase Order Creation

The planner reviews the results, confirms the valid lines, and instructs the Digital Worker to proceed. The system auto-releases the three valid lines from planned to released status in IFS Cloud and creates a single purchase order, PO 143, containing all three lines with correct quantities, pricing, and delivery details.

The Digital Worker also applies grouping logic to determine whether these lines should be added to an existing purchase order or require a new one. In this case, a new purchase order is created. This grouping behavior is fully configurable through the Digital Worker's instructions.

The purchase order is immediately visible in IFS Cloud, already created and released. The entire process, from retrieving the 10 lines to creating the purchase order, takes under a minute.

#### Exception Handling

The 7 invalid lines are not silently discarded. The Digital Worker sends a notification via Microsoft Teams with the details of each invalid line and the specific reason it could not be processed. Planners can then address each issue, whether that means updating supplier information, negotiating a minimum order quantity waiver, or deferring the line, and re-run the process once the issues are resolved.

### What This Scenario Illustrates

**The system evaluates every line against every rule simultaneously.** Rather than a planner working through lines one by one, the Digital Worker assesses the full batch in seconds and classifies each line as valid or invalid with clear reasoning.

**Business rules are enforced consistently.** The same conditions apply to every line in every run, regardless of volume or which team member would otherwise have handled it. There is no variation in how rules are interpreted.

**Valid and invalid lines are handled separately.** Valid lines proceed to purchase order creation immediately. Invalid lines are flagged with specific reasons and held for planner review, the two paths are handled in parallel without one blocking the other.

**Planners see the decisions before they're executed.** When using manual trigger mode, planners can review the full evaluation report before any purchase orders are created. This transparency gives teams confidence in the system's logic and makes it easy to identify configuration adjustments if needed.

**Grouping logic reduces unnecessary purchase orders.** The system intelligently decides whether to add lines to an existing purchase order or create a new one, applying freight load optimization to consolidate where possible, reducing transportation costs and administrative overhead.

**The background mode removes the process entirely from planner workload.** Once configured, the Digital Worker runs on schedule without requiring any planner initiation, monitoring, or follow-up for clean lines. Planners only engage when exceptions require their judgment.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kb.theloops.io/digitalworkers/ifs-loops-digital-workers/digital-worker-guides/inventory-replenisher/core-concepts/real-world-scenarios.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
