Daily business KPI digest from MySQL to Slack
Every weekday at 9am ET, get a plain-English KPI digest of signups, active users, revenue, and anomalies from your MySQL database, posted to a Slack channel.
Build me an agent workflow that runs on a cron schedule every weekday at 9am America/New_York and posts a business KPI digest from my MySQL database into a Slack channel.
Trigger: cron, weekdays 9am ET.
Tools the agent should use:
1) MySQL Custom Query — to run a small set of analytical SQL queries against my database. The agent must run these queries one at a time, not in a single multi-statement request.
2) Slack Bot Send a Message — to post the final digest as a single nicely formatted message to a channel I pick during setup.
Make the SQL queries configurable up front. During setup, the user should paste in their own table and column names for each metric. The default metric set the agent should ask for is: signups in the last 24 hours; active users this week vs last week (week-over-week); revenue this week vs last week; top 5 accounts by usage this week; anomaly flags where a metric has moved more than 20 percent against its trailing 7-day average.
Each metric is its own SQL query the user provides. Store them as workflow inputs so they can be edited later without rewriting the workflow.
Runtime behavior the agent must follow:
- Run each configured query via MySQL Custom Query, one at a time.
- If a query returns zero rows or an empty result, skip that metric and continue with the remaining metrics. Do not fail the whole run because one metric is empty.
- If a query returns an actual database error (bad column, syntax error, permission denied), note that metric as failed in the final digest but still post whatever other metrics succeeded.
- After collecting results, interpret the numbers in plain English. Compute the percentage change vs the comparison period where relevant (week-over-week for active users and revenue, vs trailing 7-day average for the anomaly check).
- Call out which metrics look healthy (growth, stable) versus which need attention (declines, anomalies past the 20 percent threshold).
Output format: one Slack message, posted with Slack Bot Send a Message to the channel configured during setup. Use Slack mrkdwn formatting: a bold header line with the date, then short sections for each metric. Each section should include the headline number, the comparison number, the percent change, and one sentence of interpretation. End with a Healthy vs Needs Attention summary at the bottom.
Keep the message scannable and under roughly 1500 characters. Avoid raw SQL or technical jargon in the Slack output. Do not paste tables of rows directly. Summarize.
Inputs to collect at setup time: MySQL credential, Slack Bot credential, target Slack channel ID or name, and the SQL for each metric the user wants included.
Additional information
What does this prompt do?
- Runs the KPI queries you defined against your MySQL database on a weekday morning schedule, so nobody has to remember to open a SQL client.
- Translates raw numbers into a short, readable story: what grew, what shrank, and what looks off versus the last week.
- Flags anomalies automatically when a metric moves more than 20 percent against its trailing 7-day baseline.
- Posts one cleanly formatted message to the Slack channel of your choice, so the whole team starts the day on the same page.
What do I need to use this?
- A MySQL database you can connect to with read access on the tables you want to report on.
- The KPI questions you care about (signups, active users, revenue, top accounts, anything else) and which tables and columns answer them.
- A Slack workspace and the channel where the digest should land each morning.
How can I customize it?
- Swap in your own SQL during setup, so the queries point at your real tables and column names without rewriting the workflow.
- Change the schedule. 9am ET is the default, but you can move it to any time of day or shift to weekly, monthly, or post-deploy windows.
- Add or remove metrics. Drop a query you do not care about, add new ones for churn, NPS, support tickets, or anything else you can write SQL for.
- Reroute the message. Send it to a different Slack channel, a private channel for leadership, or even a DM to yourself.
Frequently asked questions
Do I need to know SQL to use this?
What happens if one of my queries returns no data?
Will this work with my cloud database provider?
Is my database safe? Do you store the data?
How do I change which Slack channel it posts to?
Can I add more KPIs later?
Stop opening a SQL client every morning.
Connect MySQL and Slack once, and Geni runs the same KPI report at 9am every weekday, in plain English.