Inspiration

Every engineering team knows the ritual: a CI pipeline goes red, someone copies job logs into a chat, twenty minutes of archaeology follow, and the "fix" gets pushed with no review trail. We wanted the response to a pipeline failure to be as governed as the code itself — diagnosed by AI, but approved by a human through a real case-management workflow.

What it does

PipelineGuard turns every GitLab pipeline failure into a UiPath Maestro Case that moves through five auditable stages: Open → AI Diagnosing → Human Review → Fix Applied → Closed.

  1. GitLab fires a pipeline-failure webhook at a UiPath Orchestrator API Trigger
  2. Main.xaml orchestrates the response: DiagnoseWithAI.xaml calls our Cloud Run agent, where Gemini 2.5 Flash reads the failed job logs through MCP tooling and produces a root cause, failure category, and a unified-diff fix proposal — in ~46 seconds
  3. CreateMaestroCase.xaml opens the Maestro Case with the full diagnosis as case data
  4. HumanReview.xaml creates an Action Center task — an engineer sees the root cause and proposed diff side by side and clicks Approve or Reject
  5. On approval, PostApprovedFix.xaml posts the fix to the GitLab merge request via our /api/uipath/callback endpoint

No fix reaches the repository without a human signature. Every incident leaves a complete case history.

How we built it

  • UiPath: Studio Web project (Main.xaml + 4 workflows), Orchestrator Assets for configuration, a Maestro Case Catalog (Pipeline Failure Incident) with 6 data fields, Action Center for human-in-the-loop approval, and an API Trigger as the entry point. The Cloud Run service can also trigger the process directly via OAuth2 client-credentials (OR.Jobs OR.Jobs.Execute scopes) with automatic token refresh.
  • AI backend: Python/FastAPI on Google Cloud Run. Gemini 2.5 Flash receives tools from MCP servers (job log retrieval, failure categorisation, MR note posting) and emits structured diagnoses.
  • GitLab: webhook integration plus MR comment posting, so the approved fix lands where developers already work.

Challenges we ran into

  • Designing the handoff so UiPath owns process state while the AI agent stays stateless — case data lives in Maestro, not in our service
  • OAuth2 token lifecycles for unattended API Trigger calls (solved with a client-credentials exchange and graceful fallback to local diagnosis if the trigger fails)
  • Making a 46-second AI diagnosis feel synchronous inside a workflow engine built for long-running cases

Accomplishments we're proud of

  • A complete closed loop — failure to approved fix — with zero custom UI: Action Center is the approval surface
  • The agent's fix proposals are unified diffs, not prose, so approvers review exactly what will be posted
  • 70 automated tests and a fully reproducible 20-minute setup guide (uipath/SETUP.md)

What we learned

Maestro's case model is the missing piece for AI agents in production: the agent supplies judgment, but the case supplies accountability — stages, data, audit trail, and a human gate.

What's next

Auto-applying approved fixes as MR commits, failure-pattern analytics across cases, and packaging the Maestro template for the UiPath Marketplace.


Built end-to-end with Claude Code (Anthropic's AI coding CLI) driving development across the UiPath workflows, the FastAPI service, and the test suite.

Built With

Share this project:

Updates

Submission history