> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trunk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Flaky Tests: AI Investigations Delivered via Webhooks

> AI-powered investigations run automatically when a test first becomes flaky, with the findings delivered to your configured webhook endpoint.

**AI-powered investigations now run automatically when a test first becomes flaky, and the findings are delivered to your configured webhook endpoint.**

When the detection engine marks a test as flaky for the first time, Trunk kicks off an AI investigation in the background. The investigation gathers context from CI runs, Git history, and related code, then emits a structured payload to your webhook. This is useful for teams that want flaky test triage to land directly in Slack, a ticket, or any internal automation, without engineers chasing down context by hand.

[Read the docs](/flaky-tests/webhooks#testcaseinvestigationcompleted) to learn more.
