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.
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?
What happens when a quake doesn't hit any of my locations?
Will I get duplicate alerts every time the workflow runs?
Do I need a separate Slack channel for every office?
Can I add more sites later without rebuilding the workflow?
Related templates
Work every partner tier decision from one board, with the revenue and commission numbers, clear promotion thresholds, and AI review briefs.
Open one board at month end to find every closed deal missing a commission, every commission with no deal behind it, and every amount that does not add up.
See warmup status, daily send volume, and bounce risk for every sending account in one grid, with the riskiest mailboxes floating to the top.
Review Introw partner payouts line by line, approve them from one board, raise the matching bill in Xero, and post every approval to Slack.
See who is due, build a week of dinners on demand, swap anything you do not like, then send the recipe and grocery links yourself.
See every customer photo that tags your brand, ask for permission in one click, and repost only once a yes is on the record.
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.