🏭 Manufacturing Use Case: Predictive Maintenance & Next-Best-Action
Decision Question
Based on live sensor data from a factory machine, what is the best maintenance action to take right now?
Use Case Scenario
A manufacturing company monitors three production lines: A, B, and C. Each line can have a status of Up, Down, or Idle.
A Random Forest model was developed in a Python Notebook (MS Fabric) using example data from Microsoft documentation. This example data was enhanced with synthetic AI-generated data to better reflect predictive maintenance scenarios.
How It Works
Data streams from IoT sensors are fed into a machine learning model that predicts the following:
- Remaining useful life, or
- Probability of failure within the next 24 hours.
The Decision Flow in SAS Decision Builder takes this prediction and applies rulesets to determine the next best action:
- If failure probability > 80% and the production line is idle → automatically schedule emergency maintenance.
- If probability is 40–80% → create a standard work order for the next planned downtime.
- Other tool wear and power events are considered using rules.
Completed Decision Flow

Input/Output Variables
Random Forest Model (Training & Prediction)
The model consumes multiple IoT sensor readings and outputs a prediction (0 or 1).
Input/Output Variables for the Python Random Forest model training and prediction in MS Fabric

Decision Flow Inputs
- Air_temperature_K
- Line_status
- Process_temperature_K
- Product_ID
- Production_line
- Rotational_speed_rpm
- Tool_wear_level
- Tool_wear_minutes
- Torque_Nm
- UDI
On the Decision Flow variables tab, many outputs can be generated based on prediction model and rules. The user controls output variables.

Branching
From the Random Forest model, output for prediction that is either 1 or 0. We can use this information in a logic branch to refine subsequent decision logic.

There are other branches in the decision logic using line status to determine whether a given line in up, down or idle. Here is the “Line is Down” branch is used to branch on a yes/no path. On the No path, another branch called “Line Status” is used to check if idle. The user may vary the branching logic for their prediction maintenance logic.

Business Rulesets and Rules (A ruleset contains one or more rules. )
A business ruleset named production_line_idle is used to determine the status of production line A, B and C. Line A is shown below and rules for production lines B and C are the same respectively in this ruleset. It is considered a best practice to give rulesets and rules meaningful names.

Rules checking for tool wear failure.

Emergency maintenance rule. Use the model probability of failure combined with the line being idle.

💡 Best Practice: Always use meaningful names for rulesets and rules for clarity and maintainability.
Run the decision flow in SAS Decision Builder


View table (partial view here) in OneLake (this is where MS Fabric writes all your data)
From the model, when prediction = 1 => failure

We can see in the result table, tool wear failure is captured using business rules. This is only an example and a customer can create whatever business logic is necessary for production.

We can also see that one of the production lines is ready for Scheduled standard maintenance.

There are also cases of power failure based on rule logic and an alert to review power failure and maintenance.

Conclusion
The Predictive Maintenance – Next Best Action Flow demonstrates how manufacturers can combine machine learning with decision rules to automate maintenance scheduling.
Key takeaways:
- ML predictions provide powerful insights, but rules capture operational nuances.
- Decision flows can be customized per customer, aligning with production priorities.
- This approach helps manufacturers minimize unplanned downtime while ensuring maintenance is scheduled effectively.
- Any decision flow can be designed specifically and uniquely for any customer.