Score AQI health risks with Open-Meteo, AirNow, Gemini, WhatsApp, SMS and Slack
Needs changesWhat this workflow does
This AI workflow has 24 nodes and runs on a schedule (every day at 06:00). Along the way it connects Google Gemini Chat Model, WhatsApp Business Cloud, Twilio and Slack. It also calls air-quality-api.open-meteo.com over HTTP.
How it runs
Trigger: On a schedule (every day at 06:00).
- Set City Configuration (Edit Fields (Set)): sets 4 fields: city_name, latitude, longitude…
- Fetch Open-Meteo AQI (HTTP Request): calls air-quality-api.open-meteo.com
- Normalize Open-Meteo Data (Edit Fields (Set)): sets 4 fields: source_a_aqi, source_a_pm25, source_a_pm10…
- Fetch AirNow RSS Data (HTTP Request): calls an HTTP API
- Normalize AirNow Data (Code): runs custom JavaScript code
- Calculate Weighted Avg AQI (Code): runs custom JavaScript code
- Set User Health Profile (Edit Fields (Set)): sets 10 fields: age, has_asthma_copd, is_pregnant…
- Prepare Risk Scoring Data (Edit Fields (Set)): sets 19 fields: city_name, final_aqi, aqi_bucket…
- Risk Scoring Agent (AI Agent): runs an AI agent, with model: Gemini AI Model; output parser: Parse Risk Output Structure
- Map Risk Results (Edit Fields (Set)): sets 11 fields: risk_tier, advisory_text, city_name…
…plus 10 more steps. See the full node list below.
Services it uses
HTTP calls to: air-quality-api.open-meteo.com
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in Risk Scoring Agent (v1.7): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Risk Scoring Agent (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (13)
- Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - AI Agent
@n8n/n8n-nodes-langchain.agent - Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - No Operation, do nothing
n8n-nodes-base.noOp - Switch
n8n-nodes-base.switch - WhatsApp Business Cloud
n8n-nodes-base.whatsApp - Twilio
n8n-nodes-base.twilio - Slack
n8n-nodes-base.slack - Schedule Trigger
n8n-nodes-base.scheduleTrigger
From the author
Quick overview Video Explanation: https://youtu.be/5TNw4aaHtHI?si=wLY3Gci9n3vKYNQ This workflow runs daily at 6:30 AM to fetch AQI from Open-Meteo and AirNow, calculates a weighted average AQI, uses Google Gemini to generate a health-specific risk tier and…