Skip to content

Build an AI Bug Triage Workflow (Multi-Step)

Updated 2026-06-08·advanced·AI Agent Workflows

Returns a 5-step AI bug triage workflow (intake → classify → severity → owner assignment → duplicate detection) with the prompt for each step, the structured output schema, and the handoff between steps. Final step emits a structured triage decision.

When to use it

  • Automating high-volume bug triage (50+ bugs/week).
  • Building a bot for JIRA / Linear that triages on-creation.
  • Designing an internal AI workflow integrated with chat tools (Slack bot reports incoming bugs).
  • Documenting an AI workflow for review before implementation.

The prompt

XML-tagged — best for Claude 4.x

<role>
You are an AI workflow designer. You know that single-shot triage prompts hallucinate; chained workflows with structured output schemas are more reliable. Each step's output is the next step's input.
</role>

<context>
A well-designed AI triage workflow has:
- **Discrete steps** — each with a specific responsibility
- **Schema between steps** — JSON structure passed from one to next; never free-form text
- **Human checkpoints** — explicit places where a human can intercept before downstream automation
- **Fail-safe** — if any step fails to produce valid output, escalate to human, don't proceed
</context>

<task>
For the team configuration below, design a 5-step triage workflow:
1. **Intake** — accept a raw bug description; output: structured bug data (component, summary, steps if present)
2. **Classify** — label bug class (functional / performance / UX / security / data); output: classification + confidence
3. **Severity** — assign SEV (S1-S4) based on intake; output: SEV + reasoning
4. **Owner assignment** — assign team based on component and class; output: team + rationale
5. **Duplicate detection** — search candidate list; output: top 3 duplicates with scores

For each step, provide:
- The prompt
- Output JSON schema
- How the output feeds the next step
- Human checkpoint markers (after which step humans review)
- Error handling
</task>

<input>
Team / owners configuration: {teams}
Severity rubric (S1-S4 definitions): {severity_rubric}
Bug components inventory: {components}
Duplicate detection candidate source: {dup_source}
</input>

<constraints>
- 5 distinct steps; no fewer.
- Each step has explicit output schema (JSON).
- Output of step N is input of step N+1.
- Final step emits a SINGLE structured decision object.
- Human checkpoint marked after severity assignment (most consequential).
- Error handling: any step returns null / undefined for required fields → escalate.
</constraints>

<output_format>
Six sections:
1. **Workflow diagram** — text flow (Step 1 → 2 → 3 → ...)
2-6. **Per-step detail** — prompt, schema, transitions, human checkpoint, error handling
7. **Integration sketch** — pseudocode for running the workflow as a function chain
</output_format>

Before writing, identify the human checkpoint location and any step requiring particular caution.

Example

Common pitfalls

  • Model produces a monolithic single prompt instead of distinct steps — defeats the chain benefit.
  • Schemas missing between steps; downstream code can't parse output reliably.
  • Human checkpoint omitted — automation runs unsupervised through the most consequential decision.
  • Error handling glossed; what happens when a step fails to produce valid JSON?

Tips

  • Implement step-by-step in production; validate one before adding the next.
  • Log every step's input + output to a database for later audit and improvement.
  • Pair with `duplicate-bug-detector` to deepen Step 5; this prompt sketches it but doesn't give full reasoning rigor.
  • Add a 'kill switch' env var to disable the workflow during outages of LLM or bug tracker.

FAQ

Both have APIs for create / update / link bugs. Workflow runs as a webhook handler. After Step 5, write the structured decision back to the bug tracker as fields + linked-issue relationships. Subscribe to creation events to trigger.

Related prompts