Send crowd safety SMS reroute alerts with OpenAI, Twilio, and Google Sheets
Needs changesWhat this workflow does
This AI workflow has 20 nodes and runs on a schedule (every minute). Along the way it connects Anthropic Chat Model. It also calls sheets.googleapis.com over HTTP.
How it runs
Trigger: On a schedule (every minute).
- Fetch Live Crowd Density Data (HTTP Request): calls an HTTP API
- Fetch Active Incident Reports (HTTP Request): calls an HTTP API
- JS - Rename Density Values (Code): runs custom JavaScript code
- JS - Rename Incident Values (Code): runs custom JavaScript code
- Merge: merges the data from its input branches
- JS - Merge Zone Data & Calculate Risk Scores (Code): runs custom JavaScript code
- Split Out: splits a list into separate items
- JS - Format Heatmap Log Record (Code): runs custom JavaScript code
- Filter: keeps only the items that match a condition
- Wait: pauses before continuing
…plus 8 more steps. See the full node list below.
Services it uses
HTTP calls to: sheets.googleapis.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 AI - Generate Rerouting Suggestion (v1.6): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI - Generate Rerouting Suggestion (v1.6) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (9)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - Merge
n8n-nodes-base.merge - Split Out
n8n-nodes-base.splitOut - Filter
n8n-nodes-base.filter - Wait
n8n-nodes-base.wait - AI Agent
@n8n/n8n-nodes-langchain.agent - Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic
From the author
Quick overview This workflow ingests crowd density and incident reports via webhook or a 5‑minute schedule, assesses risk with Python thresholds, uses OpenAI to generate a short rerouting recommendation, then sends an SMS via Twilio and logs each alert to a…