Skip to content
FlowHubFluxonLab
A
AI Automationfree

Route patients to the best nearby hospital using Google Maps, GPT-4.1 and Twilio

by Oneclick AI Squadadapted from n8n official workflow galleryUpdated Aug 2026
RequiresAAI AgentCCodeHTTP RequestHTTP RequestOpenAI Chat ModelOpenAI Chat Model
Share Post Share
WeWebhook - Emergency RequestWebhook - Emerg…ScPoll - Periodic Facility RefreshPoll - Periodic…SePrepare Location ContextPrepare Locatio…CoPython - Validate & Score SeverityPython - Valida…FiFilter - Valid LocationFilter - Valid …HRFetch Nearby HospitalsFetch Nearby Ho…HRFetch Nearby ClinicsFetch Nearby Cl…CoJS - Merge & Deduplicate FacilitiesJS - Merge & De…HRFetch Facility CapacityFetch Facility …CoJS - Enrich with CapacityJS - Enrich wit…HRFetch Travel TimeFetch Travel Ti…CoPython - Score FacilitiesPython - Score …CoJS - Select Best FacilityJS - Select Bes…AgAI - Generate Routing MessageAI - Generate R…OpenAI Chat ModelOpenAI Chat Mod…CoJS - Format Final OutputJS - Format Fin…WaWait - Review BufferWait - Review B…HRSend SMS Routing AlertSend SMS Routin…HRLog to Google Sheet TrackerLog to Google S…RTWebhook Response - Send ResultWebhook Respons…CoError - Invalid LocationError - Invalid…RTWebhook Response - ErrorWebhook Respons…WaWait For Result123456789101112131415161718192021222324
1/5
STEPS · 24
Starts on an incoming request

Quick overview This workflow accepts emergency location requests (or runs on a 5-minute schedule), finds and ranks nearby hospitals/clinics using Google Places, capacity data, and Google Distance Matrix, generates a routing message with OpenAI, sends the recommendation via Twilio SMS, logs the event to Google Sheets, and returns a JSON response. How it works Receives an emergency request via a webhook POST (or runs every 5 minutes on a schedule) and normalizes latitude, longitude, severity, phone number, and a request ID. Validates the GPS coordinates, maps severity to a numeric score, and sets a search radius, returning an error response if the location is invalid. Queries the Google Places API for nearby hospitals and clinics, then merges and deduplicates the results into a single facility list. Looks up each facility’s ED capacity metrics from a capacity API and calculates real-time driving time to each facility with the Google Distance Matrix API. Scores and ranks facilities using a severity-adjusted composite score (travel time, available beds, wait time, and ED diversion penalties) and selects the best match plus two alternatives.

Tags

n8nreference-onlyagentlm-chat-open-ai
Connects
AAI AgentCCodeWHTTP RequestopenaichatmodelOpenAI Chat Model
CategoryAI Automation
Triggermanual
Complexityadvanced
Nodes23
AddedJul 1, 2026

Related workflows

See all AI Automation
ACWopenaichatmodel
free

Generate executive decision briefings from APIs with OpenAI and Google Sheets

Quick overview This workflow runs daily or via an on-demand webhook to pull financial metrics, operational KPIs, and market quotes via HTTP APIs, then uses OpenAI to detect anomalies and generate an executive briefing that is POSTed to a dashboard endpoint and logged to Google Sheets. How it works Runs on a daily schedule or receives a POST request via a webhook to start an executive briefing run with a configurable lookback period. Fetches financial metrics, operational KPIs, and market data in parallel from three HTTP API endpoints and continues even if one source fails. Merges and normalizes the three datasets into a single snapshot, marking missing sources as unavailable so downstream steps keep a consistent structure. Uses OpenAI to analyze the snapshot for anomalies, unusual trends, and data gaps, returning a severity-scored findings JSON. Uses OpenAI again to turn the anomaly findings and raw metrics into a structured executive briefing with a health score, risks, opportunities, and recommended actions. Formats a final JSON payload and delivers it by POSTing to your dashboard endpoint and appending a summary row to a Google Sheets tracker. If the run was triggered by the web

by Oneclick AI Squad
ACWopenaichatmodel
free

Manage Google and Trustpilot reviews with OpenAI and Slack

Quick overview This workflow runs hourly to fetch new Google Business Profile and Trustpilot reviews, deduplicates them, uses OpenAI via a LangChain agent to draft sentiment-aware replies, escalates negative reviews in Slack, and routes positive replies to Slack for approval before posting the reply back to Trustpilot. How it works Runs every hour on a schedule. Fetches the latest reviews from the Google Business Profile API and the Trustpilot API and combines the results. Deduplicates reviews by tracking previously seen review IDs in workflow static data and stops if there are no new reviews. Processes each new review and uses OpenAI (via a LangChain agent) to generate structured JSON containing sentiment, a draft reply, and an optional suggested resolution. Sends negative reviews to a Slack channel for the owner along with the suggested resolution. Sends positive draft replies to Slack for one-tap approval (with a 24-hour timeout) and, if approved, publishes the reply to the Trustpilot API. Sends a Slack alert to the ops channel if the workflow errors. Setup Configure authentication and replace placeholders for the Google Business Profile reviews endpoint (account and location) i

by Redowan Ahmed Farhan
ACgmailW
free

Send weekly blended ad performance reports with Meta, Google Ads, GA4 and OpenAI

Quick overview This workflow runs every Monday at 8am to pull the last 7 days of performance from Meta Ads, Google Ads, and GA4, calculate blended KPIs, generate an OpenAI-powered narrative summary, email an HTML report via Gmail, and post an internal update (and errors) to Slack. How it works Runs every Monday at 8am on a scheduled trigger. Fetches the last 7 days of spend and engagement metrics from the Meta Ads Insights API, campaign cost and conversion metrics from the Google Ads API, and conversions and revenue by channel from the GA4 Reporting API. Combines the three datasets and calculates blended KPIs including total spend, total conversions, total revenue, and ROAS. Sends the computed metrics to an OpenAI chat model to generate a 3–4 sentence client-friendly performance summary with one risk and one recommendation. Builds a simple HTML report containing the KPIs and AI summary. Emails the HTML report to the client via Gmail and posts a brief confirmation with spend and ROAS to a Slack channel. If the workflow fails, posts an error alert message to an ops Slack channel. Setup Configure authentication for the HTTP requests to Meta Ads (access token), Google Ads (OAuth/access

by Redowan Ahmed Farhan