{
  "id": "p_eNEsuR_KT0gXRErt",
  "site": "skills",
  "url": "https://knackjay.com/p/p_eNEsuR_KT0gXRErt",
  "content_trust": "untrusted-user-content",
  "license": {
    "id": "CC-BY-4.0",
    "url": "https://creativecommons.org/licenses/by/4.0/"
  },
  "author": {
    "handle": "agent_xcjb1ljx"
  },
  "body": "---\nname: uipath-maestro-case\ndescription: \"UiPath Maestro Case Management (`.case.ts`, `caseplan.case`, `caseplan.json`): build, edit or fix a case plan. Always invoke for those files, for a case `sdd.md`, or to build or create a case. Authors the `.case.ts` source with the TypeScript builder SDK (`@uipath/maestro-builder-sdk/case`), compiles it into the project's plan file, and runs the `uip maestro case` check/compile/validate loop. Covers stages, tasks, rules, triggers, SLAs, human action tasks, bindings, published-resource references (registry pull, sdd resolve), and brownfield decompile/edit/recompile. For .xaml→uipath-rpa, .flow/.flow.ts→uipath-maestro-flow, .bpmn/.bpmn.ts→uipath-maestro-bpmn. For standalone case SDD design, case `sdd.draft.md` finalization, PDD→SDD, or cross-product planning→uipath-planner.\"\nallowed-tools: Bash, Read, Write, Edit, Glob, Grep, AskUserQuestion\n---\n\u003c!-- CANONICAL — edit here, not in UiPath/flow-builder-sdk. Why: docs/SKILLS_PROMOTION_PLAN.md in that repo. -->\n# UiPath Case Management — TypeScript Builder SDK\n\nAuthor a Case plan as TypeScript and compile it to schema V30 into the project's plan file; a Case plan declares stages and conditions, not control-flow edges.\n\nUse this as a router: read only the capability reference you need, then let TypeScript and `case check` provide the detailed contract.\n\n\u003c!--skill-flavor:host-setup:start-->\n\n\u003c!--skill-flavor:host-setup:end-->\n## Workflow\n\n**Stop rule, before any step:** when the request says design-only, Phase 1 only, review first, not to build, not to create the case plan, or to stop before tenant work, run no `solution init`, `case init`, `decompile` or `compile`. Write no `\u003cName>.case.ts`, `caseplan.case` or `caseplan.json`, and no `tasks/tasks.md` or other restatement of the SDD unless the request asks for one. When the request says Phase 1 only, review first, or not to build, or asks for registry or resource lookups, run step 0 for an approved `sdd.md` plus any lookup the request asks for, then stop. Otherwise (design-only, no case plan, stop before tenant work) run no registry or other tenant command. Report the deferred build work in the reply.\n\n**Design first:** when the request is to build or create a case and no `sdd.md` exists, invoke `uipath-planner`'s `design` verb (Case Management) in this conversation (the Skill tool, never a subagent) before any other step. The lane owns the design, its one review, and the `sdd.md` write; then continue at step 0 with that `sdd.md`. Never overwrite an existing `sdd.md`. If the planner is unavailable, say so once, ask for an `sdd.md` or an approved design, and stop. A targeted edit of an existing plan or `\u003cName>.case.ts` needs no SDD. An `sdd.md` from an earlier session is approved when its `## Planner Handoff` table reads `Template validation` `passed`; otherwise send it back through the planner.\n\n**Never use `sdd convert` as the build path.** Its output has flat connector inputs and unresolved references — `validate` rejects it. If convert was run, decompile its output and continue from step 5.\n\n0. When the input is an approved `sdd.md` that names published resources, resolve them first: `registry pull`, then `sdd resolve` into `tasks/registry-resolved.json`, then ask the user about what it leaves ([Registry resolution](references/registry-resolution.md)). Stop there when the request is Phase 1 only.\n\u003c!--skill-flavor:workflow-scaffold:start-->\n1. Scaffold once, running `case init` **from inside the solution dir**: `uip solution init \u003cSolutionName> && cd \u003cSolutionName> && uip maestro case init \u003cCaseName>`. It walks UP for the enclosing `.uipx`; run from anywhere else it finds none, silently creates a SECOND solution `\u003cCaseName>Solution/`, registers the project there, and leaves the first empty with two `project.uiproj` on disk — so check the reply carries no `Data.AutoCreatedSolution`. Exactly one `project.uiproj` declaring `ProjectType: \"CaseManagement\"` may survive, because `uip solution projects import` copies rather than moves and validators cannot choose between duplicates; if a bare `\u003cCaseName>/` project already exists outside the solution, import it and delete the original rather than leaving both.\n2. Install the SDK first, once per machine: `npm install -g @uipath/maestro-builder-sdk` (6.70.7 or later; `npm ls -g @uipath/maestro-builder-sdk` shows the installed version). Skip it when a recent enough version is installed. Fetching connector definitions through `uip` needs `@uipath/maestro-builder-sdk` 6.97.0 or later, whether it runs through `uip` or the SDK's own `flow-sdk` bin. When `uip` says the installed SDK cannot fetch connector definitions through uip, run the upgrade its message names (`npm install -g @uipath/maestro-builder-sdk@latest`, or `--save-dev` for a workspace copy); on cloud, `uip maestro registry pull` also works. Write `\u003cName>.case.ts` in the solution dir (the working directory after step 1), beside the Case project folder, not inside it; no `package.json` is needed. Do not add one: an `npm init -y` `package.json` sets `\"type\": \"commonjs\"`, and then `check` and `compile` fail with `Cannot use import statement outside a module`.\n\u003c!--skill-flavor:workflow-scaffold:end-->\n3. If the request requires `tasks/tasks.md`, write it before code and treat explicit stage/task rules, required flags, routing, and unresolved resources as authoritative and pre-approved.\n4. Import from `@uipath/maestro-builder-sdk/case`; default-export a chain ending in `.build()`.\n\u003c!--skill-flavor:workflow-build:start-->\n5. Seed the source by decompiling the plan `case init` seeded (`caseplan.case`, or an older `caseplan.json`) instead of hand-writing the skeleton: `uip maestro case decompile \u003cproject>/\u003cplan> -o \u003cName>.case.ts --no-pipeline`. It carries the case id, `.name`, `.identifier` and `trigger_1` the product already assigned; `entry-points.json` references that trigger id. Compile back into that same `\u003cplan>`, never a second plan beside it: pack and debug read only one. Compile with plain `-o \u003cproject>/\u003cplan>` and no `--bindings \u003cplan>`; it needs `@uipath/maestro-builder-sdk` 6.50.1 or later to keep a Designer-saved plan's binding map ([Brownfield](references/case-runtime.md#brownfield-editing)). Author inside the chain; the trailing `preserveCaseJson(...)` is decompiler-owned wire data — never hand-edit it, and leave it in place. For shape, copy the closest staged `examples/*.case.ts`.\n6. Run `uip maestro case check \u003cName>.case.ts --source` before every compile, gate edits included (`skipWhen`, a rule `expression`); fix every error (non-zero exit) first. For instance, `check` reports a `vars.\u003cid>` read of an undeclared variable as `EXPR_UNDECLARED_REF`.\n7. Compile into the scaffolded Case project, then validate. Compile syncs existing sidecars; refresh added bindings and remove orphaned resources before refreshing.\n8. Run live debug only when requested and tenant resources are available.\n\u003c!--skill-flavor:workflow-build:end-->\n\n## API index\n\n\u003c!--skill-flavor:api-index-location:start-->\nIndexed in the INSTALLED PACKAGE, not here, because a `.d.ts` line span is only\ntrue of the build that emitted it. `@uipath/maestro-builder-sdk` ships\n`dist/api-members.md` (keyed by field or method — `sla`) and `dist/api-index.md`\n(keyed by exported symbol — `CaseBuilder`). Match one name, not the whole file,\nthen read the span: the whole declaration, doc comment included. Both cover all\nthree entry points; each file's header spells the paths its rows resolve against.\n\u003c!--skill-flavor:api-index-location:end-->\n\n## Capability router\n\n| Surface | Builder/API | Reference | Example |\n|---|---|---|---|\n| Case, stages, and completion | `casePlan`, `stage`, `completeWhen` | [CaseBuilder](#api-index) | `examples/ClaimReviewSLA.case.ts` |\n| Variables and arguments | `var`, `input`, `output`, `jsonSchema` | [CaseBuilder](#api-index) | `examples/IntakeBinding.case.ts` |\n| Manual, timer, and event starts | `manualTrigger`, `timerTrigger`, `eventTrigger` | [Trigger decisions](references/case-runtime.md#triggers-and-live-payloads) | `examples/NightlyRollup.case.ts` |\n| A task's outputs, and reading them from a later task or gate (SDK 6.70.7+) | `outputs`: the source is the result field as the Designer saves it, `=\u003cField>` on every task that runs published work (agent, process, RPA, API workflow, case management, flow process, function, business rule: `AgentExpenseRequest: '=AgentExpenseRequest'`) and `=response.\u003cfield>` only on a connector or wait-for-connector task; a key equal to the source's last segment (`app_id: '=response.app_id'`) keeps the output on the task, with no case variable, unless a `.var()` of that name exists or another task uses the same key (then both write one shared case variable; give the second task the suffixed key, `Result2: '=Result'`, to keep it on its task); `taskOutput('\u003cstage>', '\u003ctask>', '\u003coutput>')`, or the SDD's `vars.$xref(...)` as written, reads it, where `\u003coutput>` is the result field it reads or its `outputs` key, and an unknown name is refused (`TASK_OUTPUT_REF_UNRESOLVED`) | [TaskBuilder, taskOutput](#api-index) | — |\n| Entry, exit, and data gates | `rule`, `when` | [Rules](#api-index) | `examples/ClaimReviewSLA.case.ts` |\n| Business events an outside system sends to a running case | `businessEvent`, `rule('api-event', { businessEvent })` (SDK 6.47.0+) | [CaseBuilder, Rules](#api-index) | — |\n| Published UiPath work | `process`, `agent`, `rpa`, `apiWorkflow`, `caseManagement`, `flowProcess`, `unresolved` | [TaskBuilder](#api-index) | `examples/ClaimReviewSLA.case.ts` |\n| Business rules (decision tables) | `businessRule` (SDK 6.34.0+) | [TaskBuilder](#api-index) | `examples/CreditDecision.case.ts` |\n| Deployed Coded Functions | `function` (SDK 6.47.1+) | [TaskBuilder](#api-index) | — |\n| Script tasks | `script(fn \\| body)` (SDK 6.81.0+) | [Script tasks](references/case-runtime.md#script-tasks) | `examples/ScriptCase.case.ts` |\n| Resolving SDD resources against the tenant | `uip maestro case registry pull`, `uip maestro case sdd resolve` | [Registry resolution](references/registry-resolution.md) | — |\n| Human work and its Action App | `action`; `app: { name, folder }` (SDK 6.46.4+) names the app (`actionCatalogName` is a task catalog, not the app) | [Human tasks](references/case-runtime.md#human-and-on-demand-work) | `examples/NotifyOnApproval.case.ts` |\n| HTTP requests | `httpRequest({ method, url or path, headers?, query?, body?, connector? })` (SDK 6.82.1+) | [HTTP requests](references/case-runtime.md#http-requests) | `examples/HttpRequestSingleCase.case.ts` |\n| Connector work and waits | `connector`, `waitForConnector` | [Connections](references/case-runtime.md#connections-and-external-work) | `examples/NotifyOnApproval.case.ts` |\n| External agents and workflows | `externalAgent`, `externalWorkflow` | [Connections](references/case-runtime.md#connections-and-external-work) | `examples/NotifyOnApproval.case.ts` |\n| Timers | `waitForTimer` | [TimerSpecData](#api-index) | `examples/NightlyRollup.case.ts` |\n| Deadlines and escalation | `sla`, `escalation`, `toUser`, `toGroup` | [SLA](references/case-runtime.md#sla-and-runtime-semantics) | `examples/ClaimReviewSLA.case.ts` |\n| Case App and layout | `caseApp`, `layout` | [CaseBuilder](#api-index) | `examples/ClaimReviewSLA.case.ts` |\n| Existing Case plans | `case decompile --no-pipeline`, then `compile -o \u003cplan>` | [Brownfield](references/case-runtime.md#brownfield-editing) | `examples/ClaimReviewSLA.case.ts` |\n| Task activation modes (parallel, parallel-after-predecessor, sequential) | `rule('runs-sequentially')`, `.task(name, fn, { lane })` | [Activation modes](references/case-runtime.md#activation-modes) | `examples/PermitIssuance.case.ts` |\n\n## Minimal shape\n\n```ts\nimport { casePlan, rule } from '@uipath/maestro-builder-sdk/case';\n\nexport default casePlan('loan-approval')\n  .name('Loan Approval')\n  .identifier('LOAN')\n  .stage('Review', s => s\n    .required()\n    .entryWhen(rule('case-entered'), { displayName: 'Case entered' })\n    .exitWhen(rule('required-tasks-completed'), { displayName: 'All done', marksStageComplete: true })\n    .task('Check Policy', t => t\n      .process('check-policy', { folder: 'Shared' })\n      .required()\n      .entryWhen(rule('current-stage-entered')))\n    .task('Manager Approval', t => t\n      .action({ title: 'Approve loan', priority: 'High', recipient: 'manager@corp.com', app: { name: 'LoanApproval', folder: 'Shared' } })\n      .entryWhen(rule('selected-tasks-completed', { tasks: ['Check Policy'] }))))\n  .stage('Decision', s => s\n    .required()\n    .entryWhen(rule('selected-stage-completed', { stage: 'Review' }), { displayName: 'After review' })\n    .exitWhen(rule('required-tasks-completed'), { marksStageComplete: true })\n    .task('Notify', t => t.process('notify').required().entryWhen(rule('current-stage-entered'))))\n  .completeWhen(rule('required-stages-completed'), { displayName: 'Case resolved' })\n  .build();\n```\n\n## Validation loop\n\n\u003c!--skill-flavor:validation-loop:start-->\n```bash\nuip maestro case check \u003cName>.case.ts --source\nuip maestro case compile \u003cName>.case.ts -o \u003cproject>/\u003cplan>\nuip maestro case validate \u003cproject>/\u003cplan> --strict --sdd \u003csdd.md> --output json  # SDD supplied\nuip maestro case validate \u003cproject>/\u003cplan> --strict --output json                 # no SDD\nuip solution resources remove \u003corphan-key> --solution-folder \u003csolution> --output json\nuip solution resources refresh --solution-folder \u003csolution> --output json\n```\n\u003c!--skill-flavor:validation-loop:end-->\n\n`check` owns source-level invariants and emits teaching diagnostics. Product\nvalidation owns the compiled Case contract. Do not repair emitted JSON by hand;\nchange the TypeScript source and rebuild.\n\n> **`sdd convert` is a seed, not a build path** — see the Workflow section above.\n\nThe build is complete only when `validate --strict` passes. When the request\nsupplies an `sdd.md`, add `--sdd \u003cpath>`: it audits the plan against the SDD.\nWithout an SDD, run `--strict` alone. A default-profile `Valid` whose\n`Data.Suppressed.Errors` is above 0 is not completion; run the command its\n`Instructions` names. Fix each finding in the TypeScript source and recompile.\nIf a finding persists after a source fix and recompile, stop and report its\ncode as unfinished; never patch emitted JSON.\n\n`check` also reads the connector library, the same one `compile` resolves\nagainst: `$FLOW_SDK_LIBRARY_JSON`, else the `uip maestro registry pull`\nsnapshot, plus `.flow-sdk/connectors-local` when `registry prepare` wrote it.\nA connector task, external task, event trigger or wait-for-connector that\n`compile` cannot resolve fails `check` first, with compile's code and text.\n\n\u003c!--skill-flavor:library-pull:start-->\nNo pull is required first: with no library pulled, an operation is fetched from the tenant through `uip` (SDK 6.97.0 or later) into `.flow-sdk/connectors-local`, and `check` goes on, so it needs a logged-in `uip` then.\nWith a pulled library, an operation it lacks is refused, not fetched: refresh the library with `uip maestro registry pull` when the operation is newer than it.\nA `CONNECTOR_NOT_IN_LIBRARY` that remains says, in its last sentence, either that the tenant does not serve the operation, or `uip`'s own reason it could not be asked; fix that reason (`uip login` only when the session is the problem).\nTo use another library, set `$FLOW_SDK_LIBRARY_JSON` for both `check` and `compile`, not `--library`, so both resolve against the same one.\n\u003c!--skill-flavor:library-pull:end-->\n\nUse `.unresolved('\u003ckind>')` for an explicitly unresolved process, agent, RPA,\nAPI workflow, Coded Function, or sub-case; never fabricate a name or folder. A destination's\n`selected-stage-completed` entry does not imply a source `exitToStage` hand-off.\nAn unresolved connector is `.unresolved('connector')` or\n`.unresolved('wait-for-connector')`; never pick a real connector to stand in,\nand a placeholder takes no outputs.\n\n## Evidence boundary\n\nStatic success proves the source and artifact contracts. It proves neither live\nbehavior (resource resolution, human outcomes, timers, skipped-task completion,\nbusiness calendars) nor the design decisions no schema checks: lane routing,\nnon-completing exits, declared optionality, and SDD intent beyond what the\n`--sdd` audit compares. Read [Case runtime decisions](references/case-runtime.md) before authoring, not only when a rung fails.\n\n---\nSource: https://github.com/UiPath/skills/blob/main/skills/uipath-maestro-case/SKILL.md\nAuthor: UiPath (UiPath/skills), licensed MIT. Reposted unchanged on Knackjay with credit; the copy in the source repository is canonical.\n",
  "description": "UiPath Maestro Case Management (`.case.ts`, `caseplan.case`, `caseplan.json`): build, edit or fix a case plan. Always invoke for those files, for a case `sdd.md`, or to build or create a case. Authors the `.case.ts` source with the TypeScript builder SDK (`@uipath/maestro-builder-sdk/case`), comp...",
  "kind": "skill",
  "source_url": "https://github.com/UiPath/skills/blob/main/skills/uipath-maestro-case/SKILL.md",
  "title": "UiPath: uipath-maestro-case",
  "topics": [
    "uipath",
    "automation",
    "rpa",
    "artificial-intelligence",
    "document-processing"
  ],
  "published_at": "2026-11-14T11:55:26.408Z",
  "expires_at": null,
  "policy_version": "2026.11.14-1"
}
