AI triage for failed Buildkite builds, posted to Slack

When a build fails, an AI assistant reads the failing job's log, explains the likely cause in plain English, and posts a clear alert to your Slack channel.

Agentic Task
BuildkiteSlack BotEngineeringNotifications & Alerts
PromptCreate

When a Buildkite build finishes in a failed state, investigate what went wrong and post a clear, human-readable alert to Slack. Trigger this workflow on a Buildkite webhook for the build.finished event, and only continue when the build's state field is the lowercase string "failed". Ignore builds that finished passed, blocked, or canceled.

Before doing anything else, make sure this is the first time the branch has turned red so the channel is not spammed on repeated failures. Use List Builds for a Pipeline, filtered to this pipeline and branch, to find the build that finished immediately before this one. Only continue if that previous build passed, which means this is a passing-to-failing transition. If the branch was already failing on the prior build, stop without posting anything, the same way Buildkite's own started-failing notifications behave.

Once you have confirmed this is a new failure, use Get a Build to pull the build's details: the pipeline name, branch, commit hash, commit message, and the person who created the build, including their name and email. Identify which jobs in the build failed, and for each failed job use Get a Job's Log Output to read the tail end of the log, where the error usually surfaces.

Read the failing logs and write a short, plain-English diagnosis of the most likely cause. Classify it into one of: a failing test, a compile or build error, a timeout, or an infrastructure or flaky-runner issue, and briefly say what in the log points to that conclusion. Keep it to a couple of sentences that a busy engineer can skim.

Post the alert to the team's Slack channel as a bot using Send a Message. Include the pipeline and branch, the specific step or job that failed, your plain-English diagnosis, and a direct link to the build in Buildkite. Try to mention the commit author: take the build creator's email and use Look Up User by Email to find their Slack user, then @-mention that user in the message so they see it. If there is no matching Slack user, just name the author in plain text. Format the message with Slack mrkdwn so the pipeline, branch, and failing step stand out.

What does this prompt do?

  • Watches Buildkite for builds that finish in a failed state and jumps in automatically.
  • Reads the end of the failing job's log and writes a plain-English diagnosis of the likely cause, whether that's a failing test, a broken build, a timeout, or a flaky runner.
  • Posts a clear alert to Slack with the pipeline, branch, the step that failed, the diagnosis, and a link straight to the build.
  • Only pings the channel the first time a branch turns red, so your team isn't spammed on every repeated failure.

What do I need to use this?

  • A Buildkite account with the pipelines you want to monitor.
  • A Slack workspace and a channel where alerts should be posted.
  • Optional: matching email addresses between Buildkite and Slack so the right person gets mentioned.

How can I customize it?

  • Choose which pipelines or branches trigger an alert, for example only your main branch or your production pipelines.
  • Pick the Slack channel and decide whether to @-mention the person who pushed the commit.
  • Adjust the tone and length of the diagnosis, or how much of the log the assistant reviews.

FAQs

Will this spam my channel every time a build fails?
No. It only alerts the first time a branch goes from passing to failing, so you get one heads-up per new breakage instead of a message on every repeated red build.
How does it know what caused the failure?
It reads the end of the failing job's log and summarizes the likely cause in plain English, sorting it into a failing test, a build or compile error, a timeout, or an infrastructure or flaky-runner issue.
Will it tag the person who broke the build?
If the commit author's email matches someone in your Slack workspace, the alert @-mentions them. If there is no match, it simply names them in the message instead.
Can I limit it to certain pipelines or branches?
Yes. You can scope the alerts to specific pipelines or branches, so you only hear about the builds that matter, like your main branch or production deploys.
Does it work with private Slack channels?
Yes, as long as the Slack bot has been added to the channel where you want alerts posted.

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 staring at red builds trying to guess what broke.

Let an assistant read the log, explain the failure, and alert the right person in Slack the moment a build turns red.