Create a Quality Batch Golden Record Analysis Tool in Fuuz

Create a Quality Batch Golden Record Analysis Tool in Fuuz

Article Type: Configuration / How-To
Audience: Solution Architects, Application Developers, Quality Engineers
Module: Fuuz Script Editor / Transform Nodes
Industry: Biopharmaceutical, Life Sciences, Cell & Gene Therapy
Estimated Time: 30-45 minutes
Last Updated: January 2026

1. Overview

This guide walks you through creating a Quality Batch Golden Record Analysis Tool in Fuuz. When complete, your tool will automatically analyze batch record data to identify the best-performing "golden" reference batch, detect out-of-spec conditions, and recommend corrective actions based on root cause analysis.

The tool you build will:

  • Process batch record data from any connected data source
  • Automatically identify the highest-quality "golden" reference batch
  • Detect statistical deviations across all process parameters
  • Map deviations to probable root causes with corrective action recommendations
  • Generate structured JSON output for dashboards, reports, or downstream workflows

Script Editor - including large batch dataset, machine telemetry and U/L limits - output includes insights & deviations

2. Prerequisites

Before you begin, ensure the following requirements are met:

Requirement Details
Fuuz Access Application Designer or Developer role with access to Script Editor
Data Source Batch record data available via REST, MQTT, database, or file connector
Data Structure JSON records with batch identifier and numeric process parameters
Minimum Data At least 5 batches with 100+ records per batch recommended
Skills Basic familiarity with Fuuz workflows and JavaScript syntax

2.1 Required Data Format

Your batch record data must include these fields:

Field Type Description
batch String Unique batch identifier (required)
ts ISO DateTime Timestamp for each record (recommended)
phase String Process phase (e.g., Inoculation, Exponential, Stationary)
[Tag-xxx] Number Process parameters (TT-001, AT-001, PT-001, etc.)

Example record:

{
"batch": "BRX-2024-1847",
"ts": "2024-03-15T08:30:00Z",
"phase": "Exponential",
"eq": "BR-001",
"TT-001": 37.02,
"AT-001": 7.21,
"AT-002": 45.3,
"AT-010": 8.5,
"ST-001": 150
}

3. Step-by-Step Procedure

Step 1: Create a New Flow

  1. Navigate to your Fuuz application in the Designer
  2. Click Application Designer in the left navigation panel
  3. Click + New Data Flow and name it Quality Batch Analyzer

Step 2: Add Your Data Source

  1. Drag a Source node onto the flow canvas
  2. Configure the connector to retrieve your batch record data:
    • REST API: Configure endpoint URL and authentication
    • Database: Write a query to select batch records
    • MQTT: Subscribe to the batch data topic
    • File: Point to your JSON data file
  3. Test the connection to verify data is retrieved successfully

πŸ’‘ Tip: For testing, you can use the Fuuz sample biopharma training dataset which contains 20 batches with 11,520 records and intentional quality variations. These samples are attached to this article.


Step 3: Add a Transform Node

  1. Drag a Javascript Transform node onto the canvas
  2. Connect the output of your Source to the Transform input
  3. Double-click the Transform node to open the configuration panel
  4. Click Script Editor to access the JavaScript editor

Step 4: Add the Pattern Analyzer Script

  1. In the Script Editor, delete any existing code
  2. Copy and paste the complete Fuuz Pattern Analyzer script (provided separately)
  3. The script expects data in the $$ variable (full payload)

Script structure overview:

// The script contains these main components:

// 1. Parameter Knowledge Base - Maps tag prefixes to root causes
var parameterKnowledge = {
"TT-": { name: "Temperature", highCauses: [...], lowCauses: [...] },
"AT-001": { name: "pH", variabilityCauses: [...] },
// ... additional parameters
};

// 2. Statistical Functions - Calculate mean, std dev, CV, z-scores
function calculateStats(values) { ... }

// 3. Golden Batch Identification - Scores batches by quality
function findGoldenBatch(batchStats) { ... }

// 4. Deviation Detection - Identifies out-of-spec conditions
function detectDeviations(batchData, globalStats) { ... }

// 5. Root Cause Mapping - Links deviations to probable causes
function mapRootCauses(deviation, paramInfo) { ... }

// 6. Main Analysis - Orchestrates the full analysis
return analyzeData($$);

Step 5: Customize Parameter Knowledge (Optional)

The default script includes knowledge for common bioreactor parameters. To add your own:

  1. Locate the parameterKnowledge object near the top of the script
  2. Add entries for your custom tag prefixes:
// Add custom parameter definitions
parameterKnowledge["WT-"] = {
name: "Weight",
highCauses: ["Scale drift", "Tare error", "Material buildup"],
lowCauses: ["Incomplete fill", "Leak detected", "Calibration needed"],
highActions: ["Verify scale calibration", "Check tare procedure"],
lowActions: ["Inspect fill system", "Check for leaks"]
};

