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
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:
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 |
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
}Quality Batch Analyzerπ‘ 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.
$$ 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($$);
The default script includes knowledge for common bioreactor parameters. To add your own:
parameterKnowledge object near the top of the script// 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"]
};
summary - Record counts, batch counts, status breakdownreferenceBatch - The identified golden batchbatchRanking - All batches ranked by quality scoreoutOfSpecBatches - Detailed issues with root causesConfirm 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.
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 | β |
| 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 |
After implementing your Quality Batch Golden Record Analysis Tool: