@uipath/skills 1.207.0-preview.1886 → 1.207.0-preview.1927

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/package.json +1 -1
  2. package/skills/uipath-maestro-bpmn/SKILL.md +3 -1
  3. package/skills/uipath-maestro-bpmn/examples/InvoiceApproval.bpmn.ts +1 -1
  4. package/skills/uipath-maestro-bpmn/references/bpmn-runtime.md +62 -4
  5. package/skills/uipath-maestro-bpmn/references/connectors.md +5 -1
  6. package/skills/uipath-maestro-bpmn/references/operate.md +7 -1
  7. package/skills/uipath-maestro-bpmn/references/patterns/composing-guide.md +1 -1
  8. package/skills/uipath-maestro-bpmn/references/patterns/high-volume-batch-guide.md +12 -9
  9. package/skills/uipath-maestro-case/SKILL.md +3 -1
  10. package/skills/uipath-maestro-case/references/case-runtime.md +60 -0
  11. package/skills/uipath-maestro-flow/SKILL.md +64 -116
  12. package/skills/uipath-maestro-flow/references/CLI-LOOP.md +53 -172
  13. package/skills/uipath-maestro-flow/references/agent-resources.md +24 -72
  14. package/skills/uipath-maestro-flow/references/agent.md +77 -103
  15. package/skills/uipath-maestro-flow/references/agentic-process.md +9 -8
  16. package/skills/uipath-maestro-flow/references/api-workflow.md +8 -4
  17. package/skills/uipath-maestro-flow/references/author.md +59 -226
  18. package/skills/uipath-maestro-flow/references/brownfield.md +82 -378
  19. package/skills/uipath-maestro-flow/references/connector-params.md +89 -427
  20. package/skills/uipath-maestro-flow/references/data-fabric.md +68 -222
  21. package/skills/uipath-maestro-flow/references/diagnose.md +12 -13
  22. package/skills/uipath-maestro-flow/references/error-handling.md +20 -62
  23. package/skills/uipath-maestro-flow/references/evaluate.md +24 -94
  24. package/skills/uipath-maestro-flow/references/event-trigger.md +30 -107
  25. package/skills/uipath-maestro-flow/references/extract-document-node.md +64 -104
  26. package/skills/uipath-maestro-flow/references/extract-document-taxonomy.md +67 -111
  27. package/skills/uipath-maestro-flow/references/hitl.md +37 -330
  28. package/skills/uipath-maestro-flow/references/inline-agent.md +27 -99
  29. package/skills/uipath-maestro-flow/references/ixp.md +25 -91
  30. package/skills/uipath-maestro-flow/references/loops.md +12 -110
  31. package/skills/uipath-maestro-flow/references/operate.md +64 -179
  32. package/skills/uipath-maestro-flow/references/or-processes.md +42 -41
  33. package/skills/uipath-maestro-flow/references/published-function.md +3 -0
  34. package/skills/uipath-maestro-flow/references/rpa-workflow.md +7 -3
  35. package/skills/uipath-maestro-flow/references/script.md +27 -91
  36. package/version-manifest.json +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/skills",
3
- "version": "1.207.0-preview.1886",
3
+ "version": "1.207.0-preview.1927",
4
4
  "description": "UiPath agent skills for Claude Code, Codex, Cursor, GitHub Copilot, OpenCode, UiPath Autopilot, Kiro, Windsurf, Antigravity and Devin — RPA, UI automation, UI testing, coded agents/apps/workflows, and troubleshooting. Distributed as the UiPath Claude Code plugin.",
5
5
  "author": {
6
6
  "name": "UiPath"
@@ -19,7 +19,7 @@ need, then let TypeScript and `bpmn check` provide the detailed contract.
19
19
  1. Edit the `<Name>.bpmn.ts` source, never the compiled `.bpmn`: the next `compile` overwrites a hand edit, so change the source and rebuild.
20
20
  2. Seed an existing process, or the stub `bpmn init` wrote, with `bpmn decompile`; never hand-write the skeleton (Workflow step 4).
21
21
  3. Leave a `.preserve({ … })` call that `decompile` wrote alone; it carries state nothing else derives (Workflow step 4).
22
- 4. Run `uip maestro bpmn check <Name>.bpmn.ts --source` before every compile, and fix every error it prints first (Workflow step 5).
22
+ 4. Run `uip maestro bpmn check <Name>.bpmn.ts --source` before every compile, and fix every error it prints first (Workflow step 5). `check` lints the SDK source only; it never replaces `validate`.
23
23
  5. After each compile of a new process, run `format`, then `refresh`, then `validate`, in that order (Workflow steps 6–7).
24
24
  After a `merge` into an existing process, run `refresh` and `validate` only; run `format` only when `refresh` or `validate` reports `BPMN_PARSE_ERROR` with `No diagrams found`, `MISSING_DI_SHAPE` or `MISSING_DI_EDGE`, because it lays out the whole diagram again and drops the user's pools, lanes, colors and placement; after that `format`, run `refresh` and `validate` again and, unless the report was `No diagrams found`, tell the user the canvas layout was reset ([Brownfield](references/bpmn-runtime.md#brownfield-editing)).
25
25
  6. A different target system (Document Understanding → agent, Outlook → Gmail) changes a node's type and binding, not the graph; reshape only when the process differs.
@@ -27,6 +27,7 @@ need, then let TypeScript and `bpmn check` provide the detailed contract.
27
27
  8. A process given as an image is transcribed 1:1, every item a node and every connector a flow, from a confirmed inventory: read [Authoring from an image](references/image-transcription-guide.md) first.
28
28
  9. Retry a failing activity with its `retry` option ([Retry](references/bpmn-runtime.md#events-and-timers)), never a drawn loop of gateways, timers or `.goto()`.
29
29
  10. Pick an Orchestrator node by the target's `ProcessType`, never by its label ([Orchestrator work](references/bpmn-runtime.md#http-and-orchestrator-work)).
30
+ 11. A process returns only what its end event maps: compute into a `.var()` and map it onto each `.output()` in the `BPMN.Variables` payload of every end event that finishes the process (root scope, not a sub-process body); a task that writes an `.output()` directly returns `null` to the caller, and every check passes ([Process contract](references/bpmn-runtime.md#variables-and-the-process-contract)).
30
31
 
31
32
 
32
33
  ## Workflow
@@ -85,6 +86,7 @@ A discovery-only request (discover types or save registry evidence, no authoring
85
86
  | `A/B/C.bpmn` (file named apart from its directory) | `A/B` | `uip maestro bpmn init C --path A/B --output json` |
86
87
  | nothing named | `Data.Path` | `uip maestro bpmn init <Name> --output json`, as above |
87
88
 
89
+ When `init` answers `error: unknown option '--path'` (an older CLI), run the row's command without `--path` in a new empty directory, move the project files it writes into the project directory, and register it with `uip solution projects add <PROJECT_DIR> --output json` when a solution holds it; never copy them beside an existing `<Name>.bpmn` of the user's, which stays the original to edit.
88
90
  `--path` uses the directory as given and creates it, and any missing parents, when it does not exist; `init` writes `<Name>.bpmn` there, named after the project, not after the directory.
89
91
  It scaffolds no `<Name>Solution`: the project is registered in a solution only when a parent directory already holds a `.uipx`, and `--skip-solution-registration` stops even that when the project does not belong in it.
90
92
  The directory may already hold unrelated files (`package.json`, `.git`, notes), but `init` refuses one that holds a project file (`project.uiproj`, `project.json`, `operate.json`, `entry-points.json`, `bindings_v2.json`, `package-descriptor.json` or `<Name>.bpmn`, matched case-insensitively).
@@ -308,7 +308,7 @@ export default bpmn("Process_1")
308
308
  .goto("Activity_gLHys8"));
309
309
  })
310
310
  .goto("Activity_gLHys8") },
311
- { when: "=vars.response19 != null && vars.distinctApproversCount !== 1 && vars.distinctApproversCount !== 0 && (vars.response19 || []).filter(function(a) { return a[\"Status\"] === \"ManagerAP\"; }).length > 0", label: "Yes", body: (b) => b
311
+ { when: "=js:vars.response19 != null && vars.distinctApproversCount !== 1 && vars.distinctApproversCount !== 0 && (vars.response19 || []).filter(function(a) { return a[\"Status\"] === \"ManagerAP\"; }).length > 0", label: "Yes", body: (b) => b
312
312
  .endEvent("Event_djMYiz", { name: "Stop Progressing to Final AP" }) },
313
313
  ], { name: "Manager Approvals Remaining?" })
314
314
  .activity("Activity_gLHys8", "Orchestrator.CreateAndWaitForQueueItem", { name: "Create and wait for Documents Queue Item", typeVersion: "v2", context: { name: "=bindings.btqBFn489", folderPath: "=bindings.byYoRz6To", _label: "SendDocumentsQueue" }, inputSchema: {"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"SpecificContent":{"type":"object"},"DueDate":{"type":"datetime"},"DeferDate":{"type":"datetime"},"Priority":{"type":"dropdown"},"Reference":{"type":"string"}},"required":[]}, inputs: { SpecificContent: {"InvoiceClaimNumber":"=vars.response11[0].InvoiceClaimId","InvoiceClaimEntityId":"=vars.response11[0].Id"}, DueDate: null, DeferDate: null, Priority: null, Reference: "=vars.newEmailEntityId" }, outputRows: [{ name: "response", type: "jsonSchema", var: "response14", source: "=result", varSchema: "responseSchema" }, { name: "Error", type: "jsonSchema", var: "error11", source: "=Error", varSchema: errorSchemaWithResponse }], contextVerbatim: true }, (t) => {
@@ -13,6 +13,22 @@ make from syntax alone. Exact signatures remain in the generated API.
13
13
  `.var()` is internal, process-level state. Name an `elementId` only to scope a
14
14
  variable to a specific element yourself.
15
15
 
16
+ <!-- RULE:bpmn.variables.output-end-mapping -->
17
+ - A process returns only what its end event maps. A task that writes an `.output()` variable
18
+ directly (`outputs: { score: '…' }`) sets it inside the run, but the caller and the job receive
19
+ `null`: validate passes and the run completes, so only a Maestro debug run shows it; local
20
+ `flow-debug` does not ([offline checks](operate.md#debug--a-controlled-studio-web-run)). Compute into a `.var()`
21
+ and map it onto the output at each end event that finishes the process, the canvas's shape:
22
+ ```ts
23
+ .output('score', 'number')
24
+ .var('scoreValue', 'number')
25
+ // … tasks write scoreValue …
26
+ .endEvent('done', { payload: { type: 'BPMN.Variables', outputRows: [
27
+ { name: 'score', type: 'number', source: '=vars.scoreValue', var: 'score' },
28
+ ] } })
29
+ ```
30
+ Never read an `.output()` before its end event; read the `.var()` instead.
31
+
16
32
  <!-- RULE:bpmn.variables.public-types -->
17
33
  - A public `.input()` / `.output()` takes `string`, `boolean`, `integer`, `number`,
18
34
  `array` or `object` (`refresh`'s error also names `json`, but the SDK has no `json`
@@ -32,6 +48,17 @@ make from syntax alone. Exact signatures remain in the generated API.
32
48
  seeds every declaration by id. The start-event mapping that bridges each input into
33
49
  an internal variable is the canvas's spelling, not a requirement.
34
50
 
51
+ <!-- RULE:bpmn.expression.js-for-methods -->
52
+ - A plain `=` expression is evaluated C#-style, not as JavaScript: comparisons, arithmetic and
53
+ `vars.x` reads work, a JS method call does not. `=vars.d.toLowerCase() == "approve"` passes
54
+ validate, then faults the run (incident `400302`); in a gateway `when` it evaluates `false` and the
55
+ run takes the wrong branch. Prefix any expression that calls a JavaScript
56
+ method (`toLowerCase`, `includes`, `concat`, `map`, `JSON.parse`) with `=js:`; .NET methods
57
+ (`Contains`, `Split`, `String.IsNullOrEmpty`) work in plain `=`, as decompiled canvas expressions show.
58
+ Local `flow-debug` does not show this ([offline checks](operate.md#debug--a-controlled-studio-web-run)).
59
+ - A `.task()`'s `set` values are strings: an `=`-expression or a literal. `set: { done: true }`
60
+ fails `check` (`TS2322`) and `compile` (`value.startsWith is not a function`); write `'=true'`.
61
+
35
62
  <!-- RULE:bpmn.variables.input-name -->
36
63
  - Input values are matched to declarations by display `name` when a run starts, so an
37
64
  input given a `name` (`.input('amount', 'number', { name: 'Amount' })`) is supplied
@@ -192,6 +219,24 @@ make from syntax alone. Exact signatures remain in the generated API.
192
219
  cannot be called from a process. Never author `A2A.AgentExecution`: Studio Web no longer
193
220
  offers it and shows it only on old nodes.
194
221
 
222
+ <!-- RULE:bpmn.orchestrator.in-solution-process -->
223
+ - A Maestro BPMN process in the same solution is called without deploying it: bind it by name the
224
+ way Studio Web's picker does, a binding pair with `resourceKey` = the project name and no folder value.
225
+ ```ts
226
+ .binding('childName', { name: 'name', value: 'CreditAssessment', resource: 'process',
227
+ propertyAttribute: 'name', resourceKey: 'CreditAssessment', resourceSubType: 'ProcessOrchestration' })
228
+ .binding('childFolder', { name: 'folderPath', resource: 'process',
229
+ propertyAttribute: 'folderPath', resourceKey: 'CreditAssessment', resourceSubType: 'ProcessOrchestration' })
230
+ // …
231
+ .startAgenticProcess('assess', { process: '=bindings.childName', folder: '=bindings.childFolder',
232
+ input: { annualIncome: '=vars.annualIncome' }, outputs: { score: '=result.score' } })
233
+ ```
234
+ The called process must map its outputs at its end event ([output end mapping](#variables-and-the-process-contract)),
235
+ or `result.score` is `null`.
236
+ Studio Web Debug starts the child project; a local `uip maestro bpmn debug` uploads only this
237
+ project and faults (`[170007] The job's associated process could not be found`), so debug the
238
+ child on its own with the CLI and the pair in Studio Web, and say so.
239
+
195
240
  <!-- RULE:bpmn.orchestrator.sibling-resource -->
196
241
  - A resource another skill builds for this process is bound after it is deployed, in this order:
197
242
  1. Create its project in the same solution as the process.
@@ -204,8 +249,9 @@ make from syntax alone. Exact signatures remain in the generated API.
204
249
  its folder is `OrganizationUnitFullyQualifiedName` (`--all-fields` omits `FolderPath`) and its
205
250
  type is `ProcessType`. Only then write the node with that `process` and `folder`.
206
251
 
207
- The SDK has no in-solution form: `folder: 'solution_folder'` compiles to a literal folder with no
208
- binding, so `bindings_v2.json` stays empty. The owning skill handing the project back is not the end.
252
+ `folder: 'solution_folder'` compiles to a literal folder with no binding, so `bindings_v2.json`
253
+ stays empty; for a Maestro BPMN sibling use the binding pair in `RULE:bpmn.orchestrator.in-solution-process` above instead.
254
+ The owning skill handing the project back is not the end.
209
255
  A new `deploy run` name deploys to a new folder, so ship the finished solution into the same
210
256
  deployment: with the user's go-ahead, pack it with a higher `--version` than step 3's and publish it, then
211
257
  `uip solution deploy upgrade --name <DEPLOYMENT_NAME> --package-name <PACKAGE_NAME> --version <NEW_VERSION> --output json`.
@@ -221,6 +267,9 @@ make from syntax alone. Exact signatures remain in the generated API.
221
267
  - A plain HTTP call with no connection is `.http(id, { url, method, parameters, headers, body })` with no `connection`.
222
268
  It writes the request in manual mode with the `ImplicitConnection` binding Studio Web uses, so nothing on the tenant has to exist.
223
269
  `outputVar` (default `<id>_response`) holds the response body; `<id>_code`, `<id>_headers` and `<id>_Error` hold the rest.
270
+ Never write a credential (a bearer token, an API key, a password) into `headers` or `url`: it is stored in plain text in the
271
+ `.bpmn` and in Studio Web. Use a connection ([connectors](connectors.md)); when none exists for the API, ask the user.
272
+ When the user insists on a literal, say where it will be visible before you upload.
224
273
  `check` warns `HTTP_MANUAL_V1` on the old manual form (`mode="manual"` with the request as context rows), which the runtime faults with 102018 "Body cannot be null"; rewrite it as `.http()` and compile.
225
274
  Needs `@uipath/maestro-builder-sdk` 6.93.9 or later; an older SDK still writes the old manual form, with `outputVar` holding the whole response and no `HTTP_MANUAL_V1` warning, so upgrade with `npm install -g @uipath/maestro-builder-sdk@latest` and compile again.
226
275
  From 6.93.9, `outputVar` is the body, so read `vars.<id>_response.x`, not `vars.<id>_response.body.x`, which read the old form's whole response.
@@ -261,7 +310,8 @@ make from syntax alone. Exact signatures remain in the generated API.
261
310
  The SDK cannot yet write a working app-backed task: `.humanTask(id, { app })` writes a v1 `Actions.HITL` task with only an `appId`, which `uip maestro bpmn validate` rejects with `MISSING_BINDING` / `MISSING_RESOURCE` and which the engine does not read.
262
311
  When the request names a deployed Action App, author the inline form anyway, tell the user the task is not bound to their app, and point them to the Studio Web designer to switch it to the app.
263
312
  Never swap a human task for a plain `.task()` to get past that — use the form.
264
- - A field is `input` (shown, `value: '=vars.x'`), `output` (asked; the answer lands in `variable`, default the id) or `inOut` (shown, editable, written back).
313
+ - A field's `direction` is `input` (shown, `value: '=vars.x'`), `output` (asked; the answer lands in `variable`, default the id) or `inOut` (shown, editable, written back); its `type` is the data type:
314
+ `{ id: 'amount', label: 'Amount', type: 'number', direction: 'input', value: '=vars.amount' }`. `type: 'input'` fails `check` with `TS2322`.
265
315
  The call refuses a form that breaks any of these:
266
316
  - Every field id is a plain identifier that is not a reserved word: `reviewNote`, not `review-note` or `default`.
267
317
  - No field is called `Action`; that is the outcome picked.
@@ -273,6 +323,14 @@ make from syntax alone. Exact signatures remain in the generated API.
273
323
  Then tell the user to enable the quick-form flag on the tenant; do not fall back to `.task()` or to `app`.
274
324
  - Studio Web's "Edit Schema" canvas does not open for an inline form.
275
325
 
326
+ <!-- RULE:bpmn.hitl.no-completer-identity -->
327
+ - An inline-form task returns only its form fields and `Action`, never who completed it: the
328
+ `hitlTask` object with `CompletedByUser`, `AssignedToUser` and `CompletionTime` comes only from an
329
+ Action App task, which the SDK cannot bind yet. So never build a control on identity (four-eyes,
330
+ "a different approver", an audit "who") from a field the user types. Build the routing, and tell
331
+ the user the identity check needs the task switched to an Action App in Studio Web, or
332
+ enforced by task assignment (assignee groups) in Action Center.
333
+
276
334
  <!-- RULE:bpmn.hitl.task-settings -->
277
335
  - `title` (the task title), `priority` (`Low`, `Medium`, `High`, `Critical`) and `labels` (a
278
336
  string) are the only Action Center task settings `.humanTask()` writes. The Task timer (the task's SLA: reminder, reassign,
@@ -553,7 +611,7 @@ binding half, which is the same for every connector-backed node.
553
611
  To keep the id `bpmn init` assigned, decompile the stub it wrote (the id is carried
554
612
  into the seed) or declare `.metadata({ entryPointId: '<uuid>' })`; a second root start
555
613
  takes its own on the event (`.startEvent(id, { entryPointId })`), and `false` writes
556
- none. A value you set must be a
614
+ none (`decompile` writes `false` for an id-less import; delete it, see below). A value you set must be a
557
615
  GUID — `validate` refuses any other (`Root start event uipath:entryPointId value …
558
616
  must be a GUID`), and `check` reports `ENTRYPOINT_ID_NOT_GUID` first. Then generate the files from the built BPMN:
559
617
 
@@ -118,7 +118,11 @@ uip is connections list <CONNECTOR_KEY> --all-folders --output json # Id, Name
118
118
  uip is connections ping <CONNECTION_ID> --output json # Data.Status must be "Enabled"
119
119
  ```
120
120
 
121
- - With several Enabled matches, `prepare` refuses and lists them; re-run it with `--connection-id <CONNECTION_ID>` (or `--connection <CONNECTION_NAME>`, `--connection-folder <FOLDER>`). It never picks the default connection for you. Ask the user which one when the request does not say; when the request says nobody will answer, bind the Enabled match in the folder the process runs in (else the one with `IsDefault: Yes`, else the first one listed) and name it on the final report's `Assumed:` line.
121
+ - With several Enabled matches, `prepare` refuses and lists them; re-run it with `--connection-id <CONNECTION_ID>` (or `--connection <CONNECTION_NAME>`, `--connection-folder <FOLDER>`). It never picks the default connection for you. Ask the user which one when the request does not say; when the request says nobody will answer, bind the Enabled match in the folder the process runs in, else the one with `IsDefault: Yes`, else the first one listed, skipping every connection the next bullet rules out (including the requester's own personal one), and name it on the final report's `Assumed:` line.
122
+ - A connection is a sender's identity. Never bind, or offer on an outline, a connection that is another person's
123
+ (its folder is `<USER_NAME>'s workspace`, or its Name is someone else's email), and never bind one as a stand-in for a
124
+ mailbox, channel or account the request names (`ar@…`) that has no connection. Bind the requester's own personal connection
125
+ only when they say to. Otherwise leave the step unbound (§7) and name the missing connection on `Needs:`.
122
126
  - `prepare` refuses a connection that is not Enabled; `check`, `compile` and `refresh` do not. `validate` reports it as `MISSING_BINDING`, and `debug` faults with `[102002] Integration Services operation failed`. Never bind one: ask the user to re-authenticate it.
123
127
  - `prepare`'s JSON `Message` keeps only the last line of its explanation; read stderr for the full refusal.
124
128
  - Report the bound connection by Name and Folder, from the `connections list` row whose `Id` is `prepare`'s `Data.ConnectionId` (`Owner` is a user id, not a name).
@@ -199,7 +199,9 @@ casing varies by CLI version.
199
199
  The debug output lists each element's **status**, never a variable's **value**.
200
200
  A `Completed` run with every element green proves the process ran, not that any
201
201
  output holds the expected value. Read the values in the same session, right
202
- after the run — a debug instance is ephemeral:
202
+ after the run — a debug instance is ephemeral. A process output is proven by the
203
+ end event's `Outputs` in that response, not by `Globals`: a value set in
204
+ `Globals` that the end event does not map reaches the caller as `null`.
203
205
 
204
206
  ```bash
205
207
  uip maestro bpmn debug-instance variables-all <INSTANCE_ID> --output json
@@ -210,6 +212,10 @@ uip maestro bpmn debug-instance incidents <INSTANCE_ID> --output json
210
212
  Never use `debug` as validation. `check`, `validate` and the local engine
211
213
  (`flow-debug`, which runs the compiled `.bpmn` on this machine with every
212
214
  service mocked) are the offline checks; `debug` executes against real services.
215
+ `flow-debug` does not model three runtime facts, so only a Maestro debug run proves them: loop
216
+ iterator reads (it shows `loopCounter` 0-based and binds `itemVar` to the bare item), end-event
217
+ output mapping (it reports a mapped output as undefined), and plain `=` expressions (it runs them
218
+ as JavaScript).
213
219
 
214
220
  ## Run a deployed process
215
221
 
@@ -170,7 +170,7 @@ export default bpmn('claims-nightly')
170
170
  h.scriptTask('escalateClaim', { name: 'Escalate claim', script: 'return { ok: true };' })
171
171
  .task('recordEscalated', { name: 'Record escalation', set: { claimResults: '=js:vars.claimResults.concat([{ claim: iterator[0].item, outcome: "escalated" }])' } })
172
172
  .endEvent('claimEscalated', { name: 'Claim escalated' })),
173
- { name: 'Handle each claim', loop: { collection: '=vars.claims', itemVar: 'item', sequential: true } },
173
+ { name: 'Handle each claim', loop: { collection: '=vars.claims', itemVar: 'iterator[0]', sequential: true } },
174
174
  )
175
175
  // Every exit of the body appended to claimResults; sequential, so none was lost.
176
176
  .scriptTask('aggregate', { name: 'Total the results', script: 'return vars.claimResults.length;' })
@@ -49,7 +49,7 @@ export default bpmn('invoice-batch')
49
49
  h.task('recordItemFailure', { name: 'Record failed invoice', set: { itemResults: '=js:vars.itemResults.concat([{ item: iterator[0].item, ok: false }])' } })
50
50
  .endEvent('itemFailed', { name: 'Invoice failed' })),
51
51
  // Sequential, so each iteration appends to the list the one before left.
52
- { name: 'Process each invoice', loop: { collection: '=vars.batchItems', itemVar: 'item', sequential: true } },
52
+ { name: 'Process each invoice', loop: { collection: '=vars.batchItems', itemVar: 'iterator[0]', sequential: true } },
53
53
  )
54
54
  .scriptTask('aggregate', {
55
55
  name: 'Total the results',
@@ -66,11 +66,14 @@ export default bpmn('invoice-batch')
66
66
  ```
67
67
 
68
68
  `loop: { collection, itemVar }` on the sub-process's options is the multi-instance marker; `sequential: true` runs one at a time, which is what lets every iteration append to the same list (see [Getting results to `aggregate`](#getting-results-to-aggregate)).
69
- Inside a looped sub-process the current item is `iterator[0].item` with `itemVar: 'item'` (`iterator[1].item` one nesting level deeper), and the 0-based index is `iterator[0].loopCounter`.
70
- The index counts enclosing loops outermost-first, so nest this pattern inside another loop and `iterator[0]` becomes the outer item: change the body's reads, including both record steps, to `iterator[1]`.
71
- An expression (`set`, a condition, an `outputs` value) reads `iterator` directly, as `recordResult` does.
72
- A script does not: its scope holds only the `args` envelope, which the builder writes as `vars` and `metadata`, and the engine builds a script's `iterator` only from `iterator[N]` keys in that envelope.
73
- To read the item in a script, pass it in with `inputs: { 'iterator[0]': '=iterator[0]' }`, which is what the designer writes; `validate` still warns that `iterator` is undefined, and that warning is a false positive once the key is there.
69
+ Name the loop the way Studio Web does: `itemVar: 'iterator[0]'`, `iterator[1]` for a loop nested inside it (the canvas gives every connected loop, ancestor, descendant or sibling, its own index).
70
+ An expression (`set`, a condition, an `outputs` value) then reads the current item as `iterator[0].item` and its 1-based position as `iterator[0].loopCounter`.
71
+ A looped sub-process Studio Web made, or one `decompile` seeded from it, already carries `itemVar: 'iterator[N]'`; keep its reads as they are.
72
+ A looped task outside any looped sub-process carries no `inputElement` on the canvas and reads `iterator.item`; `decompile` seeds it as `itemVar: 'item'`, which recompiles to `inputElement="item"` and moves the item to `iterator["item"]["item"]` (next line), so rewrite its reads to that form.
73
+ Any other `itemVar` (`'invoice'`) is the outer key, and the inner key stays `item`: `iterator["invoice"]["item"]`, while `iterator[0]` and `iterator["invoice"]["invoice"]` read `null`.
74
+ A script does not see `iterator`: its scope holds only the `args` envelope, and the engine builds a script's `iterator` only from `iterator[N]` keys in it.
75
+ To read the item in a script, pass it in with `inputs: { 'iterator[0]': '=iterator[0]' }`, which is what the designer writes, and read `iterator[0].item`; `validate` still warns that `iterator` is undefined, a false positive once the key is there.
76
+ A wrong iterator read fails nothing: it yields `null` (or `"undefined"` after `String()`), every check passes and the run completes. Prove a loop by reading the per-item results with `debug-instance variables-all` after a Maestro debug run; local `flow-debug` reads loops differently ([offline checks](../operate.md#debug--a-controlled-studio-web-run)).
74
77
  The body is its own sequence scope: give it its own `.flowMode('sequence')`, start event and end event.
75
78
 
76
79
  | Node | Builder | Role |
@@ -133,10 +136,10 @@ Add fields to the record (a reason, a skipped flag) as the policy needs them.
133
136
 
134
137
  The builder's `loop` has no output collection: `{ collection, itemVar, sequential, completion }` is all it takes, so nothing gathers the iterations' results for you.
135
138
  The sketch collects them itself: each iteration appends to `itemResults`, and `sequential: true` means each one sees the list as the one before left it.
136
- On the local engine this collected every item, and `aggregate` counted them.
139
+ A Maestro debug run of this shape over `[1, -2, 3]` completed with three results, the `-2` one caught by the net, and `aggregate` counted 3 / 2 ok.
137
140
 
138
- On the local engine, parallel iterations overwrite each other's writes to one variable: three parallel iterations each appending to the list left one entry, the last to finish.
139
- That is not verified on Maestro, whose engine may scope iteration writes differently, so do not rely on a parallel append either way; use the parallel variant's external store.
141
+ Parallel iterations overwrite each other's writes to one variable: the engine's variable store is last-writer-wins, and a Maestro run appending 12 items in parallel kept 11.
142
+ Never append to one variable from parallel iterations; use the parallel variant's external store.
140
143
 
141
144
  The append is a `set` expression because it reads `iterator` directly and validates clean.
142
145
  Declare the list as `array`, whose default is written as JSON; a `jsonSchema` default of `[]` does not arrive as a list.
@@ -25,7 +25,7 @@ Use this as a router: read only the capability reference you need, then let Type
25
25
  3. 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.
26
26
  4. Import from `@uipath/maestro-builder-sdk/case`; default-export a chain ending in `.build()`.
27
27
  5. 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 <project>/<plan> -o <Name>.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 `<plan>`, never a second plan beside it: pack and debug read only one. Compile with plain `-o <project>/<plan>` and no `--bindings <plan>`; 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`.
28
- 6. Run `uip maestro case check <Name>.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.<id>` read of an undeclared variable as `EXPR_UNDECLARED_REF`.
28
+ 6. Run `uip maestro case check <Name>.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.<id>` read of an undeclared variable as `EXPR_UNDECLARED_REF`. Editing an existing plan, copy it aside once per editing session before your first compile (`mkdir -p .flow-sdk/original && cp <project>/<plan> .flow-sdk/original/`), then add `--baseline .flow-sdk/original/<plan>` so defects the plan already had on stages and tasks you did not touch do not fail the check. Never pass `<project>/<plan>` itself: after the first compile it is your edit, and checking it against itself hides every error ([Brownfield](references/case-runtime.md#check-only-what-you-changed-check---baseline)).
29
29
  7. Compile into the scaffolded Case project, then validate. Compile syncs existing sidecars; refresh added bindings and remove orphaned resources before refreshing.
30
30
  8. Run live debug only when requested and tenant resources are available.
31
31
 
@@ -95,6 +95,8 @@ export default casePlan('loan-approval')
95
95
 
96
96
  ```bash
97
97
  uip maestro case check <Name>.case.ts --source
98
+ mkdir -p .flow-sdk/original && cp <project>/<plan> .flow-sdk/original/ # editing an existing plan: once, before the first compile
99
+ uip maestro case check <Name>.case.ts --source --baseline .flow-sdk/original/<plan> # editing an existing plan
98
100
  uip maestro case compile <Name>.case.ts -o <project>/<plan>
99
101
  uip maestro case validate <project>/<plan> --strict --sdd <sdd.md> --output json # SDD supplied
100
102
  uip maestro case validate <project>/<plan> --strict --output json # no SDD
@@ -276,6 +276,66 @@ make from syntax alone. Exact signatures remain in the generated API.
276
276
  either does not prove a hand-edit is complete. Round-tripping the whole plan
277
277
  re-derives all of them at once.
278
278
 
279
+ ### Check only what you changed: `check --baseline`
280
+
281
+ `check` judges the whole case. In an existing plan it also reports defects the
282
+ plan already had on stages and tasks you never touched, for example
283
+ `TASK_NO_ENTRY` on a task the Designer saved with no entry rule. Those would
284
+ fail every edit. Pass the original plan as `--baseline` and each finding says
285
+ whether your edit caused it.
286
+
287
+ The baseline must be the plan as it was before your first compile: compile
288
+ writes back into the same plan, so after it the file on disk is your edit.
289
+ Never pass that plan itself as `--baseline`: the edit compared with itself
290
+ reports every finding as pre-existing, so `check` passes with errors in it.
291
+ At the start of each editing session, before its first compile, copy it aside
292
+ and check against the copy. Overwrite any copy an earlier session left: an old
293
+ copy would count that session's changes as yours.
294
+
295
+ ```bash
296
+ mkdir -p .flow-sdk/original && cp <project>/<plan> .flow-sdk/original/
297
+ uip maestro case check <Name>.case.ts --source --baseline .flow-sdk/original/<plan>
298
+ ```
299
+
300
+ ```text
301
+ ✗ [TASK_NO_ENTRY] Task "Escalate" in stage "Intake" has no entry rule — ... (edited)
302
+ ⚠ [TASK_NO_ENTRY] Task "Archive" in stage "Intake" has no entry rule — ... (pre-existing, not counted)
303
+ check: 1 error(s) in edited parts of the case, 0 pre-existing SDK defect(s), 1 pre-existing warning(s).
304
+ ```
305
+
306
+ - **`(edited)`** (JSON `origin: "edited"`): fix it. The finding is on a stage,
307
+ task or trigger you added or changed (a renamed task counts as changed), or
308
+ it is new on one you did not touch, so your edit caused it. The exit code is
309
+ 1 only while one is left.
310
+ - **`(pre-existing, not counted)`**: the original reports the same code on the
311
+ same unchanged stage, task or trigger. Leave it unless the user asked you to
312
+ fix it. A finding that names no stage or task (a case-level rule) is
313
+ pre-existing only when the original reports the same code and message.
314
+ - **`(pre-existing)` worded as a probable SDK defect** (JSON
315
+ `class: "lowering"`): `compile` refuses that task even though you did not
316
+ change it, so the compile stops on it. Do not edit the task to get around
317
+ it. Stop, name the task and the code, and tell the user it is a probable SDK
318
+ defect to report at <https://github.com/UiPath/builder-sdk/issues>.
319
+ - **`CHECK_INCOMPLETE`**: check stopped before it judged the whole case. Fix
320
+ the error it names, even if the original has it too, then check again.
321
+ - **`--baseline ... is not the plan this source was decompiled from`** (exit
322
+ 2): the file you passed is not the original, most often the plan after a
323
+ compile wrote your edit into it. Pass the copy you made before the first
324
+ compile. If you no longer have it, decompile the current plan again and use
325
+ that plan as the baseline from now on.
326
+
327
+ Needs two releases: `@uipath/maestro-builder-sdk` 6.97.0 or later, and the
328
+ `uip` release that carries UiPath/cli#6081 (`uip` 1.205.0 does not).
329
+ - `unknown option '--baseline'` means `uip` is too old, whatever the SDK
330
+ version. Upgrade `uip`. Upgrading the SDK alone gives the same error again.
331
+ - `--baseline on case check needs a @uipath/maestro-builder-sdk release that
332
+ supports it` means `uip` is new enough and the SDK is not. Upgrade with
333
+ `npm install -g @uipath/maestro-builder-sdk@latest`.
334
+
335
+ Until both are upgraded, run `check --source` without `--baseline`. In this
336
+ fallback only, fix only the errors on stages and tasks you changed, even
337
+ though the exit code stays non-zero.
338
+
279
339
  ## Product boundary
280
340
 
281
341
  <!-- RULE:case.validation.layers -->