Quick overview
This workflow checks Open-Meteo forecasts for sites stored in Google Sheets and automatically dispatches snow/ice crews when per-site triggers are met, using OpenAI to generate crew briefs and client notices, then notifying teams via Gmail and Telegram and tracking status through confirmation and follow-up webhooks.
How it works
- Runs every 3 hours on a schedule or on demand via a webhook to start a forecast sweep.
- Reads the Sites tab in Google Sheets, validates required fields (IDs, coordinates, triggers, and emails), and sends invalid rows to an admin Gmail address, a Telegram chat, and the Errors tab.
- Fetches a 2-day hourly forecast from Open-Meteo for each valid site and evaluates the next 12 hours against the site’s snow trigger and freezing-precipitation criteria.
- Logs each sweep to the CheckLog tab in Google Sheets with counts of checked sites, dispatches, no-action sites, and rejected rows.
- When one or more sites need dispatch, sends the dispatch list to an OpenAI chat model to generate a storm summary, crew brief, and client notice for each site.
- Creates a dispatch entry in the DispatchLog tab and sends the crew brief and client notice via Gmail, while also posting a dispatch alert to Telegram.
- Receives crew completion updates via a confirmation webhook, updates the matching DispatchLog row, emails the client a completion notice, and alerts the owner in Telegram (or reports errors if the dispatch ID is missing/unknown).
- Runs a daily sweep (or manual follow-up webhook) to find dispatches still marked “dispatched” after 6 hours and sends a Gmail and Telegram nudge, or reports that all dispatches are confirmed.
Setup
- Create a Google Sheets workbook with tabs named Sites, DispatchLog, CheckLog, and Errors, and ensure columns match the fields the workflow reads and writes (for example: site_id, lat, lon, trigger_cm, crew_email, contact_email, dispatched_at, status, completed_at).
- Add Google Sheets OAuth credentials and update the spreadsheet document ID (and sheet names if different) in all Google Sheets steps.
- Add an OpenAI API credential (or compatible OpenAI chat provider) and select the model used to generate dispatch briefs.
- Add Gmail OAuth2 credentials and replace the admin/owner email addresses where reports and invalid-row alerts are sent.
- Add Telegram bot credentials and update the target chat ID used for dispatch, error, and follow-up notifications.
- Copy the webhook URLs for /snow/check, /snow/confirm, and /snow/followup and share them with your team or connect them to your preferred crew reporting method.