CHATBOTS

Discord Bot: Explain Why My MR Pipeline Failed

A Discord slash-command bot that takes a GitLab MR or pipeline ID, pulls the failed job logs, and replies in-channel with a plain-English root cause and the exact failing step.

CategoryChatbots
Enginesim
Difficultyintermediate
Triggerchat
Steps6
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerDiscord slash command /whyfail with MR or pipeline IDDiscordDiscord
  • ActionResolve ID and fetch pipeline jobs from GitLabGitLabGitLab
  • LogicBranch: any job failed? If not, reply all-green
  • ActionDownload raw trace for first failed jobGitLabGitLab
  • ActionParse trace and extract root cause with LLMOpenAI
  • OutputPost threaded root-cause reply in DiscordDiscordDiscord

What it does

Contributors run a slash command in Discord with their merge request or pipeline ID. The bot fetches the failed pipeline from GitLab, downloads the trace of the first failing job, and returns a short, plain-English explanation of what broke and where, so they don't have to read hundreds of log lines or ping a maintainer.

When to use it

Use this when your repo gets frequent "why did CI fail?" questions in chat and maintainers spend time triaging trivial failures (lint, type errors, flaky tests). It turns self-serve triage into a 10-second command.

How it works

  1. 1A contributor invokes a Discord slash command (`/whyfail <mr-or-pipeline-id>`).
  2. 2The bot resolves the ID to a pipeline and lists its jobs via the GitLab API.
  3. 3A branch checks whether any job failed; passing pipelines short-circuit to a friendly "all green" reply.
  4. 4For the first failed job, it downloads the raw job trace from GitLab.
  5. 5An LLM parses the trace, classifies the failure type, and extracts the exact failing command and error line.
  6. 6The bot posts a threaded reply in Discord with the root cause, the failing step, and a suggested next action.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect DiscordCommunity channels + voice + bots.
  2. 2
    Connect GitLabRepos, MRs, pipelines, registry.
  3. 3
    Connect OpenAIModels, embeddings, files.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.