Maestro City

Rehearse autonomous incident response — before it touches production.

Built for the UiPath AgentHack (Track 1 — Maestro). A live, stateful "city" of enterprise systems where five role-based AI agents detect, reason about, and recover from cascading failures — every decision orchestrated end-to-end through UiPath.

Inspiration

Last year's outages weren't drills. A single cloud region took businesses offline worldwide. One faulty update grounded 7,000 flights. A vendor breach froze payments for thousands of healthcare providers — a $2.3B response. Ascension lost $1.3B to one cyberattack. The pattern is always the same: modern operations don't fail one system at a time. Networks, vendors, payments, cloud regions, identity, staffing, and recovery workflows cascade together — and the most expensive minutes are the ones spent coordinating the response.

So enterprises are racing to put AI agents in charge of that response. But here's the trap: you wouldn't hand an AI agent the keys to your incident response without testing it first — and there is nowhere safe to test autonomous, cross-system crisis response before it touches a real system.

That gap is the whole idea. The city is just the demo vehicle. The real asset is the agentic incident-response layer underneath it — UiPath coded agents, Orchestrator runbooks, and a Maestro Case with a human-approval gate. Maestro City is the rehearsal-and-validation environment for that layer. The same agents and runbooks that would run in production get stress-tested against cascading failures — with the human gate proven out — before they ever go live.

What it does

  • A real-time simulation (1 Hz tick loop over a WebSocket) of enterprise systems — EHR, data center, pharmacy, comms hub, orchestration center, staffing, failover — rendered as a living city in PixiJS.
  • Five role-based AI agents watch and act within configurable autonomy: APEX (executive strategy), SENTINEL (incident response), VERITAS (compliance), ECHO (communications), ARIA (operations).
  • Break something — take the data center offline — and the failure cascades through dependencies. The agents don't wait for me; when they act, each one's reasoning runs on UiPath as a real coded-agent job on a serverless robot, and they fire the matching Orchestrator response processes.
  • A signature Direct → Maestro toggle. In Direct, each agent fires its own coded-agent job. Flip to Maestro Case and a burst of crisis actions collapses into one governed MaestroCity_Orchestrator run that fans out to all five agents in parallel and makes a final gpt-4.1-mini synthesis call into a single coordinated directive — fired once per crisis, not on a timer.
  • The governed Maestro Case (the human gate). Separately, a BPMN Maestro Case authored in UiPath Studio/Maestro sequences the agent stages and inserts a human-approval gate delivered to Action Center — the approval lands in a human's inbox, they approve it, and the case completes. So there are two facets of the same idea: the in-app toggle shows the orchestration collapse into one run; the Studio Case shows the human gate on the platform.
  • I don't just watch — I walk out with deployable artifacts: an After-Action ROI report, a validated Runbook (every step mapped to a UiPath process), an autonomy Calibration certificate, and importable UiPath Studio templates.
  • A Coding Agent (bonus) generates brand-new UiPath XAML workflows from natural language and diagnoses/patches broken ones — and it's itself a coded agent running on a robot.
  • Seven industries out of the box (healthcare, finance, retail, manufacturing, aviation, energy, telecom) plus AI-generated custom scenarios.

How I built it

Frontend: Next.js 14 (App Router) + PixiJS city renderer + Zustand, subscribed to the backend over a WebSocket. Backend: FastAPI + WebSocket + Pydantic, a stateful 1 Hz simulation engine with five agent handlers and a UiPath client. → Frontend on Vercel, the stateful backend on Render.

The UiPath spine — this is the part that matters:

  • External Application (OAuth2 client-credentials) for API auth against the tenant.
  • Coded agents authored with uipath-langchain as LangGraph graphs, reasoning through UiPathAzureChatOpenAI on gpt-4.1-mini via the UiPath LLM Gateway — there are no direct OpenAI calls anywhere in the codebase; all inference is platform-governed. When an operational agent acts, the backend invokes its coded agent as a real job (Direct mode); in Maestro mode the orchestrator fans out to all five.
  • Orchestrator — real packages, releases, and StartJobs on serverless Automation Cloud Robots (Strategy: ModernJobsCount, RuntimeType: Serverless), with job states polled back every tick.
  • MaestroCity_Orchestrator — a published coded orchestrator: one job fans out to all five operational agents as real child jobs, then makes a final gpt-4.1-mini synthesis call into a coordinated directive. Verified live (one orchestrator job → five successful child jobs). This is what the in-app Maestro Case toggle fires.
  • Maestro Case (BPMN, Studio/Maestro) — the governed case that sequences the agent stages and inserts the human-approval gate. It's a separate artifact from the coded orchestrator: I run it via Debug on cloud, the Compliance Gate drops an approval into Action Center, I approve it, and the case reaches Completed — the human-in-the-loop proven end to end on the platform.
  • Action Center — where the human approval task lands.

The five operational agents, the response processes (Incident_Escalation, Crisis_Response, Approval_Chain, Emergency_Staffing, Trust_Recovery_Protocol), the Coding Agent, the scenario generator, and MaestroCity_Orchestrator are all real published objects in the tenant.

