See llms.txt for all machine-readable content.

Back to Templates

Track production OEE and corrective actions with Sheets, Gmail, Telegram, and GPT-4o

OEE numbers are only useful if someone acts on them. This workflow takes each shift's production numbers from a webhook, calculates availability, performance, quality and OEE, has GPT-6.1-sol explain what dragged it down, and turns bad shifts into tracked corrective actions with owners, due dates and reminders. Morning and Monday digests keep the plant manager in the loop.

Last updated: November 2026.

Quick Overview

A POST with line, shift, planned and run minutes, units produced and defects is normalized and validated. The OEE Log is checked so the same line, shift and date cannot be logged twice. OEE is calculated in code, GPT-6.1-sol writes a short summary, and a verification step replaces the summary with a calculated one when the reply is incomplete or quotes percentages that do not match the numbers. The shift is logged, then a Switch handles the bands: critical shifts alert by Gmail and Telegram and open a corrective action, warning shifts get a watch email, and a third dip in a row opens an action too. Open actions are chased daily until someone closes them through a webhook.

How it works

  1. The oee-intake webhook receives the shift. Entries missing a line name or produced count are emailed back as rejected.
  2. The OEE Log is read once and a matching date, line and shift sends a duplicate notice instead of a second row.
  3. Code calculates availability, performance, quality, OEE, downtime and a status: healthy at 75% or more, warning from 60%, critical below.
  4. GPT-6.1-sol returns a line summary, top issue and suggestion. The verify step checks the reply is complete and that any percentage it quotes matches the real factors, and writes a fallback from the numbers when it does not. The source is stored in ai_status.
  5. The shift is appended to the OEE Log with retries.
  6. Critical shifts email the ops address and post to Telegram, then open a row in the Actions tab with a two day due date.
  7. Warning shifts check the last two entries for that line. A third warning or critical shift in a row posts a Telegram escalation and opens an action, otherwise a watch email goes out.
  8. Every day at 09:00 open actions past their due date email their owner once per day and get stamped last_reminded.
  9. A POST to oee-action-close with an action_id marks it closed and confirms on Telegram.
  10. At 06:00 a daily digest and every Monday at 07:00 a weekly digest summarize OEE per line by email.

Setup

  1. Create a spreadsheet with an OEE Log tab (the columns in Log Shift to OEE Log plus ai_status) and an Actions tab (action_id, opened_at, line_name, shift_label, report_date, oee_pct, top_issue, suggestion, owner_email, due_date, status, last_reminded, closed_at).
  2. Connect Google Sheets and point every Sheets node at your file.
  3. Add an OpenAI compatible credential on the three chat model nodes.
  4. Connect Gmail. Send ops_email in each payload or replace the [email protected] fallback.
  5. Add a Telegram bot and replace chat ID 123456789.
  6. Point your line terminals or MES export at the intake webhook and give supervisors the action close URL.
  7. Adjust the 75% and 60% thresholds in Calculate OEE to your plant targets.

Quick Answers

What if the AI summary invents a number?
Any percentage in the summary that does not match OEE, availability, performance or quality is treated as invented, and the summary is rebuilt from the calculated factors. ai_status records which one was used.

Can the same shift be counted twice?
No. A second entry with the same date, line and shift is not logged and the sender gets an email.

When is a corrective action opened?
On every critical shift, and when a line has been in warning or critical for three shifts in a row.

How do actions get closed?
POST the action_id to the close webhook. Until then, overdue actions remind the owner once a day.

Additional info

Built with n8n. Need an assessment on your business? Feel free to reach out at https://khmuhtadin.com/consultation/