Templates / Investigate batch deviation root causes with GPT-4.1, QMS, and Slack

Investigate batch deviation root causes with GPT-4.1, QMS, and Slack

Needs changes

by Oneclick AI Squad ✓ · 2 views · created 2026-09-04 · Engineering, AI RAG

Needs changes. This template uses 2 thing(s) that n8n 3.0 removes: HTTP Request Tool (legacy), AI Agent v1 (old agent modes). 2 breaking item(s) found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 22 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects HTTP Request, Vector Store Question Answer, OpenAI Chat Model and Postgres and 1 more.

How it runs

Trigger: When an HTTP POST request hits its webhook URL.

  1. Set Deviation Configuration (Edit Fields (Set)): sets 8 fields: deviationId, batchId, product…
  2. Deviation Analysis Agent (AI Agent): runs an AI agent, with model: OpenAI GPT-4 Chat; 4 tools (Query Equipment Events, Query Operator Actions, Search Historical CAPAs, Query Environmental Data); memory: Buffer AI Memory
  3. Parse Agent Output (Edit Fields (Set)): sets 1 field: parsedOutput
  4. Log RCA Investigation (Postgres): uses Postgres
  5. If: checks a condition and branches into true / false
  6. Send QA Review Request (Slack): uses Slack
  7. Notify Manual Investigation (Slack): uses Slack
  8. Wait: pauses before continuing
  9. Respond Investigation Logged (Respond to Webhook): sends the response back to the webhook caller
  10. If: checks a condition and branches into true / false

…plus 5 more steps. See the full node list below.

Services it uses

HTTP RequestVector Store Question AnswerOpenAI Chat ModelPostgresSlack

Before you upgrade to n8n 3.0

2 things in this workflow are removed in n8n 3.0. Fix them before you upgrade:

  • HTTP Request Tool (legacy) in Query Equipment Events, Query Operator Actions, Query Environmental Data: replace with HTTP Request node connected to the AI Agent's Tool input.
  • AI Agent v1 (old agent modes) in Deviation Analysis Agent (v1.6): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Removed in 3.0Replace with
HTTP Request Tool (legacy)
Query Equipment Events, Query Operator Actions, Query Environmental Data
HTTP Request node connected to the AI Agent's Tool input
AI Agent v1 (old agent modes)
Deviation Analysis Agent (v1.6)
Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.

Nodes used (13)

From the author

Quick overview This workflow receives batch deviation submissions via webhook, uses OpenAI with tool-calling and a vector store RAG search to investigate likely root causes from MES/eBR/EMS data, logs results to Postgres, and routes higher-confidence findings…

Excerpt from Oneclick AI Squad's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.