A principle I held the whole way: no silent fallbacks. If UiPath auth fails, a release isn't published, or a job faults, the UI shows a Faulted job with the real reason and the API returns a true 502 — it never fakes success. You always know whether automation actually ran. That honesty is the line between a hackathon toy and something an enterprise would trust.

Challenges I ran into

  • Getting real jobs to run — not simulated ones. Serverless robots needed the right OAuth scopes, a robot account with the correct permissions, and ModernJobsCount + Serverless (the legacy "Unattended" strategy fails with errorCode 2818 on serverless folders).
  • LLM Gateway entitlements. External applications can't call the gateway directly (403), so I pivoted scenario generation and the Coding Agent to run as coded agents on robots, which are entitled — which turned out to be the more correct, more governed design anyway.
  • Cross-platform XAML. Compiling process packages with uipcli required the .NET 8 runtime and a precise content/package layout before Orchestrator would accept them.
  • Publishing the coded orchestrator. Publishing a coded agent over a same-named process was rejected with "project type changed (Agent → Process)"; publishing under a new name (MaestroCity_Orchestrator) and creating the folder release via the API got it live cleanly. Bumping a release to a new package version needs UpdateToSpecificPackageVersion, not a plain re-publish.
  • Publishing the Maestro Case hit a known platform bug. Packing the Studio Web solution that contains the Maestro Flow failed with "No tool factory found for project type 'Flow'" — an acknowledged UiPath issue (the unified solution-package format wasn't yet accepted by the tenant feed during the AgentHack). So I ran and demonstrated the Case via Debug on cloud instead, which executes it on the platform without the broken publish step.
  • Taming the Maestro firing cadence. A Case fired on a 25-second timer piled up instances and human-review tasks; I changed it to one run per crisis — no new instance starts while one is still in flight. I also made the live sim auto-idle when no one's watching, so it doesn't burn robot minutes overnight.
  • Multi-scenario correctness. A whole class of bug hid here: simulation logic that resolved buildings by scenario-specific id instead of by type would silently no-op in every non-healthcare and custom scenario. Switching everything to type-based resolution (the factory guarantees the same 7 types across all scenarios) fixed agents, metrics, phase detection, failover, and — surprisingly — the human-approval gate all at once.
  • Human-approval UX. Early on, approvals were a treadmill: approve one and another instantly refilled. I fixed it at the source — dedupe per workflow, a hard queue cap, auto-expiry, decided-means-never-re-gated, and a cooldown after any human decision so clearing the queue actually sticks.

Accomplishments I'm proud of

  • It's genuinely end-to-end on UiPath — real auth, real serverless jobs (including all five operational agents' reasoning), real LLM-Gateway inference, a published MaestroCity_Orchestrator that fans out to all five agents and synthesizes via gpt-4.1-mini, and a Maestro Case whose human-approval gate lands in Action Center and completes after approval — with fail-forward honesty instead of demo smoke.
  • The Direct → Maestro pattern: a single live toggle that turns a scatter of agent actions into one governed, auditable orchestrator run — fired once per crisis.
  • Walk-out artifacts — the simulation emits a governance Calibration certificate and importable Studio automations. I rehearse here and deploy what I proved.
  • A Coding Agent that both authors and maintains UiPath workflows through the gateway.

What I learned

  • How serverless Automation Cloud Robots, LLM-Gateway entitlements, and coded agents actually fit together — and that the entitled, governed path (coded agents) is also the cleaner architecture.
  • Maestro is best understood as a governance layer: the place to collapse autonomous agent bursts into one auditable case with human gates.
  • Building "like production" — refusing silent fallbacks — fundamentally changes the story you can tell. It reframes a sim from a toy into a validation environment an enterprise could actually fund out of existing DR-drill, chaos-engineering, and SOC-training budgets.

What's next

  • Wire the in-app Maestro toggle to start the BPMN Maestro Case directly (and surface live case state in-app) once the Maestro Flow solution-publish bug is resolved — today the toggle drives the coded orchestrator and the Case is run from Studio.
  • Deeper Action Center round-trips: surface the real approval task inside the app and complete it from there to resume the case.
  • Adopt UiPath for Coding Agents (the uip CLI + skills) in the build workflow itself.
  • More industry scenarios, richer cascade physics, and team/multiplayer crisis drills.

Built with

uipath · uipath-langchain · LangGraph · UiPath Orchestrator (serverless robots) · UiPath LLM Gateway (gpt-4.1-mini) · UiPath Maestro · UiPath Action Center · FastAPI · WebSockets · Pydantic · Next.js 14 · PixiJS · Zustand · TypeScript · Python · Vercel · Render

Built With

  • fastapi
  • llmgateway
  • maestrocase
  • next.js
  • orchestrator
  • pixi.js
  • render
  • tickloop
  • uipath
  • uipathclient
  • vercel
  • websockets
  • zustand
Share this project:

Updates