Inspiration

PC Doctor S.A. runs real MSP field operations in Ecuador—client onboarding, quotes, inspections, and technical reports—under strict SOP gates (anti-duplication, hub-first, PDF-first, DB38 math, no placeholders). Field technicians and back-office staff hit exceptions every day: a quote blocked because the PDF is missing, a duplicate RUC in the field, or a report still saying @today. Hackathon environment: The submission is built and verified in UiPath Labshttps://staging.uipath.com/hackathon26_1028/ — with Maestro Case, API Workflows, and webhooks to our public copilot. Some early development used our Community tenant (innerchispa); the same architecture was migrated to Labs for AgentHack judging.

We wanted a governed agentic workflow, not another chatbot. UiPath Maestro Case was the right fit: Intake → Investigation → Remediation → Approval with human-in-the-loop. Our twist: a sovereign Python copilot on our own server that enforces live business rules against real MongoDB data—and analyzes each stage with local Ollama, keeping customer data off cloud LLMs.

What it does

UiPath Labs org: https://staging.uipath.com/hackathon26_1028/ · Agent type: BOTH — Low-code (Maestro, API Workflows, Action Center, Agent Builder) + Coded Agent (Python FastAPI on :8097). Maestro Case Copilot connects UiPath Maestro Case (cloud) to a FastAPI backend that:

  1. Receives webhooks on every Maestro stage (Intake, Investigation, Remediation, Approval).
  2. Runs operational gates from PC Doctor’s playbook against MongoDB (pcdoctor_swarm)—clients, quotes, hubs, documents.
  3. Analyzes findings per stage with Ollama (qwen2.5) and builds a markdown case report.
  4. Stops or advances the flow: blocking gates halt progress; clean cases reach Approval for human sign-off (Action Center + web panel).
  5. Notifies the operator via WhatsApp (Evolution API) when attention is needed. A public jury dashboard shows live activity, a progress bar (0–100%) across the four Maestro stages, operational consultations tied to real clients, and a Platform Usage scorecard (12 UiPath integrations verified).

Operational scenarios (real data, not mock JSON):

Scenario Client What it proves
Happy path Domínguez Gómez Full 4-stage flow → Approve
PDF-first block Urbanización La Pradera Quote blocked—no PDF in documents
Anti-duplication PROBALSA Existing RUC stops re-registration
Report quality Rommy Moeller Placeholder @today blocks delivery

How we built it

Architecture UiPath Maestro Case (UiPath Labs hackathon26_1028) → API Workflow tasks (POST webhook) → FastAPI copilot (:8097, ngrok public URL) → MongoDB PC Doctor + Ollama (:11434) → WhatsApp HITL + Action Center / web panel (POST webhook) → FastAPI copilot (:8097, ngrok public URL) → MongoDB PC Doctor + Ollama (:11434) → WhatsApp HITL + Action Center / web panel

Stack

  • Orchestration: UiPath Maestro Case, API Workflows, User task (Approval)
  • Coded agent: Python FastAPI — process_webhook, gates, case store, stage reports
  • Data: MongoDB pcdoctor_swarm (37+ clients, 22+ quotes from real operations)
  • LLM: Ollama local per stage (sovereignty / no cloud LLM on customer data)
  • HITL: Web dashboard (/dashboard), Action Center pattern, Evolution WhatsApp
  • Dev velocity: ~90% of backend built with Cursor coding agents (UiPath hackathon bonus)
  • Platform bonuses: Agent Builder HTTP bridge, Case App URL, Test Manager smoke + JUnit, Document Understanding upload API

Key modules

  • processor.py — stage logic, gates, Ollama analysis, case persistence
  • tools/gates.py — SOP gates (duplicate client, hub-first, PDF-first, DB38, placeholders)
  • maestro_flow.py — auto-continue remaining stages on same case_id after Maestro Intake
  • operational_consultations.py — jury-ready scenarios anchored to MongoDB clients
  • platform_scorecard.py — live checklist of 12 UiPath product integrations

Cursor was used end-to-end: requirements from Devpost docs, webhook hardening, dashboard UX (progress bar, Continue flow, reset demo), and Maestro troubleshooting guides.

