Cut batch release from days to hours — stream electronic batch record data from MES, QC results from LIMS, and process telemetry from the line into one release decision, with deviations routed to QMS and only exceptions reaching a human reviewer. Shop-floor scope, GxP throughout.
Manufacturing and QC: MES, LIMS, and Batch Release by Exception
Objective: Compress batch release cycle time by assembling the electronic batch record, QC results, and process telemetry into a single reviewable decision, so quality reviews exceptions rather than re-reading a compliant batch. Every flow here is GxP — the integration is part of the validated system, not a convenience layer beside it.
What's Getting Built
- MES batch record (System API) — wraps the MES electronic batch record and maps MES order and batch identifiers to a canonical batch ID ·
GET /batches/{batchId}, LISTEN batch-completed, GET /orders/{orderId}
- LIMS QC results (System API) — exposes QC results with the specification version each was judged against ·
GET /results?batchId={id}, GET /specifications/{specVersion}
- Process telemetry (System API) — ingests OPC UA / MQTT line telemetry with edge buffering and aggregates it to a release summary ·
SUBSCRIBE mqtt/telemetry, OPC UA READ, GET /telemetry/summary?batchId={id}
- Batch release (Process API) — assembles the batch record on the canonical batch ID, evaluates versioned release criteria, and routes exceptions ·
POST /batches/{id}/assemble, GET /batches/{id}/release-summary, POST /batches/{id}/release
- QMS deviation and CAPA (target) — creates deviations for out-of-specification results and excursions and blocks release while one is open ·
POST /deviations, GET /deviations?batchId={id}
- ERP release to stock (target) — posts the release as an idempotent usage decision so stock becomes available exactly once and publishes a batch-released event ·
POST /usage-decisions, PUBLISH batch-released
Value chain phase
Phase 04 — Manufacturing & QC. Scaling up drug production safely while adhering to strict quality controls.
- Scope of this plan: Shop-floor to quality: batch record assembly, QC result integration, deviation routing, and the release handoff to ERP.
- Data in this phase: Manufacturing Execution Systems (MES), LIMS, and IoT sensor telemetry.
- Receives from: Phase 03 — Regulatory & Compliance.
- Hands off to: Phase 05 — Supply Chain & Logistics.
Prerequisites
- Anypoint Platform org with API Manager and a non-production deployment target.
- Secrets Manager or secure properties configured for every regulated system credential.
- Named validation owner — GxP flows need a change-control path agreed before the first deployment.
- MES with API or database access to electronic batch records, and agreement on which records are release-relevant.
- LIMS with result and specification access, including the specification version applied to each test.
- Historian, OPC UA gateway, or MQTT broker for process telemetry, reachable from a network-segmented runtime.
- QMS (Veeva Vault QMS, TrackWise, or equivalent) for deviations and CAPA, and ERP for release-to-stock posting.
Choose your path
- Review by exception — Choose when the MES batch record is trusted and complete — integration evaluates release criteria and routes only deviations to a reviewer.
- Assembled release dossier — Choose when batch data is spread across MES, LIMS, and paper-replacement systems — integration assembles the dossier for a human release decision.
Platform notes
MES (PAS-X, PharmaSuite, Opcenter)
- Batch record completion events are the natural trigger; polling a batch table invites reading a record mid-write.
- Order and batch identifiers differ from ERP's — map both directions explicitly at the System API.
LIMS (LabWare, LabVantage, STARLIMS)
- Pull the result and the specification version it was judged against — a pass against a superseded spec is not a pass.
- Out-of-specification results follow their own investigation workflow; never let the integration treat one as a plain failure.
Process telemetry (OPC UA / MQTT)
- Keep OT connectivity one-way into IT wherever the network model allows, and buffer at the edge for link loss.
- Aggregate telemetry to the release-relevant summary — excursion counts and durations — rather than shipping raw samples into the release decision.
Architecture
1. Business requirements
- Release conforming batches without a reviewer re-reading every page of the record.
- Surface every deviation, out-of-specification result, and process excursion against the batch it affects.
- Give supply planning a reliable release signal instead of a phone call.
- Keep the whole decision reconstructable for an inspector years later.
2. Shop-floor connectivity
- Wrap MES, LIMS, historian, and QMS in System APIs, each owning one source and one identity mapping.
- Respect the ISA-95 layering — telemetry aggregates on its way up, and control commands do not flow back down from this integration.
- Buffer at the edge so a network interruption delays data rather than losing it.
- Timestamp everything at source with an unambiguous timezone; batch records are legal documents.
3. Batch record assembly
- Assemble on batch completion, keyed on the canonical batch ID rather than the MES order number.
- Attach QC results with their specification version, analyst, and instrument.
- Attach the telemetry summary — critical process parameter ranges, excursions, and durations.
- Mark the record incomplete and hold it when any expected input has not arrived, rather than releasing on partial data.
4. Release by exception
- Encode release criteria as versioned, reviewable rules — not as conditions buried in a flow.
- Auto-advance batches meeting every criterion to the reviewer's approval queue with the evidence attached.
- Route any deviation, out-of-specification result, or excursion to QMS with the batch context.
- Require electronic signature for the release decision itself; the integration prepares it, a person makes it.
5. Deviation and ERP handoff
- Create the deviation in QMS with source references, and track its state back onto the batch.
- Block release while an open deviation or CAPA is linked to the batch.
- Post the release to ERP as a usage decision so stock becomes available exactly once.
- Publish a batch-released event for serialization, supply, and the value chain backbone.
6. Security and GxP compliance
- Validate the integration under GAMP 5 — requirements, design, IQ/OQ/PQ evidence, and a traceability matrix retained for inspection.
- Meet 21 CFR Part 11 and EU Annex 11 for electronic records and signatures on every GxP-relevant flow.
- Preserve ALCOA+ data integrity — attributable, legible, contemporaneous, original, and accurate — with audit trails no operator can edit.
- Encrypt regulated data in transit and at rest, and keep production payload visibility to validated support roles only.
- Treat a mapping change on a GxP flow as a controlled change under change management, never as a hotfix.
- Release criteria are validated configuration — changing a threshold is a controlled change with re-validation, not a config tweak.
- The integration must never modify a batch record; it reads, assembles, and hands a decision to a qualified person.
For pre-built API specifications, implementation templates, and reference architecture, see the MuleSoft Accelerator for Life Sciences on Anypoint Exchange.
Sample payload — Assembled batch release summary
{
"batchCanonicalId": "BATCH-000184922",
"productCanonicalId": "PROD-00931",
"site": "EU02",
"mes": { "orderId": "EU02-24-0918", "recordComplete": true, "completedAt": "2026-07-30T22:41:00Z" },
"qc": [
{ "test": "ASSAY-HPLC", "result": 99.2, "unit": "%", "specVersion": "SPEC-0093-v7", "status": "PASS" },
{ "test": "WATER-KF", "result": 0.41, "unit": "%", "specVersion": "SPEC-0093-v7", "status": "PASS" }
],
"telemetry": { "criticalParameters": 14, "excursions": 0, "longestExcursionMinutes": 0 },
"deviations": [],
"recommendation": "ELIGIBLE_FOR_RELEASE"
}
Testing and validation
- Complete a conforming test batch and confirm it reaches the reviewer queue with QC, telemetry, and specification versions attached.
- Introduce an out-of-specification result and confirm the batch is held and a QMS deviation is created with batch context.
- Withhold one LIMS result and confirm the record is marked incomplete rather than released on partial evidence.
- Approve a release and verify exactly one ERP usage decision is posted and one batch-released event published.
- Replay the batch-released event and confirm no second stock posting occurs.
Phased rollout
Phase 1 — Connect
- Wrap MES and LIMS with System APIs in a qualified non-production environment and prove identity mapping both ways.
- Establish telemetry ingestion with edge buffering and confirm no path exists back down to control systems.
Phase 2 — Map and validate
- Run one product family through assembly and review-by-exception in parallel with the existing process.
- Complete IQ/OQ/PQ evidence and the traceability matrix for the release-relevant flows before cutover.
Phase 3 — Production
- Cut over one line at a time, keeping the prior release path available until cycle-time gains are confirmed.
- Move rule change management into the quality change-control process with a named owner.
Success metrics
- Batch release cycle time reduced against the validated baseline, measured from batch completion to stock availability.
- Share of batches released without manual page-by-page review, trending up per product family.
- Zero batches released with an open deviation or a superseded specification version.
- Every release decision reconstructable end to end from the audit trail.
Troubleshooting
- Batch assembles with missing QC results — Likely cause: assembly triggered on MES completion before LIMS finished testing. Fix: Hold assembly until every expected test reports, with an aging alert rather than a timeout release.
- A result passes against the wrong specification — Likely cause: specification version not captured with the result. Fix: Require spec version on every result and fail assembly when it is absent.
- Duplicate ERP stock postings — Likely cause: release event consumed more than once without idempotency. Fix: Key the usage decision on canonical batch ID and check for an existing posting before creating one.
- Telemetry gaps during a network interruption — Likely cause: no edge buffering between the OT network and the runtime. Fix: Buffer at the edge with store-and-forward and reconcile the gap before assembly completes.
Deliverable: A GxP-validated integration assembling MES batch records, LIMS results, and process telemetry into a review-by-exception release decision, with deviations routed to QMS and release posted to ERP exactly once.