Email Automation
Triage JMA weather delays with GPT-5-mini, Microsoft Teams and Gmail
On a schedule, it handles email with OpenAI / ChatGPT using Data Table, Gmail.
What it does
## Alert shipping teams to JMA weather warnings, approve delay notices and email affected customers Heavy rain, storms, and snow in Japan often delay pickups and deliveries. This workflow watches official Japan Meteorological Agency (JMA) warnings for the prefectures you ship from or to, finds the pending shipments that may be affected, and emails those customers after a staff member approves the notice. ### How it works 1. Every 30 minutes, it reads the public JMA warning feed (no API key) and the warnings in effect for each watched prefecture. 2. It compares them with the state saved in an n8n data table, so only changes continue. 3. Find Affected Shipments matches the prefecture against pending orders in the open_shipments table, including all orders when your warehouse is in that prefecture. 4. OpenAI rates severity and drafts an internal alert and a keigo customer email with placeholders. 5. Teams gets a card with the affected orders and a Review and send button. Staff edit and approve the email in an n8n form. If nobody answers in time, a reminder is posted, and the request expires after a second wait. 6. After approval, one Gmail message is sent per order. Each order is marked as notified or failed, and a summary card reports the result. Lifted warnings get an all-clear card. ### Setup steps 1. Create two n8n data tables: weather_alert_state (prefecture, warnings, reported_at) and open_shipments (order_id, customer_name, email, ship_to_prefecture, ship_date, status, notice_sent, notified_at). All columns are text. 2. Run Load Sample Shipments once to try it, then fill the table from your order system. 3. Edit Set Areas and Settings, including the Teams webhook URL. 4. Connect OpenAI and Gmail credentials.
The steps
- Every 30 Minutes
- Set Areas and Settings
- Load Previous State
- Load Open Shipments
- Fetch JMA Warning Feed
- Parse Feed XML
- Split Feed Entries
- Read Entry Fields
- Keep Watched Prefectures
- Sort Newest First
- Keep Latest per Prefecture
- Fetch Warning Details
- Parse Warning XML
- Read Active Warnings
44 steps in total.
Similar automations
Alerts & NotificationsSet Up a Microsoft Teams Channel and Message4 stepsAlerts & NotificationsSend New Ticket Alerts to Microsoft Teams18 stepsAlerts & NotificationsSend New Ticket Alerts to Microsoft Teams8 stepsReports, Analytics & DashboardsWeekly Team Member Reports from Microsoft Teams with OpenAI15 steps