Facility-aware earthquake alerts to the right Slack channel

Watch USGS for quakes near every office and warehouse on your Airtable site list, and ping only the regional Slack channel when shaking actually reaches one of yours.

Agentic Task
USGS EarthquakeAirtableSlackOperationsNotifications & AlertsResearch & Monitoring
PromptCreate

Build me an agent workflow that runs on a cron every 15 minutes and alerts the right regional Slack channel when a USGS earthquake actually threatens one of my company's physical sites. The point is signal-to-noise: I only want to hear about quakes that hit places we operate, not every M4.5+ on the planet.

Trigger: cron, every 15 minutes. USGS is not a poll provider, so cron is correct. The USGS Real-time Summary Feed refreshes every minute, so 15 minutes is well inside the freshness window.

Step 1, fetch fresh events. Use the USGS Earthquake integration's Real-time Summary Feed operation. Pull the 'significant' feed for the past day and the magnitude 4.5+ feed for the past day, then merge and de-duplicate by event ID. Each feature in the GeoJSON has an id, properties.mag, properties.place, properties.time, properties.url, properties.tsunami, properties.alert (PAGER level: green, yellow, orange, red), and geometry.coordinates as [longitude, latitude, depth_km].

Step 2, load my facility list. Use the Airtable integration's List Records operation against a base called 'Facilities' (the user will provide the base ID and table name during setup). Each row represents one office, warehouse, plant, or data center, with these fields: Site Name (text), Latitude (number), Longitude (number), Slack Channel (the channel ID for that region's ops channel), and Site Lead (Slack user ID to tag for check-in). Page through all records.

Step 3, compute impact. For each earthquake, calculate the great-circle distance from the epicenter to every facility using the haversine formula (Earth radius ~6371 km). Keep only facilities inside a magnitude-scaled radius that reflects how shaking falls off non-linearly with magnitude: roughly 100 km for M4.5 to M5.4, 300 km for M5.5 to M6.4, and 600 km for M6.5 and above. Treat anything below M4.5 as out of scope. If no facility is within range for a given quake, skip it silently.

Step 4, alert. For each (earthquake, impacted facility) pair, use the Slack integration's Send a Message operation to post one message to that facility's Slack Channel field. The message should include: the site name and how far the epicenter was from it (in km), magnitude, depth in km, PAGER alert level (with a colored emoji prefix mapped from green/yellow/orange/red), whether tsunami is flagged, the human-readable USGS 'place' string, a link to the USGS event URL, and a final line tagging the Site Lead (e.g. '<@U12345> please check in when you can confirm the team is safe'). Use Slack mrkdwn formatting: *bold*, _italic_, <url|text>.

Step 5, de-duplicate across runs. The agent must remember which USGS event IDs it has already alerted on so a single quake never fires twice, even though significant events stay in the feed for hours or days. Persist the set of already-alerted event IDs in the agent's working memory or a small state store. On each run, only process events whose IDs have not been alerted before. If the same quake later impacts a new facility (e.g. a site was added to Airtable after the first alert), that's still considered already-alerted at the event level: alert once per event, not once per facility per event.

Behavior when there's nothing to report: stay completely silent. No 'all clear' messages, no heartbeat pings. Channels stay quiet unless a real impact happens.

Error handling: if the USGS feed is unreachable, log and exit cleanly so the next run retries. If Airtable returns zero facilities, log a warning and exit (don't alert anywhere). If posting to a specific Slack channel fails (channel not found, not in channel), log the failure for that one site and continue with the other impacted sites instead of aborting the whole run.

What does this prompt do?

  • Checks the live USGS earthquake feed every 15 minutes for newly significant events worldwide.
  • Pulls your facility list from an Airtable base where each row has a site name, coordinates, Slack channel, and site lead.
  • Calculates how far each quake is from every one of your sites and keeps only the ones inside a shaking radius that grows with magnitude.
  • Posts one Slack message per impacted site to that region's channel with magnitude, depth, distance to the office, PAGER alert level, tsunami status, the USGS event link, and a check-in tag for the site lead.
  • Stays completely silent when no site is in range, and never fires twice for the same quake.

What do I need to use this?

  • A Slack workspace where automated messages can post into your regional operations channels.
  • An Airtable base with one row per facility, including a human-readable site name, latitude, longitude, the Slack channel for that region, and the site lead to tag.
  • No USGS account or API key. The earthquake data is free and public.

How can I customize it?

  • Tune the impact radius (for example, alert anywhere within 1000 km for a magnitude 7 or above, or shrink the radius if you only care about strong local shaking).
  • Add filters like only PAGER orange and red events, only certain countries, only working hours, or only sites flagged as critical.
  • Swap in a different site list, group sites by region, route the alert to an on-call group instead of one person, or post to a single all-hands channel instead of per-site channels.

FAQs

How quickly will I hear about a quake near one of my sites?
Within about 15 to 30 minutes of the event being posted by USGS. The feed itself refreshes every minute, and the workflow checks it every 15 minutes.
What happens when a quake doesn't hit any of my locations?
You hear nothing. The alert only fires when at least one site is inside the magnitude-scaled radius, so your channels stay quiet for the global earthquake stream most ops teams find too noisy.
Will I get duplicate alerts every time the workflow runs?
No. Each USGS event has a stable ID, and the workflow remembers which events it has already alerted on, so a single quake never fires twice even if it stays in the feed for hours.
Do I need a separate Slack channel for every office?
No. Each row in your Airtable controls where its own alert goes. You can route every site to one channel, group by region, or send each office to a dedicated channel.
Can I add more sites later without rebuilding the workflow?
Yes. Add a row to the Airtable base with the new site's coordinates, channel, and lead, and the next run will start watching it automatically.

Related templates

Call overdue Xero customers with an AI collections agent

Every weekday at 10am, an AI voice agent phones your most overdue Xero accounts, logs what each customer promised, and reports back to finance in Slack.

LiveKit
Xero
Deepgram
+2
Agentic Task
Win back LiveChat visitors whose chats went unanswered

Every couple of hours we find the chats your team never answered, email those visitors a real reply, and hand the sensitive ones to a support lead.

LiveChat
Gmail
Slack
Agentic Task
Chat quality review board for LiveChat support leads

Score last week's finished live chats against one rubric, let an AI grader draft the notes with quotes, and send coaching straight to the agent.

LiveChat
Slack
General Input Database
App
Win back no-show and cancelled appointments every morning

Every weekday morning, every appointment that fell through yesterday gets a personal text or email inviting them to rebook, plus a task for the right rep.

LeadConnector
Google Sheets
Slack
Agentic Task
Live Loop returns analytics with product-level drill-down

Pick any date range up to 120 days and see return volume, refund versus exchange mix, and the products behind every number, recalculated each time you open it.

Loop Returns
Google Sheets
Slack
App
Newsletter pre-flight and approval board for Mailjet sends

Every newsletter gets read, checked and signed off in one place, so nothing goes out with a broken link or a half-filled greeting.

Mailjet
Slack
General Input Database
App

Don't find out from the news that a quake hit one of your sites.

Connect Slack and Airtable once, and Geni watches USGS every 15 minutes and pings only the channels that need to know.