parameterKnowledge["LT-"] = {
name: "Level",
highCauses: ["Overfill condition", "Sensor fouling"],
lowCauses: ["Low feed rate", "Drain valve issue"],
variabilityCauses: ["Control loop oscillation", "Pump pulsation"]
};

Step 6: Configure Output Handling

  1. Add an output node to handle the analysis results:
    • REST API: POST results to a quality management system
    • Database: Store results in a batch analysis table
    • Notification: Send alerts for OUT_OF_SPEC batches
    • Dashboard: Feed results to a real-time quality dashboard
  2. Connect the Transform output to your chosen destination

Step 7: Test the Flow

  1. Click Save to save your workflow
  2. Click Button on Source to execute the workflow
  3. Review the Transform output in the execution log
  4. Verify the output contains:
    • summary - Record counts, batch counts, status breakdown
    • referenceBatch - The identified golden batch
    • batchRanking - All batches ranked by quality score
    • outOfSpecBatches - Detailed issues with root causes

4. Verification

Confirm your implementation is working correctly:

Check Expected Result Status
Data source connects Batch records retrieved with numeric parameters ☐
Script executes without errors No JavaScript errors in execution log ☐
Golden batch identified referenceBatch contains batch ID and score ☐
Batches ranked correctly All batches appear in batchRanking with scores ☐
Deviations detected OUT_OF_SPEC and WARNING batches include issue details ☐
Root causes mapped Each deviation includes rootCauses and correctiveActions ☐
Output delivered Results arrive at configured destination (API, DB, dashboard) ☐

βœ“ Success: When all checks pass, your Quality Batch Golden Record Analysis Tool is ready for production use.

5. Example Output

Here is sample output from analyzing a 20-batch bioreactor dataset:

Batch ID Status Primary Issue Root Cause
BRX-2024-1847 β˜… GOLDEN None β€”
BRX-2024-1862 OUT_OF_SPEC Temp HIGH +3.1Οƒ Cooling valve malfunction
BRX-2024-1867 WARNING DO LOW -2.7Οƒ Insufficient aeration capacity
BRX-2024-1855 GOOD None β€”

6. Troubleshooting

Problem Possible Cause Solution
"No batches found" Missing batch field Verify data includes a batch identifier on each record
"No numeric fields" Parameters stored as strings Ensure parameter values are numeric, not quoted strings
All batches show GOOD Thresholds too permissive Adjust deviation threshold (default 1.5Οƒ) to be more sensitive
Script timeout Dataset too large Filter data to recent batches or increase workflow timeout
Unknown parameters Custom tags not in knowledge base Add entries to parameterKnowledge for your tag prefixes

7. Next Steps

After implementing your Quality Batch Golden Record Analysis Tool:

  • Build a dashboard to visualize batch rankings and quality trends over time
  • Configure alerts to notify quality teams when OUT_OF_SPEC batches are detected
  • Integrate with your QMS to automatically create deviation records
  • Expand the knowledge base with process-specific root causes and corrective actions
  • Schedule automated runs for continuous process verification (CPV)
  • Fuuz Script Editor Reference Guide
  • Transform Node Configuration
  • Working with Data Connectors
  • Biopharma Training Dataset Download
  • Contact Support
    • Related Articles

    • How to create a simple Integration and Store data in Fuuz

      In this video, our engineer illustrates to other team members, how to go about calling a generic Stock Price API Get and then storing those values in Fuuz using a simple create mutation. All of this is done using our standard iPaaS capabilities which ...
    • Connecting a Vending Machine to your ERP system using Fuuz

      In this video - one of our engineers shows you step by step, how you can connect a shop floor vending machine using the Fuuz Platform to your Cloud based ERP. In this use case, we showcase, connecting Plex with our shop floor vending machines to ...
    • How to Create APIs Using Data Flows in Fuuz

      How to Create APIs Using Data Flows in Fuuz Estimated Time: 5–7 minutes Skill Level: Intermediate Overview This guide explains how to create RESTful APIs using Data Flows in Fuuz. Unlike the GraphQL-based method covered in a previous tutorial, this ...
    • How to Create a RESTful API Using the Fuuz Platform

      Estimated Time: Under 5 minutes Skill Level: Beginner to Intermediate <br> Here’s the revised how-to article with the use of β€œcons” or conversational filler words removed, making it more formal and suitable for a knowledge base: How to Create a ...
    • Python and Fuuz Data Flows

      Fuuz does not natively support Python Scripting within our framework. However, you can execute remote python scripts using our RestAPI integrations Continue reading for a better understanding of why we have opted to not support Python natively within ...