Hourly negative sentiment spike alerts in Slack
Watch your brand on social every hour, ping a Slack channel when negative chatter spikes, and open a Linear ticket so the response gets tracked.
Build a code workflow that monitors my brand for negative sentiment spikes on social media and alerts the team only when something looks off. The workflow should run every hour on a cron trigger.
On each run, use Infegy Starscape with my saved brand tracking query and a date filter for the last 60 minutes. First call the Validate Query and Get Estimated Result Count operation to confirm the query is valid and to get the estimated mention count for the window. Then call Get Topics Analysis on the same query and window to retrieve the top driving themes along with size and sentiment for each topic, plus the overall net sentiment and negative sentiment percentage for the window.
Compare the results to a configured baseline. The baseline has two parts, a rolling 7 day average of hourly mention volume (with a configurable multiplier, default 2x), and a negative sentiment percentage threshold (default 35 percent). Treat a spike as a breach of either threshold.
If neither threshold is breached, exit silently with no notifications. If at least one is breached, fan out to two destinations:
1) Send a Message in Slack to the #brand-watch channel. The message should be structured with the brand name, the time window, the current mention count vs. the baseline, the negative sentiment percentage vs. the threshold, the top 3 to 5 driving themes from Get Topics Analysis (theme name, size, sentiment), and a link back to the underlying Starscape query so a human can dig in.
2) Create Issue in Linear with a clear title (for example, "Negative sentiment spike detected for {brand} at {time}"), a description that mirrors the Slack alert, priority set to high (priority 2), the brand or CX on-call teammate as assignee, and a label of sentiment-spike so the response is formally tracked.
Make the brand tracking query, the Slack channel, the Linear team, the assignee, the volume multiplier, and the negative sentiment threshold configurable inputs at the top of the workflow. Log the computed values on every run, even when the workflow exits silently, so we have an auditable history.
Additional information
What does this prompt do?
- Checks the last hour of brand mentions in Infegy Starscape every hour, on the clock.
- Compares mention volume and negative sentiment against a rolling 7 day baseline you configure.
- Posts a structured alert to a Slack channel with the top driving themes, mention counts, and a link to the live query when something looks off.
- Opens a high priority Linear issue tagged sentiment-spike so the brand or CX on call has a tracked place to respond.
- Stays silent when nothing is wrong, so the channel only lights up when it matters.
What do I need to use this?
- An Infegy Starscape subscription with API access enabled, plus a saved tracking query for your brand.
- A Slack workspace with a channel for brand alerts, such as #brand-watch.
- A Linear workspace where the on call brand or CX teammate can be assigned issues.
- Your baseline numbers, a typical hourly mention volume and a negative sentiment percentage you consider normal.
How can I customize it?
- Change the cadence, run it every 15 minutes during a launch or every 4 hours for quieter brands.
- Tune the thresholds, raise the negative sentiment percentage or volume multiplier so you only alert on genuine spikes.
- Swap recipients, point alerts at a different Slack channel or assign Linear issues to a specific person, label, or project.
Frequently asked questions
Do I need a paid Infegy plan to use this?
What counts as a spike?
Will it spam my Slack channel?
Can I send the alert somewhere other than Slack?
Who gets the Linear issue?
Related templates
Every Friday, get a ready-to-read preview of your league's weekend matches, with positions, form, scorers to watch, and predicted results, posted to Slack.
Every Monday morning, finance leadership gets a clear recap of last week's Braintree sales, refunds, and disputes by email and Slack.
Every morning we check your list of IP addresses for abusive activity, update your spreadsheet, and alert your team only about the risky ones.
Every time you ship to Heroku, we post a clear summary to Slack listing what changed, who deployed it, and whether it was a rollback.
Every morning, check each ClickHouse service against its own backup schedule, get a Slack summary, and a Linear ticket for anything stale or failed.
Every weekday morning, your team gets one Slack briefing on who's flying today, their live flight status, and any delays or cancellations to act on.
Catch a brand crisis before it trends.
Connect Infegy, Slack, and Linear once, and Geni watches your brand every hour and only speaks up when something is wrong.