Score cold-chain batch recall risk from IoT excursions with Anthropic and email alerts
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 alert to quality and operations teams.
How it works Receives a POST webhook event containing a batch ID, shipment ID, and timestamped temperature/geo sensor readings from cold-chain IoT devices. Fetches the shipment’s route and handling history from a logistics provider API using the shipment ID. Calculates risk features such as safe temperature range, excursion count, maximum deviation, minutes outside range, and a route risk score. Sends the engineered features to Anthropic Claude (claude-sonnet-4) to return a compromise probability, risk level, recommended action, and brief reasoning as JSON. Parses the model output and builds a formatted predictive recall report, falling back to a rule-based risk assessment if JSON parsing fails. Emails the report to the configured quality/ops recipients with the batch ID and risk level in the subject line.
Setup Configure the Webhook trigger URL in your IoT sensor gateway/app to POST excursion payloads to /cold-chain-excursion. Add your logistics API authentication and replace YOUR_LOGISTICS_API_KEY, and confirm the route-history endpoint matches your provider’s API. Add an Anthropic API credential for the Claude model used by the workflow. Add SMTP credentials and set the from/to email addresses for the alert email.
Related Templates
Verify Linkedin Company Page by Domain with Airtop
Automating LinkedIn Company URL Verification Use Case This automation verifies that a given LinkedIn URL actually belo...
Create a Speech-to-Text API with OpenAI GPT4o-mini Transcribe
Description This template provides a simple and powerful backend for adding speech-to-text capabilities to any applicat...
Build a Restaurant Voice Assistant with VAPI and PostgreSQL for Bookings & Orders
This n8n template demonstrates how to create a comprehensive voice-powered restaurant assistant that handles table reser...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments