# Score COD RTO risk for Shopify orders with GPT-4o-mini, WhatsApp and Sheets

> Quick overview This workflow scores Shopify cash-on-delivery (COD) orders for RTO risk using Google Sheets history, an India pincode lookup API, and an OpenAI address quality check, then logs outcomes and uses WhatsApp and Slack to confirm, convert to prepaid, cancel, or hold risky orders. How it works 1. Triggers when a Shopify order is created or when a customer replies via WhatsApp. 2. For new orders, keeps only unpaid COD orders and normalizes customer, phone, and shipping address details. 3. Looks up pincode RTO history and the customer’s past COD behavior in Google Sheets, validates the pincode via an India Post lookup API, and checks address quality with OpenAI (gpt-4o-mini). 4. Combines these signals into a 0–100 risk score with a risk band and reasons, skips orders already scored, and appends or updates the result in a Google Sheets COD Ledger. 5. In shadow mode, posts the score to Slack only, and in live mode tags medium-risk orders in Shopify and places high-risk orders on f

- **Domain**: `n8n-workflow-22643.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/22643
- Page (HTML): https://agenstry.com/agents/n8n-workflow-22643.n8n.io
- Documentation: https://n8n.io/workflows/22643
