Read Sequence -> Rate Pair -> Set Level -> Check Limit -> Route Sign-Off

Reactor Changeover and Cleaning-Level Advisor

For each product-to-product changeover, the agent recommends whether the reactor needs a rinse, a short clean, or a full clean plus swab. It runs the residue carryover math against the next batch's acceptance limit and shows the number behind the call. Every recommendation goes to a supervisor to review and sign before any cleaning happens.

The Problem

The reactor sat idle four hours for a clean it never needed.

The reactor is the bottleneck, and every changeover is a judgment call. On a Tuesday night shift the crew defaults to a full clean plus swab because nobody wants to risk the next batch. Half the time a rinse would have cleared the carryover limit with room to spare. The other half, a rushed short clean lets residue through and the next batch fails QC.

What Changes

Every changeover gets the right clean, with the number to back it.

The agent reads the planned sequence, looks up each product pair in the cross-contamination risk matrix, and pulls the next batch's acceptance limit and maximum allowable carryover. It recommends the lowest cleaning level that still clears the residue limit, and shows the calculation and a plain reason. A supervisor reviews and signs before the crew touches the reactor.

Humans stay in control: The agent recommends a cleaning level and shows the residue math behind it. Your supervisor reviews the pair, the limit, and the reason, then signs. Nothing gets cleaned or released on the agent's say-so.

HOW THE AGENT WORKS

TRIGGERLLMAPIDECISIONACTIONWAIT
TRIGGERNew changeover in sequenceFires when the production schedule posts a product change on a reactor.
APIPull production sequenceReads previous and next product for the reactor from MES or ERP.
APIRead cross-contamination matrixLooks up the product-pair risk row from the maintained cleaning risk matrix.
APIGet carryover and limitsFetches maximum allowable carryover and the next batch acceptance limit.
LLMAssess pair and levelWeighs pair risk and limits to propose rinse, short clean, or full clean plus swab.
DECISIONResidue limit cleared?
LLMDraft reason and checkWrites the plain reason and the residue calculation behind the recommended level.
ACTIONRoute for supervisor sign-offSends the recommendation and math to the supervisor channel for review and signature.
The agent does not release the reactor or start a clean. Your shift supervisor does. The agent removes the guesswork on which cleaning level clears the carryover limit.

HOW TO BUILD IT

Three levels of depth. Pick the one that matches where you are.

For the ops person who needs to understand what's involved and brief their team.

Your MES / ERPProduct master and schedule
The AgentWorkflow engine + LLM
Supervisor sign-off channelRecommendation and residue check

WHAT YOUR TEAM PROVIDES ONCE

  • Cross-contamination risk matrix - product-pair carryover risk ratings
  • Next-batch acceptance limits - allowed residue in the following product
  • Maximum allowable carryover - MACO inputs per product pair
  • Planned production sequence - reactor order of upcoming batches
  • Equipment list - reactors and their shared cleaning routes
What happens day-to-day: When the schedule posts a product change on a reactor, the agent looks up the pair, pulls the limits, and works out the lowest clean that still clears carryover. It drops a recommendation with the residue number and a short reason into the supervisor channel. The supervisor reads it, adjusts if the situation calls for it, and signs. The crew cleans to the signed level, no more and no less.

For the IT person or technical lead who needs to scope the integration.

INQUIRY SOURCES

MES / ERP schedule
Cleaning risk matrix
Acceptance and MACO limits

WORKFLOW ENGINE (N8N)

Changeover trigger
Pull sequence and pair
Read risk matrix
Assess cleaning level
Check residue limit
Draft reason and math
Route for sign-off

CONNECTS TO

MES / batch system (SAP / Rockwell)Read: product sequence, reactor. Write: none
ERP (SAP / Tally / Oracle)Read: product master, MACO. Write: changeover log
Cleaning risk matrix (spreadsheet / SharePoint)Read: product-pair risk. Write: none
Notification channel (Teams / Slack / email)Read: none. Write: recommendation, sign-off request
WITHOUT PMS API

Without live connections it runs from a CSV export of the schedule and a spreadsheet risk matrix, and the supervisor pastes the next batch limit by hand. Slower, still useful.

WITH PMS API

Connected to the MES sequence, the ERP product master, and the risk matrix, the agent recommends a cleaning level within seconds of the schedule change and shows the live carryover math. Best experience.

