Morning KPI digest from SQL Server to Slack

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.

Agentic Task
SQL ServerSlackOperationsFinanceDaily DigestsAI ReportsNotifications & Alerts
PromptCreate

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).

What does this prompt do?

  • Runs your business KPI queries against your SQL Server first thing each weekday and pulls fresh numbers.
  • Compares every metric to yesterday and to the same day last week, then writes a short executive narrative.
  • Posts the digest to your chosen Slack channel with headline numbers up top, a 'what changed' section, and a watch list of metrics moving the wrong way.
  • Flags anomalies and sharp day-over-day or week-over-week swings worth a closer look so nothing important slips past.

What do I need to use this?

  • A Microsoft SQL Server database (self-hosted, Azure SQL, Amazon RDS, or Google Cloud SQL) with read access to the tables behind your KPIs.
  • A Slack workspace and the channel you want the digest posted to.
  • A short list of the metrics you care about and how to calculate them in T-SQL.

How can I customize it?

  • Change the send time, the timezone, or run it every day instead of weekdays.
  • Swap in your own list of KPI queries and edit names, units, or sort order so the digest reads the way your leadership talks.
  • Tune the thresholds that decide what counts as an anomaly so the watch list matches your team's tolerance for noise.
  • Point it at a different Slack channel, or fan it out to multiple channels for different audiences.

FAQs

Can I use my own metrics?
Yes. The digest is built around a list of queries you can edit. Add, remove, or rename anything, and the narrative adapts to whatever you put in.
Does this work with Azure SQL or Amazon RDS?
Yes. Anywhere your SQL Server is reachable over the network works, including Azure SQL Database, Amazon RDS, Google Cloud SQL, and self-hosted instances.
Will it post to a private Slack channel?
Yes, as long as the connected Slack account is a member of that channel.
How does it decide what counts as a regression?
You set the thresholds. By default it compares each metric to yesterday and the same weekday last week, and flags anything moving sharply in the wrong direction.
Can I include a top-accounts breakdown?
Yes. Add a query for your top accounts (by revenue, usage, or any field), and the agent will weave the standout names into the narrative.

Related templates

Auto-fix your calendar when a flight slips, and flag what's at risk

When your flight moves, your calendar times get corrected automatically and you get a Slack note naming the meetings you're about to miss.

Google Calendar
AviationStack
Slack
Agentic Task
Trace phishing emails to the sending IP and report abuse

Every 15 minutes, forwarded phishing reports get traced back to the server that really sent them, with a verdict in Slack and the worst senders reported.

AbuseIPDB
Gmail
Slack
Agentic Task
Turn procurement portal tenders into CRM deals each morning

Every weekday at 7am, sign in to the tender portals you track, filter new notices against your bid criteria, and open a deal for the ones worth chasing.

Anchor Browser
Google Sheets
HubSpot
+1
Agentic Task
Turn each week's football fixtures into a venue staffing plan

Every Monday, rank the week's matches by expected demand, put the big ones on your venue calendar, and post a rota-ready summary to Slack.

API-Sports
Google Calendar
Slack
Agentic Task
Turn 5 star Yotpo reviews into a weekly marketing content queue

Every Tuesday we pull your best new reviews, draft social captions, email testimonials and product page quotes, then stage them in Notion for approval.

Yotpo
Notion
Slack
Agentic Task
Catch bad shipping addresses before you buy the label

Every weekday morning, unfulfilled orders get an address check: harmless typos fixed automatically, risky addresses held with a note to the customer.

Shippo
Shopify
Gmail
+1
Agentic Task

Read the business in five minutes, before the day starts.

Connect SQL Server and Slack once, and Geni runs a fresh executive digest every weekday at 8:33am in your timezone.