Hourly
Get alerted when a metric crosses a limit
A query runs every hour and you hear in Slack as soon as the value passes your threshold.
- Runs
- Hourly
- Apps
- BigQuery
- AI
- Not needed
- Access
- read
Send this to your assistant
Create a ClickRuntime automation: every hour, count failed orders in the last hour from shop.orders and post to #ops in Slack if there are more than 20.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A growth team watches a number that matters: signups per hour, failed payments in the last day, queue depth in an events table, revenue against a daily floor. In BigQuery that number is one query away, but nobody runs it every hour. A tracking bug that drops signups to zero on a Friday evening is discovered Monday, after the whole weekend of paid traffic was wasted.
On an hourly schedule, ClickRuntime runs the BigQuery query you define, compares the single value it returns with your limit, and sends a notification only when the limit is crossed. You choose the query and the direction of the comparison, for example below 50 signups or above 1,000 errors. When the metric is healthy, nothing is sent.
It works well for engineers and analysts who already have a trusted SQL definition of the metric and want it to speak up on its own.
What you get out of it
Broken tracking found in hours
If an event pipeline stops writing rows, the hourly count drops and the alert fires that same afternoon. Spotting a silent break early limits how much bad or missing data piles up before someone repairs it.
Ad spend stops going to nowhere
A sudden fall in conversions while campaigns keep spending is expensive. A notification when the metric crosses its floor lets someone pause budget within the hour instead of at the next weekly review.
One definition of the metric
The threshold is checked against your own SQL, so the alert agrees with the number your team already reports. There is no second tool computing a slightly different figure that people argue about.
Quiet when things are fine
Only a crossed limit produces a message, so people do not learn to ignore it. A channel that speaks rarely gets read when it does, and that matters during a real incident.
Fewer manual dashboard checks
Analysts stop opening the same dashboard each morning to confirm nothing changed. That time moves to investigating the alerts that actually mean something. That reclaimed time matters most for small teams where one analyst covers every report.
How it works
What happens, step by step
Every hour, ClickRuntime runs your BigQuery query, such as failed charges in the last hour.
It compares the result with the limit you set.
When the value goes over the limit, it posts to your #alerts Slack channel, such as "Failed charges in the last hour: 41 (threshold 25)".
It only alerts once while the value stays high, and is ready to alert again after it drops back.
Before it runs live
- Connect BigQuery
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other BigQuery steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, credentials, http, state, notify
PROJECT = "my-project"
SQL = "SELECT COUNTIF(status = 'failed') FROM payments.charges WHERE created_at >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 HOUR)"
THRESHOLD = 25
@on_trigger
def run(event):
res = http.post(f"https://bigquery.googleapis.com/bigquery/v2/projects/{PROJECT}/queries",
headers={"Authorization": f"Bearer {credentials.connection('google', 'work')}"},
json={"query": SQL, "useLegacySql": False}).json()
value = float(res["rows"][0]["f"][0]["v"] or 0)
over = value > THRESHOLD
if over and not state.get("alerting"):
notify.slack(f"Failed charges in the last hour: {value:.0f} (threshold {THRESHOLD})", channel="#alerts")
state.set("alerting", over)
return {"value": value, "over": over}FAQ
Common questions
What kind of query works for a threshold check?
Will it keep notifying me every hour while the metric stays bad?
Does each run cost me BigQuery query charges?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Save API snapshots to a BigQuery table
Data from an API is appended to your table with a timestamp on each run, building a history you can query.
See how it worksGet your KPI query results every morning
Your saved SQL runs each morning and the results arrive as a table in your inbox.
See how it worksHear when a table stops updating
Each morning you're told if a table hasn't changed in the last day, so broken pipelines get noticed.
See how it worksKeep exploring
Set up “Get alerted when a metric crosses a limit” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.