See llms.txt for all machine-readable content.

Back to Templates

Assess and alert flood risk with Sentinel-1 SAR, Open-Meteo and Gemini

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

  1. Runs every day at 07:00 on a schedule.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. Appends the assessment results and key metrics (flood status, confidence, exposed properties, sum insured, scene dates, and report link) to a Google Sheets log.
  7. 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

  1. 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).
  2. Add Google Gemini (Google PaLM / Gemini) API credentials for the chat model used to generate the flood assessment.
  3. Add a PDFEndpoint bearer token credential and confirm your PDFEndpoint plan allows HTML-to-PDF conversion.
  4. Add Gmail OAuth2 credentials and verify the workflow has permission to send email with attachments to your claims and risk recipients.
  5. 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.