Weekly
Find the jobs that got slower this week
Each week you see which jobs in a workflow got slower or less reliable compared with the week before.
- Runs
- Weekly
- Apps
- CircleCI
- AI
- Not needed
- Access
- read
Send this to your assistant
Create a ClickRuntime automation: every Monday, email me the 5 slowest and 5 least reliable jobs in my build-and-test workflow, and how each changed from last week.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A pipeline rarely gets slow all at once. One job adds a heavier test suite, another picks up a larger Docker image, and over a quarter the same workflow goes from comfortable to painful. Because every individual run looks only slightly slower than the one before, no one raises a ticket.
Each week, this pulls CircleCI's job metrics for the workflow, compares them with the numbers it saved the week before, and emails you the jobs with the biggest changes, whether they slowed down or fail most often. The comparison with last week is what makes it useful, since it shows movement rather than a static ranking.
Platform and developer-experience engineers tend to use it as their weekly input for deciding which pipeline problem to fix next. The comparison with stored numbers is what separates this from a plain ranking, since a job that has always been slow is less urgent than one that suddenly got slower.
What you get out of it
Find the job that quietly got worse
A saved comparison reveals a job that took 6 minutes last week and 9 this week. Spotting that jump within days tells you which commit to look at, rather than guessing months later.
Prioritize pipeline work with evidence
Engineering time for CI is scarce. A ranked list of biggest regressions shows where the next hour of effort recovers the most developer waiting time across the team. A ranking of the largest changes points to the biggest wins first, so a short sprint of CI work delivers visible results.
Reduce spend on compute
Longer jobs consume more credits. Catching a runaway job early can shave real money off the CircleCI bill before it becomes a line item that finance asks about. Teams often discover that one or two jobs consume most of the compute, which makes the first optimization an easy decision.
Learn which jobs fail most
The list includes jobs that fail frequently, not just slow ones. A job that fails one run in five costs reruns and trust, and it deserves a named owner. Trust in the pipeline recovers quickly once the worst offenders are fixed, because developers stop expecting long waits and reruns.
Keep a history of pipeline performance
Because last week's numbers are stored for each run, you gradually build a week-by-week record. It shows whether an optimization project really worked or the gain faded. The same record settles later debates about whether an optimization actually stuck or the gain slowly faded away.
How it works
What happens, step by step
Once a week, ClickRuntime pulls the run times and success rates for each job in your chosen CircleCI workflow.
It compares them with the figures it saved the week before.
You get an email showing the slowest jobs and the biggest changes, like "e2e-tests: 14.2 min (was 12.8 min)". This week's numbers are saved for next time.
Before it runs live
- Connect CircleCI
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 CircleCI steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, credentials, http, notify, state
PROJECT, WORKFLOW = "gh/acme/web-app", "build-and-test"
@on_trigger
def run(event):
resp = http.get(f"https://circleci.com/api/v2/insights/{PROJECT}/workflows/{WORKFLOW}/jobs",
params={"reporting-window": "last-7-days"},
headers={"Circle-Token": credentials.secret("CIRCLECI_TOKEN")})
resp.raise_for_status()
jobs = {j["name"]: {"p95": j["metrics"]["duration_metrics"]["p95"], "ok": j["metrics"]["success_rate"]}
for j in resp.json()["items"]}
last = state.get("last_week") or {}
def line(name, key, fmt):
prev = last.get(name, {}).get(key)
change = f" (was {fmt(prev)})" if prev is not None else ""
return f" {name}: {fmt(jobs[name][key])}{change}"
slow = sorted(jobs, key=lambda n: -jobs[n]["p95"])[:5]
flaky = sorted(jobs, key=lambda n: jobs[n]["ok"])[:5]
text = ("Slowest (p95):\n" + "\n".join(line(n, "p95", lambda s: f"{s / 60:.1f} min") for n in slow) +
"\n\nLeast reliable:\n" + "\n".join(line(n, "ok", lambda r: f"{r * 100:.0f}%") for n in flaky))
notify.email_me(f"{WORKFLOW}: slowest and least reliable jobs", text)
state.set("last_week", jobs)
return {"jobs": len(jobs)}FAQ
Common questions
How does it know what changed since last week?
Can it show only jobs slower than a certain amount?
Will the numbers include queued time?
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
Get a weekly build health report
Every Monday you see each workflow's success rate and typical duration for the past week.
See how it worksGet the week's flaky tests on Friday
Each Friday you get the tests CircleCI has marked as flaky, so someone can fix them.
See how it worksSee yesterday's failures on main each morning
One email each morning lists the workflows on main that failed the day before, with links, and needs no webhook.
See how it worksKeep exploring
Set up “Find the jobs that got slower this week” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.