For the person who wants to build this agent step by step. Each node below maps to an n8n workflow node.

TRIGGERNode 1
Trigger - watch the schedule
Use an n8n Schedule or Webhook node polling the MES/ERP schedule table for a new product change on a reactor.
Output: { reactor_id, previous_product, next_product, changeover_time }
APINode 2
API - pull pair and limits
HTTP Request node to ERP/MES for product master, MACO, and the next batch acceptance limit.
Output: { previous_product, next_product, maco_mg, acceptance_limit_mg, batch_size_kg }
APINode 3
API - read risk matrix
Read the cleaning risk matrix from a Google Sheet or SharePoint file, filtered to the product pair.
Output: { pair_risk, shared_equipment, prior_default_level }
LLMNode 4
LLM - recommend cleaning level
Use an LLM node (Claude) with the pair risk, MACO, and acceptance limit to propose the lowest clean that clears carryover.
Output: { recommended_level, expected_carryover_mg, cleared, reason, requires_signoff }
You are a cleaning-level advisor for reactor changeovers in a chemical plant. Given a product pair and residue limits, recommend the lowest cleaning level that still clears the carryover limit.

Previous product: {previous_product}
Next product: {next_product}
Pair cross-contamination risk: {pair_risk}
Maximum allowable carryover (mg): {maco_mg}
Next batch acceptance limit (mg): {acceptance_limit_mg}
Next batch size (kg): {batch_size_kg}
Prior default level for this pair: {prior_default_level}

Cleaning levels, lowest to highest: rinse_only, short_clean, full_clean_plus_swab. Choose the lowest level whose expected residue carryover is at or below the acceptance limit. Show the expected carryover in mg and a one line plain reason. Do not release the reactor or start any cleaning.

Respond ONLY with valid JSON. No explanation.
INPUT
Previous product: Product A (pigment paste). Next product: Product B (clear coat resin). Pair risk: medium. MACO 480 mg. Acceptance limit 520 mg. Batch size 2000 kg. Prior default: full_clean_plus_swab.
OUTPUT
{"reactor_id":"R-204","previous_product":"Product A","next_product":"Product B","recommended_level":"short_clean","expected_carryover_mg":310,"acceptance_limit_mg":520,"cleared":true,"reason":"Medium-risk pair; short clean holds expected carryover at 310 mg, under the 520 mg limit.","requires_signoff":true}
DECISIONNode 5
Decision - residue cleared?
IF node comparing estimated carryover against the acceptance limit; if not cleared, escalate the level and re-check.
Output: { cleared: true|false, next_level }
ACTIONNode 6
Action - route for sign-off
Send the recommendation, math, and reason to the supervisor via Slack/Teams/email with an approve/adjust step.
Output: { sent: true, channel, awaiting_signoff: true }
MVP vs Advanced — Where To Start
MVP — START HERE
  • Schedule and matrix from CSV
  • Product pairs in a spreadsheet
  • Manual paste of acceptance limit
  • Single LLM node for level
  • Email the recommendation to supervisor
  • Supervisor signs in the thread
ADVANCED — ADD LATER
  • =+ Live MES schedule trigger
  • =+ ERP product master and MACO pull
  • =+ Matrix synced from SharePoint
  • =+ Carryover math node before LLM
  • =+ Escalation loop on failed limit
  • =+ Signed levels logged back to ERP

Full Video Walkthrough Coming Soon

A night-shift changeover, from planned sequence to a signed cleaning recommendation.

Register to be notified

Everything on this page is free to learn.

When you're ready to build — do it yourself or bring us in.

OTHER AGENTS IN LEASING & MARKETING

Matches recovered solvent to upcoming batches, recommends reuse, top up, or discard.
Reconciles charge versus output, flags abnormal loss, and shortlists likely causes
Flags blanks, unsigned steps, and math errors before the record reaches QA
Drafts the end-of-shift handover with open batches, held items, and overnight alarms

Frequently asked questions

Reactor Changeover and Cleaning-Level Advisor is an AI agent that recommends the minimum reactor clean between two products, with the residue check.
The reactor sat idle four hours for a clean it never needed. The Reactor Changeover and Cleaning-Level Advisor addresses this: recommends the minimum reactor clean between two products, with the residue check.
No. Your team stays in control. The agent does not release the reactor or start a clean. Your shift supervisor does. The agent removes the guesswork on which cleaning level clears the carryover limit.