Hourly negative sentiment spike alerts in Slack

By General Input

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.

Integrations

  • Infegy
  • Slack
  • Linear

Type

Deterministic Code

Categories

  • Marketing
  • Customer Support

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.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredChat quality review board for LiveChat support leadsWin back no-show and cancelled appointments every morningLive Loop returns analytics with product-level drill-downNewsletter pre-flight and approval board for Mailjet sendsTurn a prospect spreadsheet into personalized sequence enrollmentsMailjet email delivery lookup console for support teamsCatch feature flags that never got switched on in productionKajabi customer support console for member access fixes