Challenges we ran into

  1. {{caseId}} not substituted — Maestro cloud often sent the literal placeholder. We resolved case IDs server-side, chained stages in MongoDB, and auto-continued Investigation → Remediation → Approval on the same UUID.

  2. Maestro publish errors — Initial Case Management JSON was incomplete (missing tasks/rules). We documented the fix and aligned API Workflow URLs per stage.

  3. Webhook 422 / empty bodies — Maestro sometimes POSTed [object Object] or empty JSON. We accept query params (?case_id=&stage=) and ignore malformed bodies.

  4. Stage chaining confusion — Users expected the web panel to drive Maestro forward; we clarified that Maestro orchestrates in cloud, while our server processes and auto-completes when cloud only fires Intake. Added Continue flow, progress %, and clearer banners.

  5. Community license limits — Some Orchestrator APIs return 405; we use Maestro-native User tasks + local HITL panel instead of forcing legacy BPMN APIs.

  6. Demo noise — Many test Start Jobs cluttered the dashboard. We added Reset cases + log clear for clean jury demos.

Accomplishments that we're proud of

  • End-to-end Maestro Case from Start Job to 100% progress and human Approval on real infrastructure.
  • Real MSP gates that intentionally block bad data (PDF-first, duplicate RUC, report placeholders)—not a always-green demo.
  • Sovereign AI: Ollama local analysis on every stage; MongoDB is the source of truth.
  • 12/12 Platform Usage scorecard: Maestro, API Workflows, coded agent, Cursor, Ollama, MongoDB, WhatsApp, Action Center, Agent Builder, Case App, Test Manager, Document Understanding.
  • Public demo URLs (ngrok): dashboard, webhook, Case App, scorecard—jury can verify without our VPN.
  • Built fast with Cursor agents while respecting PC Doctor’s existing agent pool and MongoDB schema.
  • UiPath Labs verified: OAuth, Maestro Start Job, and webhook flow confirmed on https://staging.uipath.com/hackathon26_1028/ (scorecard 12/12 on live infrastructure).

What we learned

  • Maestro Case is event-driven by tasks, not by arbitrary OData transitions—each stage completes when its API Workflow returns 200.
  • Governance beats generation: the winning demo is “this case stopped because PDF-first failed,” not “the LLM wrote a nice paragraph.”
  • One copilot, two entry points: Maestro Start Job (cloud orchestration) and operational consultations (same process_webhook, explicit client context) share one engine.
  • HITL must be visible: progress bar, stage labels, and Approve only at Approval reduced jury confusion dramatically.
  • Cursor + UiPath complement each other: Maestro for lifecycle governance; coding agents for sovereign backend and gates.
  • Labs vs Community tenant: Hackathon judging requires the UiPath Labs sandbox; we migrated our Maestro Case from an earlier Community dev org to Labs while keeping the same webhook backend and MongoDB gates.

What's next for PC Doctor Maestro Copilot — Sovereign Field Case AI

  • Fix {{caseId}} in Maestro with proper Case variables so cloud UUID matches MongoDB audit trail 1:1.
  • Wire all three API Workflow tasks in Maestro cloud (Investigation, Remediation) so cloud Monitor matches server progress without auto-continue fallback.
  • Embed Case App in UiPath Apps for mobile approve/reject in the field.
  • Expand gates to DB31 financial traceability and DB41 verification rules on quotes and reports.
  • Production hardening: replace ngrok with fixed TLS endpoint, rotate OAuth secrets, and sync Action Center User tasks with panel decisions.
  • Train field staff on blocked-case playbooks—La Pradera (upload PDF), PROBALSA (merge duplicate), Rommy (fix report before send). Built for UiPath AgentHack 2026 — Track 1 Maestro Case · PC Doctor S.A. / InnerChispa · Ecuador

Built With

  • cursor
  • evolution-api
  • fastapi
  • git
  • html/css
  • javascript
  • linux
  • mongodb
  • ngrok
  • ollama
  • python
  • rest-api
  • uipath-action-center
  • uipath-agent-builder
  • uipath-api-workflows
  • uipath-cli
  • uipath-document-understanding
  • uipath-maestro-case
  • uipath-test-manager
  • uvicorn
  • whatsapp
Share this project:

Updates