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.

0
Downloads
0
Views
8.31
Quality Score
beginner
Complexity
Author:Oneclick AI Squad(View Original →)
Created:8/13/2026
Updated:8/13/2026

🔒 Please log in to import templates to n8n and favorite templates

Workflow Visualization

Loading...

Preparing workflow renderer

Comments (0)

Login to post comments