Morning KPI digest from SQL Server to Slack

By General Input

Every weekday at 8:33am, your database becomes a short executive briefing in Slack with the day's headline numbers, wins, regressions, and a watch list.

Integrations

  • SQL Server
  • Slack

Type

Agentic Task

Categories

  • Operations
  • Finance

Build me an agent workflow that posts a morning KPI digest from my Microsoft SQL Server database to a Slack channel every weekday.

Trigger: cron, weekdays (Mon to Fri) at 8:33am in my local timezone.

What the agent should do each run:

1. Run a small, configurable set of T-SQL aggregation queries against my SQL Server via the Custom Query operation. The queries should cover the metrics that matter for the business: at minimum daily revenue, new signups, active users, churn, top accounts by revenue, and any metric trending sharply day-over-day or week-over-week. Treat the query list as configuration so I can swap in my own.

2. For each KPI, compute the current value, yesterday's value, the same-weekday-last-week value, the absolute delta, and the percent change. The agent should do these comparisons itself rather than dumping raw query rows into Slack.

3. Classify each KPI as a win (moved sharply in the good direction), a regression (moved sharply in the bad direction based on whether higher or lower is better for that metric), or steady. Flag anomalies that exceed a configurable threshold (default plus or minus 20 percent day-over-day, or plus or minus 15 percent week-over-week).

4. Write a short executive-style narrative (2 to 4 sentences) summarizing the state of the business. Call out wins, regressions, and anomalies worth investigating. No fluff, no filler.

5. Post the digest to a Slack channel via the Send a Message operation. Structure the message as:

- Headline: the 3 to 5 most important KPIs with current value and percent change versus yesterday and last week.

- What changed: a bulleted list grouping wins and regressions with one-line context for each.

- Watch list: metrics moving in the wrong direction that the team should keep an eye on, with a hint at what to look at.

Use Slack mrkdwn formatting (single asterisks for bold, underscores for italics) and short lines so it reads well on mobile.

Configuration the user should be able to edit without touching code:

- The list of KPI queries: name, T-SQL, unit (dollars, count, percent), direction (higher is better or lower is better), and optional comparison period override.

- Anomaly thresholds: percent day-over-day and percent week-over-week.

- Target Slack channel.

- Cron time and timezone.

- Optional top-accounts query for a movers section.

Error handling: if a query fails or returns no rows, the agent should note that in the digest (for example, 'Active users query returned no data') rather than skipping silently or breaking the whole post.

Integrations: SQL Server (Custom Query) and Slack (Send a Message).

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