Tell real CircleCI failures from flaky tests in Slack

When a CircleCI build fails on your main branch, we judge whether it is a flaky test or a real break, then post a plain verdict to your on-call Slack channel.

Agentic Task
CircleCISlack BotEngineeringNotifications & Alerts
PromptCreate

Watch my CircleCI project and run whenever a workflow finishes, using CircleCI's workflow-finished poll trigger. Act only on workflows whose status is failed, and only when they ran on my default branch (main or master). Ignore successful runs, canceled runs, and any run on another branch, so the on-call channel never gets noise.

When a failed workflow comes in on the default branch, call Get a workflow's jobs to read the sequence of jobs and pull out the ones whose status is failed. Keep their names so the alert can list exactly which jobs broke.

Then decide whether this is a known flaky test or a genuine regression. Call Get test metrics for a workflow to see which tests failed in this recent window, and call Get flaky tests for a project to get the tests CircleCI has already flagged as flaky (tests that passed and failed on the same commit). Cross-reference the two: if every failing test is already on the known-flaky list, treat the failure as safe to rerun; if any failing test is not a known flaky one, treat it as a likely real break that needs a human. CircleCI has no raw build log or per-run test-detail action, so base the judgment on these jobs, test-metrics, and flaky-test signals only, and do not claim certainty you cannot get from them.

Post a triage message to my on-call Slack channel using the Slack Bot Send a Message action. Name the failed jobs, state plainly whether this looks like a known flaky test that is safe to rerun or a likely real break that needs a human, and include a link back to the CircleCI build so anyone can dig in. Tag the on-call channel so the right people see it. When every failing test is already a known flaky one, say that clearly and up front so the team does not chase noise; when it looks like a real break, make the call to action for a human obvious.

What does this prompt do?

  • Watches your CircleCI project and reacts the moment a build finishes and fails on your main branch.
  • Figures out which jobs broke and whether the failing tests have a history of being flaky.
  • Posts a plain-language verdict to Slack: a known flaky test that is safe to rerun, or a real break that needs a person.
  • Tags your on-call channel and links straight back to the failed build so anyone can dig in.

What do I need to use this?

  • A CircleCI account with the project you want to watch.
  • A Slack workspace with a channel your on-call team follows.
  • Your team's default branch name (main or master).

How can I customize it?

  • Choose which Slack channel gets the alert and which on-call team gets tagged.
  • Change which branches count, for example to also watch a release branch.
  • Decide how cautious the flaky-versus-real call should be before it asks a human to step in.

FAQs

Will this stop our CI Slack alerts from being noise?
That is the whole point. It only speaks up when a build actually fails on your main branch, and when every failing test is a known flaky one it says so clearly and labels the failure as safe to rerun, so the team does not chase noise.
How does it tell a flaky test from a real break?
It compares the tests that failed in this build against CircleCI's own record of tests that have both passed and failed on the same commit. If all the failing tests are already on that known-flaky list, it calls the failure safe to rerun. If any failing test is not, it flags a likely real break that needs a human.
Does it alert on every branch?
No. By default it only reacts to failures on your default branch (main or master). You can add other branches, like a release branch, if you want.
Will it rerun the build for me?
No. It tells you whether a rerun is safe and links you to the build, but a person still decides and clicks rerun.
Which Slack should we connect?
Any workspace and channel your on-call team watches. It posts as a bot and can tag the channel so the right people see the alert.

Related templates

A brand asset library your marketing team actually searches

Every logo, photo, video cut and ad export in one searchable grid, with previews, campaign tags and rights expiry dates at a glance.

General Input Storage
General Input Database
JigsawStack
+1
App
Turn Mailjet email clicks into ranked HubSpot follow-ups

Twice a day we spot the people clicking your pricing and demo pages, create a follow-up task for their owner, and post a ranked recap to Slack.

Mailjet
HubSpot
Slack Bot
Agentic Task
Clean out the Looker dashboards and Looks nobody opens

One board showing every dashboard and Look with its folder, owner and favorite count, so you can find dead content and retire it safely.

Looker
Slack Bot
App
LiveKit live operations console for room moderation

Watch every live room on one screen, remove disruptive guests, start recordings and end stuck sessions without anyone opening a terminal.

LiveKit
Slack Bot
General Input Database
App
Wake up dormant Keap leads with a researched reason

Every Monday we find leads who never bought, research a real reason to reach out, and send a short personal email instead of another check in.

Keap
Slack Bot
Agentic Task
LiveChat coverage board for planning next week's shifts

See the exact hours your chat queue backs up and customers give up waiting, then plan next week's shifts before it happens again.

LiveChat
Slack Bot
General Input Database
App

Stop chasing flaky CI failures.

Let every CircleCI failure land in Slack already sorted into real breaks and safe reruns.