ChatCompletion icon
SlackIncomingWebhook icon

Summarize Incident Reports with Mistral and Post to Slack

Summarize incident reports into a two sentence ops update with Mistral chat completions in Kestra, and post the summary to Slack with failure alerts.

Categories
AI

Incident write-ups are long, and the people who need the gist rarely read them. This blueprint sends the raw report to a Mistral model through io.kestra.plugin.mistral.ChatCompletion, asks for exactly two sentences of plain prose, and posts the result to Slack. The system message pins the format, the user message carries the report, and the assistant text comes back as a single string output ready to interpolate.

How it works

  1. summarize (io.kestra.plugin.mistral.ChatCompletion) sends two messages to the Mistral API: a SYSTEM message that fixes the output to two sentences of plain prose without quotation marks, and a USER message carrying {{ inputs.incident_text }}. The model name comes from the model_name input, defaulting to mistral-small-latest.
  2. The assistant text is exposed as {{ outputs.summarize.response }}, with the full API response available as {{ outputs.summarize.raw }} for debugging.
  3. notify posts the summary to Slack. Because the system message forbids quotation marks and line breaks, the response interpolates into the JSON payload as a plain scalar; if you relax the prompt, escape the text before placing it in JSON.
  4. The errors block posts a distinct Slack alert when the API call fails, naming the flow and execution.

What you get

  • A consistent two sentence summary for every incident, regardless of how the original report is written.
  • The model output as a first-class flow output, reusable by downstream tasks such as ticket updates or status pages.
  • A prompt shape that keeps LLM prose safe to interpolate into a JSON notification payload.
  • A failure alert so a broken API key or model error never fails silently.

Who it's for

  • On-call engineers who write detailed post-incident notes but need a short version for leadership channels.
  • Platform teams standardizing incident communication across services.
  • Anyone evaluating the Mistral plugin who wants a small, useful first flow.

Why orchestrate this with Kestra

A one-off script can call the Mistral API, but the summary only matters if it reliably reaches the channel every time. Kestra wraps the call with secret management for the API key, retries and execution history, typed inputs so anyone can run it from the UI with their own report text, and output passing straight into the Slack notification.

Prerequisites

  • A Mistral API key with access to the chosen model.
  • A Slack incoming webhook for the summary and failure alerts.

Secrets

  • MISTRAL_API_KEY: Mistral API bearer token.
  • SLACK_WEBHOOK_URL: Slack incoming webhook URL.

Quick start

  1. Add the two secrets to your Kestra namespace.
  2. Execute the flow with the default incident text and check the two sentence summary in Slack.
  3. Replace incident_text with a real report, or call this flow from your incident tooling.

How to extend

  • Trigger the flow from a webhook so your incident management tool posts reports automatically.
  • Add jsonResponseSchema to extract structured fields such as severity and affected service alongside the prose summary.
  • Route the summary to a ticketing system or status page task after the Slack post.
  • Switch model_name to a larger model for long or messy reports.

Links

Orchestrate with Kestra
Orchestrate Slack with Kestra
Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.