In today's fast-paced digital landscape, business performance isn't a static report—it's a living, breathing entity. Key Performance Indicators (KPIs) like Monthly Active Users (MAU), Customer Churn Rate, or Average Revenue Per User (ARPU) can shift in an instant. The critical question is: how quickly can you detect and react to those shifts?
For too long, we've relied on static dashboards. We open a BI tool, scan through dozens of charts, and try to spot a line that's going in the wrong direction. This manual process is slow, reactive, and prone to "dashboard fatigue." By the time you notice a problem, valuable time has already been lost.
What if your metrics could monitor themselves? What if they could analyze their own trends and alert you the moment a significant shift occurs? This is the power of programmatic trend analysis, a core capability enabled by the KPIs.do platform and its "Metrics as Code" philosophy.
Static dashboards, while visually appealing, have inherent limitations in a dynamic environment:
Programmatic analysis flips this model on its head. Instead of pulling you to the data, it pushes actionable insights from the data directly into your workflows.
Programmatic trend analysis is the practice of using code and automation to continuously monitor performance data, identify meaningful trends, and trigger actions based on those trends. Instead of waiting for a human to interpret a graph, you define the logic for trend detection, and an automated system takes care of the rest.
This is the central promise of KPIs.do: Turn Key Metrics into Actionable Services. Your KPIs stop being passive numbers on a dashboard and become active, autonomous services that work for you.
With KPIs.do, you interact with your metrics through a simple API. Our agentic workflow platform handles the complex backend tasks: connecting to data sources, performing calculations, and analyzing historical data to determine status and trends.
Let's see how easy it is to access this powerful analysis. Using the @do/sdk, you can retrieve the complete status of any KPI with a single API call.
import { KPIs } from '@do/sdk';
// Get the current status of a KPI via the API
const kpi = await KPIs.get('monthly-active-users');
console.log({
name: kpi.name,
value: kpi.currentValue,
status: kpi.status, // e.g., 'on-track', 'at-risk'
trend: kpi.trend, // e.g., 'increasing', 'stable', 'decreasing'
});
The kpi.trend property is where the magic happens. KPIs.do doesn't just give you a raw number; it provides a high-level, statistically determined assessment of the metric's recent trajectory. This simple string—'increasing', 'decreasing', or 'stable'—is the foundation for building powerful automations.
Imagine you want to create a proactive alert for a drop in user engagement. With KPIs.do, you don't just set a static threshold. You can build a workflow that combines status and trend data for a much smarter signal.
Here’s a conceptual example of what this "Metrics as Code" workflow looks like:
import { KPIs } from '@do/sdk';
import { sendSlackAlert, createJiraTicket } from './integrations';
async function monitorUserEngagement() {
// 1. Get the intelligent state of the KPI from the API
const mau = await KPIs.get('monthly-active-users');
console.log(`Checking ${mau.name}: Trend is '${mau.trend}', Status is '${mau.status}'`);
// 2. Define logic based on the trend, not just a static value
const isProblematicTrend = mau.trend === 'decreasing' && mau.status === 'at-risk';
if (isProblematicTrend) {
// 3. Trigger actions in your operational tools
console.log('ALERT: MAU trend is decreasing and the KPI is at risk!');
// Send a notification to the responsible team
await sendSlackAlert(
'#growth-team',
`🚨 *Warning:* Monthly Active Users are trending down! Current value: ${mau.currentValue}`
);
// Automatically create a task to investigate
await createJiraTicket({
project: 'GROWTH',
title: `Investigate dip in MAU trend`,
description: `The MAU KPI is now at-risk and trending downwards. Last known value: ${mau.currentValue}. Please investigate the root cause.`,
});
}
}
// Set this function to run on a schedule via the KPIs.do platform
// or your own scheduler (e.g., a cron job).
monitorUserEngagement();
In this example, the workflow is triggered only when two conditions are met: the metric is already at-risk and the trend is decreasing. This eliminates false alarms from minor daily fluctuations and ensures that your team is only alerted to significant, actionable performance shifts.
Adopting programmatic trend analysis with KPIs.do provides immediate, tangible benefits:
Your business metrics contain a wealth of information beyond a simple number. They tell a story about momentum, acceleration, and trajectory. It's time to use tools that can understand and act on that full story.
By treating your metrics as code, you empower them to work for you. Let agentic workflows handle the monitoring and analysis, so you can focus on making the strategic decisions that drive growth.
Ready to turn your key metrics into actionable services? Explore the KPIs.do API and build your first programmatic trend monitor today.