Route weather-based delivery holds with Open-Meteo, Gemini, Postgres, and ServiceNow
Quick overview Demo Video: https://youtu.be/ccEy0J-LKY
Quick overview
Demo Video: https://youtu.be/ccE_y0J-LKY
This workflow polls Open-Meteo weather data every 15 minutes for a configured region, when severe conditions are detected, checks today’s delivery manifests in Postgres, use Gemini to identify impacted stores, creates a ServiceNow incident, updates an alert log in Postgres, and sends Slack notifications.
How it works
- Runs every 15 minutes and loads the configured region, zip code, and coordinates.
- Requests the current and daily forecast from the Open-Meteo API and evaluates whether conditions qualify as heavy snow, flood warning, or low visibility.
- If severe weather is detected, queries Postgres to see whether an active alert for the same region and event type already exists within the cooldown window and suppresses duplicates.
- If no active duplicate exists, inserts a new processing record in Postgres and fetches today’s delivery manifest rows for the region’s zip code.
- Uses Google Gemini (via an agent with structured output) to determine which stores are affected and to generate an incident summary, priority, and estimated delay.
- Creates a ServiceNow incident using the AI-generated summary, then updates the Postgres alert record as active (or no_impact if no deliveries are affected) and posts an operations summary to Slack.
- If the workflow errors at any point, logs the failure details to Postgres and sends a Slack alert with the execution link.
Setup
- Add Postgres credentials and ensure the tables
delivery_manifests,weather_alert_log, andweather_workflow_error_logexist with the fields used by the queries and inserts. - Add a Google Gemini (PaLM) API credential and keep the model set to
models/gemini-3.1-flash-lite. - Add ServiceNow Basic Auth credentials and verify incident creation permissions in your ServiceNow instance.
- Add Slack credentials and set the target channel for failure alerts and the target user (or change to a channel) for the ops summary message.
- Update the region configuration values (zip code, latitude/longitude, region name, and cooldown hours) to match your operating area.
production deployment
Need this workflow deployed or tailored for your business?
I customize n8n pipelines, build proprietary API nodes, and connect production databases with sub-100ms reliability.
creator
iamvaar
Top 50 Verified Creator
AI Automation Engineer building production-grade n8n systems, custom nodes, and LLM pipelines.
n8n.io/creators/iamvaarspecs
related automations
More workflows from iamvaar
Log Telegram client updates to Notion and Google Sheets with Gemini
Quick overview Youtube Video: https://youtu.be/kEumCSBunnM?si=AxpoxP8KLF2haz1X
Track Slack EOD updates and post executive summaries with Google Sheets and Gemini
Quick overview Youtube Video: https://youtu.be/AbkX2splTTg?si=LTHqLFIWQD4hAYsO
Track daily LLM brand visibility with Gemini, Groq, OpenRouter, Sheets and Slack
Quick overview Youtube Video: https://youtu.be/BOodBD6HWSU?si=yEenUFBdYOq1RVj This workflow runs daily at 7AM to generate buyer-style prompts with Google Gemini, query Groq, Ope...
Want this workflow running in your stack?
Book a free 30-minute session. I'll inspect your current infrastructure, review required API credentials, and map out the deployment.