Quick overview
Youtube Video: https://youtu.be/YL8RSqhBhUc
This workflow runs daily to monitor an active flood zone by combining Open-Meteo rainfall forecasts with Sentinel-1 RTC imagery from the Microsoft Planetary Computer, uses Gemini to assess flood status and insured exposure from Sheets, logs back to Sheets, and emails a report via Gmail.
How it works
- Runs every day at 07:00 on a schedule.
- Reads the active flood zone definition from Google Sheets and pulls a 3-day history plus 3-day rainfall forecast from Open-Meteo for the zone centroid.
- Queries the Microsoft Planetary Computer STAC API for the latest Sentinel-1 RTC radar scene over the zone and a matching-orbit baseline scene from an earlier time window.
- If both radar scenes are available, loads insured properties for the zone from Google Sheets and samples Sentinel-1 VV backscatter at each property coordinate for both baseline and latest scenes.
- Downloads baseline and latest radar image thumbnails for the zone and sends them, along with rainfall and exposure context, to Google Gemini to produce a structured flood assessment.
- Appends the assessment results and key metrics (flood status, confidence, exposed properties, sum insured, scene dates, and report link) to a Google Sheets log.
- If the assessment indicates FLOODING/SEVERE or the exposed-property count exceeds the zone threshold, generates an HTML evidence report, converts it to a PDF via PDFEndpoint, and emails it to the zone’s claims and risk contacts using Gmail.
Setup
- Create and connect Google Sheets service account credentials, then update the spreadsheet ID and ensure the workbook contains the Zones, Properties, and Flood_Log sheets with the referenced columns (including zone bounding box, active flag, emails, and thresholds).
- Add Google Gemini (Google PaLM / Gemini) API credentials for the chat model used to generate the flood assessment.
- Add a PDFEndpoint bearer token credential and confirm your PDFEndpoint plan allows HTML-to-PDF conversion.
- Add Gmail OAuth2 credentials and verify the workflow has permission to send email with attachments to your claims and risk recipients.
- Populate at least one active zone (active=YES) with west/south/east/north bounds and configure property rows with latitude/longitude and ACTIVE policy status for meaningful exposure sampling.