AI triage for failed Buildkite builds, posted to Slack

By General Input

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.

Integrations

  • Buildkite
  • Slack Bot

Type

Agentic Task

Categories

  • Engineering

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.

Related prompts

Explore more prompts
A brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasonLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsLinkedIn Ads budget pacing dashboard for every client accountGive your team Looker numbers without buying more seatsPause marketing emails to escalated customers, then restore them