Score cold-chain batch recall risk from IoT excursions with Anthropic and email alerts
Needs changesWhat this workflow does
This AI workflow has 15 nodes and runs on a schedule (every 30 minutes). Along the way it connects Anthropic Chat Model.
How it runs
Trigger: On a schedule (every 30 minutes).
- Fetch Active Shipments & Route History (HTTP Request): calls an HTTP API
- Fetch Live IoT Sensor Readings (HTTP Request): calls an HTTP API
- Merge: merges the data from its input branches
- JS - Build Cold-Chain Excursion Profile (Code): runs custom JavaScript code
- JS - Run Spoilage Risk Monte Carlo (Code): runs custom JavaScript code
- Wait: pauses before continuing
- AI - Generate Batch Risk Classification (AI Agent): runs an AI agent, with model: Anthropic - Risk Classification Model
- JS - Parse AI Output & Format Predictive Recall Report (Code): runs custom JavaScript code
- Wait: pauses before continuing
- If: checks a condition and branches into true / false
…plus 3 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI - Generate Batch Risk Classification (v1.6): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI - Generate Batch Risk Classification (v1.6) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (9)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - HTTP Request
n8n-nodes-base.httpRequest - Merge
n8n-nodes-base.merge - Code
n8n-nodes-base.code - Wait
n8n-nodes-base.wait - AI Agent
@n8n/n8n-nodes-langchain.agent - Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic - If
n8n-nodes-base.if - Send Email
n8n-nodes-base.emailSend
From the author
Quick overview This workflow receives cold-chain temperature excursion events via webhook, enriches them with shipment route history from a logistics API, uses Anthropic Claude to predict batch compromise risk, then formats and emails a predictive recall…