Skip to content

Create a Quality Batch Golden Record Analysis Tool in Fuuz

Fuuz Wiki Import edited this page Jun 7, 2026 · 1 revision

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, and 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. Open the Application Designer.
  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 — see the attached quality_training_javascript.txt).
  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. Trigger execution from the Source node.
  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
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)

Tip: 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, you can 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, and schedule automated runs for continuous process verification (CPV).

Note: This article includes three downloadable attachments in the original KB — quality_training_dataset.json (the sample biopharma dataset), quality_training_answer_key.json, and quality_training_javascript.txt (the Fuuz Pattern Analyzer script). They can be downloaded from the original KB article.

See Also


Source: support.fuuz.com

🏠 Home

Getting Started (14)
Training Guides (52)

Applications

Access & Users

Data Models & Schema

Screens

Weather Lookup Series — guided 3-part build

Data Flows & Integrations

Data, Reporting & Monitoring

Enterprise & Organizations

Platform Concepts & Architecture (10)
Screens & Application Design (17)
Data Models & Schema (8)
Data Flows & Scripting (51)

Designing Flows

Data Flow Nodes

JSONata Reference

Scripting

Integrations & Connectors (30)

General & iPaaS

Plex

EDI

IIoT & Edge Gateway (18)

Physical Device Connectors

Edge Data Connectors

Reporting, Documents & Dashboards (8)
Administration & Access Control (27)
Data Management (8)
Accelerators, Templates & Packages (8)
Design Standards (1)
How-To Guides (8)
FAQ & Troubleshooting (1)
Release Notes (117)

2026

2025

2024

2023

2022

2021

2020

Policies & Company (6)

Clone this wiki locally