@uipath/maestro-builder-sdk 6.20.3 → 6.20.5

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.
package/dist/api-index.md CHANGED
@@ -128,11 +128,11 @@ could hand you spans for a version you do not have.
128
128
  | `FilterCondition` | type | `dist/nodes/transform/flow/spec.d.ts:10-11` | Supporting types | Comparison a filter rule applies to a field. |
129
129
  | `FilterMatch` | type | `dist/nodes/transform/flow/spec.d.ts:8-9` | Supporting types | How a filter combines its rules: every rule must match, or any one. |
130
130
  | `FilterRule` | interface | `dist/nodes/transform/flow/spec.d.ts:12-24` | Supporting types | 3 field(s) |
131
- | `flow` | function | `dist/flow-sdk.d.ts:1473-1488` | Flow construction | Start building a flow with the given id. |
131
+ | `flow` | function | `dist/flow-sdk.d.ts:1475-1490` | Flow construction | Start building a flow with the given id. |
132
132
  | `FlowAction` | class | `dist/core/node-classes.d.ts:162-168` | Supporting types | A node placed as a step — pass an instance to `.step(name, …)`. |
133
133
  | `FlowActionSpec` | type | `dist/flow-sdk.d.ts:48-49` | Supporting types | What `.step()` accepts here: the shared actions plus this SDK's subflow. |
134
134
  | `FlowActionSpecs` | interface | `dist/core/actions.d.ts:1995-2104` | Supporting types | Every action kind, keyed by kind, to the body of its spec — the arm's fields other than `kind`. |
135
- | `FlowBuilder` | class | `dist/flow-sdk.d.ts:1203-1472` | Builders | 13 member(s) |
135
+ | `FlowBuilder` | class | `dist/flow-sdk.d.ts:1203-1474` | Builders | 13 member(s) |
136
136
  | `FlowLayout` | interface | `dist/flow-sdk.d.ts:671-684` | Supporting types | Designer layout for a flow, keyed by AUTHOR-level ids: node entries by step name (plus the trigger id and `end`), edge… |
137
137
  | `FlowNode` | class | `dist/core/node-classes.d.ts:126-161` | Supporting types | The abstract root of every definition-backed node the builder can place. |
138
138
  | `FlowResource` | class | `dist/core/node-classes.d.ts:176-183` | Supporting types | A node attached to another semantic node — an inline agent's tool, context, memory, or escalation. |
@@ -229,7 +229,7 @@ could hand you spans for a version you do not have.
229
229
  | `STICKY_NOTE_COLORS` | const | `dist/flow-sdk.d.ts:624-629` | Flow construction | The designer's sticky-note palette. |
230
230
  | `StickyNote` | interface | `dist/flow-sdk.d.ts:636-670` | Supporting types | A canvas sticky note — free text pinned to the diagram, for the humans reading it. |
231
231
  | `StickyNoteColor` | type | `dist/flow-sdk.d.ts:630-635` | Supporting types | A sticky note's swatch. |
232
- | `subflow` | function | `dist/flow-sdk.d.ts:1489-1528` | Flow construction | Run another flow as one step, and read back what it returns. |
232
+ | `subflow` | function | `dist/flow-sdk.d.ts:1491-1530` | Flow construction | Run another flow as one step, and read back what it returns. |
233
233
  | `SubflowSpec` | interface | `dist/flow-sdk.d.ts:40-47` | Supporting types | A step that runs a child flow. |
234
234
  | `summarize` | function | `dist/core/actions.d.ts:2202-2242` | Actions | Summarize a document with citations — the platform's **Summarize** node. |
235
235
  | `SummarizeInputs` | interface | `dist/core/actions.d.ts:674-706` | Option shapes | 3 field(s) |
@@ -104,7 +104,7 @@ not find it either.
104
104
  | `breakEnabled` | property | `LoopOptions` | `dist/flow-sdk.d.ts:458-462` |
105
105
  | `build` | method | `BpmnBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3483-3488` |
106
106
  | `build` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1269-1274` |
107
- | `build` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1465-1471` |
107
+ | `build` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1467-1473` |
108
108
  | `businessRule` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2527-2573` |
109
109
  | `by` | property | `LookupResolution` | `dist/core/lookups.d.ts:164` |
110
110
  | `by` | property | `LookupSpec` | `dist/core/lookups.d.ts:27-28` |
@@ -289,7 +289,7 @@ not find it either.
289
289
  | `entity` | property | `DataServiceOpts` | `dist/bpmn/bpmn-sdk.d.ts:1090-1091` |
290
290
  | `entry` | property | `BuiltStage` | `dist/case/case-sdk.d.ts:528` |
291
291
  | `entry` | property | `BuiltTask` | `dist/case/case-sdk.d.ts:520` |
292
- | `entryPoint` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1291-1341` |
292
+ | `entryPoint` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1293-1343` |
293
293
  | `entryPointId` | property | `ProcessMetadata` | `dist/bpmn/bpmn-sdk.d.ts:534-539` |
294
294
  | `entryPoints` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:724-725` |
295
295
  | `entryWhen` | method | `StageBuilder` | `dist/case/case-sdk.d.ts:1004-1011` |
@@ -459,7 +459,7 @@ not find it either.
459
459
  | `inclusiveGateway` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:2266-2273` |
460
460
  | `inlineAgent` | property | `FlowActionSpecs` | `dist/core/actions.d.ts:2063-2066` |
461
461
  | `input` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1160-1185` |
462
- | `input` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1416-1428` |
462
+ | `input` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1418-1430` |
463
463
  | `input` | property | `HumanTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:1355-1356` |
464
464
  | `input` | property | `OrchestratorOpts` | `dist/bpmn/bpmn-sdk.d.ts:1241-1242` |
465
465
  | `input` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3068-3076` |
@@ -725,7 +725,7 @@ not find it either.
725
725
  | `outcomes` | property | `EscalationRef` | `dist/core/actions.d.ts:1871-1876` |
726
726
  | `outcomes` | property | `HitlInputs` | `dist/core/actions.d.ts:445-459` |
727
727
  | `output` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1186-1198` |
728
- | `output` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1429-1454` |
728
+ | `output` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1431-1456` |
729
729
  | `output` | property | `RegistryTypeSpec` | `dist/bpmn/typed-node.d.ts:90` |
730
730
  | `output` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3077-3085` |
731
731
  | `outputColumns` | property | `BatchTransformInputs` | `dist/core/actions.d.ts:722-726` |
@@ -901,7 +901,7 @@ not find it either.
901
901
  | `schemaVersion` | method | `BpmnBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3375-3404` |
902
902
  | `schemaVersion` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:704-710` |
903
903
  | `schemaVersion` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1068-1094` |
904
- | `schemaVersion` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1376-1415` |
904
+ | `schemaVersion` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1378-1417` |
905
905
  | `scope` | property | `EscalationRecipient` | `dist/case/case-sdk.d.ts:121` |
906
906
  | `scopes` | property | `GuardrailSelector` | `dist/core/actions.d.ts:1177` |
907
907
  | `script` | property | `FlowActionSpecs` | `dist/nodes/script/flow/spec.d.ts:47-50` |
@@ -1044,11 +1044,11 @@ not find it either.
1044
1044
  | `trigger` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:715-717` |
1045
1045
  | `trigger` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1224-1232` |
1046
1046
  | `trigger` | property | `EscalationOpts` | `dist/case/case-sdk.d.ts:128-129` |
1047
- | `trigger` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1272-1290` |
1047
+ | `trigger` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1272-1292` |
1048
1048
  | `trigger` | property | `StartOpts` | `dist/bpmn/bpmn-sdk.d.ts:624-671` |
1049
1049
  | `triggeredByEvent` | property | `SubProcessOpts` | `dist/bpmn/bpmn-sdk.d.ts:976-977` |
1050
1050
  | `triggerId` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:726-732` |
1051
- | `triggerId` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1342-1361` |
1051
+ | `triggerId` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1344-1363` |
1052
1052
  | `triggerOptions` | property | `BuiltFlow` | `dist/flow-sdk.d.ts:718-719` |
1053
1053
  | `triggers` | property | `BuiltCase` | `dist/case/case-sdk.d.ts:644-645` |
1054
1054
  | `triggers` | property | `CaseLayout` | `dist/case/case-sdk.d.ts:620-621` |
@@ -1104,7 +1104,7 @@ not find it either.
1104
1104
  | `value` | property | `TypedInputRow` | `dist/bpmn/typed-node.d.ts:205-206` |
1105
1105
  | `values` | property | `DataFabricCreateInputs` | `dist/nodes/data-fabric/flow/spec.d.ts:132-137` |
1106
1106
  | `var` | method | `CaseBuilder` | `dist/case/case-sdk.d.ts:1199-1223` |
1107
- | `var` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1455-1464` |
1107
+ | `var` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1457-1466` |
1108
1108
  | `var` | method | `ScopeBuilder` | `dist/bpmn/bpmn-sdk.d.ts:3059-3067` |
1109
1109
  | `var` | property | `TaskOutputBinding` | `dist/case/case-sdk.d.ts:494-495` |
1110
1110
  | `var` | property | `TypedOutputRow` | `dist/bpmn/typed-node.d.ts:251-252` |
@@ -1127,7 +1127,7 @@ not find it either.
1127
1127
  | `version` | property | `ConnectorToolRef` | `dist/core/actions.d.ts:1708-1709` |
1128
1128
  | `version` | property | `EventSubscription` | `dist/core/actions.d.ts:2933` |
1129
1129
  | `version` | property | `ExternalTaskOpts` | `dist/bpmn/bpmn-sdk.d.ts:1507-1508` |
1130
- | `version` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1362-1375` |
1130
+ | `version` | method | `FlowBuilder` | `dist/flow-sdk.d.ts:1364-1377` |
1131
1131
  | `version` | property | `NodeOptions` | `dist/flow-sdk.d.ts:368-375` |
1132
1132
  | `version` | property | `TriggerMeta` | `dist/core/connectors.d.ts:126` |
1133
1133
  | `version` | property | `TriggerOptions` | `dist/core/actions.d.ts:2890-2891` |
package/dist/check.js CHANGED
@@ -9,7 +9,7 @@ import { Expr, SCHEDULE_PRESETS, parseIxpProjectType, flatNameOf, flatNameSegmen
9
9
  import { FlowNode } from './core/node-classes.js';
10
10
  import { planContributionBindings } from './core/contribution-bindings.js';
11
11
  import { definitionHasErrorPort, errorPortRefusal } from './core/error-port.js';
12
- import { bundledActionNodeType, bundledDefinition, perCallDefinition, resolveContributionDefinition } from './serialize.js';
12
+ import { actionVersion, bundledActionNodeType, bundledDefinition, perCallDefinition, resolveContributionDefinition } from './serialize.js';
13
13
  import { sdkFormFieldType } from './core/form-field-type.js';
14
14
  import { QUEUE_ITEM_RECORD_SCHEMA } from './core/queue-record.js';
15
15
  import { AGENTIC_PROCESS_FORMS } from './core/agentic-process-forms.js';
@@ -1512,10 +1512,14 @@ function checkSubflow(step, child, inputs, parent, ancestors, diags) {
1512
1512
  return;
1513
1513
  }
1514
1514
  // A subflow always starts manually — its caller is what starts it. Nothing
1515
- // schedules a subflow, so a schedule here is silently ignored.
1516
- if (child.trigger !== undefined) {
1515
+ // schedules a subflow, so a schedule here is silently ignored. `manual()` is
1516
+ // what the child gets anyway, so `.trigger(manual(), { label, version })` is
1517
+ // allowed: it is how the child's start node is labelled (#1050), and the
1518
+ // form decompile writes for a renamed one.
1519
+ if (child.trigger !== undefined && child.trigger.kind !== 'manual') {
1517
1520
  at('SUBFLOW_CHILD_TRIGGER', `Subflow "${step}" runs a flow with its own \`.trigger(…)\`. A subflow is started by its caller, never by a `
1518
- + `trigger of its own — the schedule would be dropped. Remove the .trigger() from "${child.id}".`);
1521
+ + `trigger of its own — the schedule would be dropped. Remove the .trigger() from "${child.id}" `
1522
+ + `(\`.trigger(manual(), { label })\` is allowed, to name the child's start node).`);
1519
1523
  }
1520
1524
  // `{ shared }` merges one input across a flow's ROOTS (#924). A subflow has
1521
1525
  // one root, its caller, so there is nothing to merge; serialize refuses it.
@@ -5083,13 +5087,15 @@ placed) {
5083
5087
  return;
5084
5088
  }
5085
5089
  // A typed family with a bundled definition: ask the definition serialize will
5086
- // emit, at the version it will emit (#1011). For instance `voiceAgent()`
5087
- // defaults to uipath.agent.voice@1.0 (no error port) and `{ version: '1.1' }`
5088
- // selects @1.1 (which has one).
5090
+ // emit, at the version it will emit (#1011), chosen by the same selector
5091
+ // serialize uses (#1041). For instance `voiceAgent()` defaults to
5092
+ // uipath.agent.voice@1.0 (no error port) and `{ version: '1.1' }` selects @1.1
5093
+ // (which has one); `hitl({ exposeError: true })` selects uipath.human-in-the-loop@1.2
5094
+ // with no `{ version }` at all.
5089
5095
  // A version the SDK does not bundle (an inline agent's registry version) has
5090
5096
  // no definition here to ask; version resolution reports that, not this check.
5091
5097
  const bundledType = bundledActionNodeType(spec);
5092
- const bundledDef = bundledType ? bundledDefinition(bundledType, step.options?.version) : undefined;
5098
+ const bundledDef = bundledType ? bundledDefinition(bundledType, actionVersion(spec, step.options?.version)) : undefined;
5093
5099
  // A per-tenant family: ask the definition serialize synthesizes for it (#1040).
5094
5100
  let perCallDef;
5095
5101
  if (!bundledType) {
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A subflow child's start-node label when the author sets none: `Start`, what
3
+ * Studio Web writes (the vendored golden `shared/sample-flows/new.flow`,
4
+ * `subflow1Start`). It is not the manual trigger definition's `Manual trigger`.
5
+ */
6
+ export declare const SUBFLOW_START_LABEL = "Start";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A subflow child's start-node label when the author sets none: `Start`, what
3
+ * Studio Web writes (the vendored golden `shared/sample-flows/new.flow`,
4
+ * `subflow1Start`). It is not the manual trigger definition's `Manual trigger`.
5
+ */
6
+ export const SUBFLOW_START_LABEL = 'Start';
package/dist/decompile.js CHANGED
@@ -33,6 +33,7 @@ import { preserveSchemaVersion } from './schema-version.js';
33
33
  import { BUNDLED_DEFINITIONS, bundledVersions } from './flow-definitions.js';
34
34
  import { DEFAULT_TRIGGER_ID, Expr } from './core/expr.js';
35
35
  import { FLOW_NODE_TYPES } from './flow-node-registry.js';
36
+ import { SUBFLOW_START_LABEL } from './core/subflow-start.js';
36
37
  import { commentText } from './core/comment-text.js';
37
38
  import { tsLiteral, tsNumber, tsText } from './core/ts-literal.js';
38
39
  import { contextIndexSlug, parseContextIndexType } from './core/context-index.js';
@@ -163,18 +164,22 @@ function verArg(node) {
163
164
  }
164
165
  /**
165
166
  * A trigger node's option clauses: its exact `version`, and its canvas `label`
166
- * when that differs from the definition's label (`definitionLabel`).
167
+ * when that differs from `defaultLabel` (the label serialize writes when the
168
+ * author sets none).
167
169
  */
168
- function triggerOptParts(node) {
170
+ function triggerOptParts(node, defaultLabel = definitionLabel(node)) {
169
171
  const parts = [];
170
172
  const ver = verClause(node);
171
173
  if (ver)
172
174
  parts.push(ver);
173
- const label = node.display?.label;
174
- if (typeof label === 'string' && label !== definitionLabel(node))
175
- parts.push(`label: ${tsLiteral(label)}`);
175
+ if (hasRenamedLabel(node, defaultLabel))
176
+ parts.push(`label: ${tsLiteral(node.display.label)}`);
176
177
  return parts;
177
178
  }
179
+ function hasRenamedLabel(node, defaultLabel) {
180
+ const label = node.display?.label;
181
+ return typeof label === 'string' && label !== defaultLabel;
182
+ }
178
183
  /** `triggerOptParts` as the `.trigger(spec, { ... })` options argument. */
179
184
  function triggerOptsArg(node) {
180
185
  const parts = triggerOptParts(node);
@@ -3073,7 +3078,8 @@ function emitSubflow(node, ctx) {
3073
3078
  /**
3074
3079
  * Render a child (sub)flow body as a nested `flow(name)…` builder expression
3075
3080
  * (parenthesized, no `.build()`). Reuses the same region machinery on the child's
3076
- * own scope; the child's trigger is its `<caller>Start` node.
3081
+ * own scope; the child's trigger is its `<caller>Start` node, written as
3082
+ * `.trigger(manual(), { label })` only when its label is not `SUBFLOW_START_LABEL`.
3077
3083
  */
3078
3084
  function emitChildFlow(name, child, ctx) {
3079
3085
  const globals = readFlowGlobals(child.variables, runStrict);
@@ -3098,6 +3104,9 @@ function emitChildFlow(name, child, ctx) {
3098
3104
  }
3099
3105
  // Body: the child's trigger is its own manual Start; walk from its successor.
3100
3106
  const trigger = (child.nodes ?? []).find((n) => isTrigger(n.type) && !(child.edges ?? []).some((e) => e.targetNodeId === n.id));
3107
+ if (trigger?.type === T.triggerManual && hasRenamedLabel(trigger, SUBFLOW_START_LABEL)) {
3108
+ parts.push(`.trigger(${ctx.imp.use('manual')}(), { ${triggerOptParts(trigger, SUBFLOW_START_LABEL).join(', ')} })`);
3109
+ }
3101
3110
  const scope = scopeIds(child.nodes ?? [], undefined);
3102
3111
  const entries = trigger ? scopeSuccEdges(childCtx.graph, trigger.id, scope) : [];
3103
3112
  const ipdom = entries.length
@@ -1284,6 +1284,8 @@ declare class FlowBuilder extends StepList {
1284
1284
  * @param options - Node options; `version` selects the exact definition
1285
1285
  * version and `label` sets what the canvas shows on the trigger node
1286
1286
  * (default: the trigger definition's label, e.g. `Scheduled trigger`). See {@link NodeOptions}.
1287
+ * On a flow run as a `subflow(...)`, only `manual()` is allowed — its caller
1288
+ * starts it — and `label` names the child's start node (default: `Start`).
1287
1289
  * @returns This builder, so calls chain.
1288
1290
  * @defaultValue the manual trigger
1289
1291
  */
package/dist/flow-sdk.js CHANGED
@@ -976,6 +976,8 @@ class FlowBuilder extends StepList {
976
976
  * @param options - Node options; `version` selects the exact definition
977
977
  * version and `label` sets what the canvas shows on the trigger node
978
978
  * (default: the trigger definition's label, e.g. `Scheduled trigger`). See {@link NodeOptions}.
979
+ * On a flow run as a `subflow(...)`, only `manual()` is allowed — its caller
980
+ * starts it — and `label` names the child's start node (default: `Start`).
979
981
  * @returns This builder, so calls chain.
980
982
  * @defaultValue the manual trigger
981
983
  */
@@ -122,6 +122,26 @@ export declare function perCallDefinition(spec: {
122
122
  kind?: string;
123
123
  inputs?: any;
124
124
  } | undefined): any | undefined;
125
+ /**
126
+ * The definition version serialize emits for a typed action step that is not
127
+ * yet on the node-type registry: the author's `{ version }` when given,
128
+ * otherwise the version the step's inputs select, otherwise `undefined` (the
129
+ * pinned default). Two such families pick a version themselves:
130
+ *
131
+ * - `hitl`: `exposeError` selects `@1.2`, per-outcome routing selects `@1.1`;
132
+ * - `inlineAgent`: the newest bundled version, not the first bundled entry.
133
+ *
134
+ * The emit paths read their version here, and `check` resolves the definition
135
+ * it asks about with this same version (#1041), so the two cannot pick
136
+ * different definitions. For instance `inlineAgent({ ... })` gives the newest
137
+ * bundled version in both. A registered family (e.g. `dataFabricRead`, whose
138
+ * `resultMode` selects `core.datafabric.read@1.4`) gets the same guarantee from
139
+ * the registry's `resolveVersion`, which check and serialize both call.
140
+ */
141
+ export declare function actionVersion(spec: {
142
+ kind?: string;
143
+ inputs?: any;
144
+ } | undefined, explicit: string | undefined): string | undefined;
125
145
  /**
126
146
  * The bundled definition of `nodeType` that `makeNode` resolves: the author's
127
147
  * exact `{ version }` when given, otherwise the pinned default (the first
package/dist/serialize.js CHANGED
@@ -60,6 +60,7 @@ import { QUEUE_ITEM_RECORD_SCHEMA } from './core/queue-record.js';
60
60
  import { AGENTIC_PROCESS_FORMS } from './core/agentic-process-forms.js';
61
61
  import { resourceNodeSortOrder } from './core/process-resource-sort-order.js';
62
62
  import { types } from './core/expr.js';
63
+ import { SUBFLOW_START_LABEL } from './core/subflow-start.js';
63
64
  import { ownEntry } from './core/own-entry.js';
64
65
  import { jsonClone } from './core/json-file.js';
65
66
  const HERE = dirname(fileURLToPath(import.meta.url));
@@ -3835,6 +3836,45 @@ export function perCallDefinition(spec) {
3835
3836
  default: return undefined;
3836
3837
  }
3837
3838
  }
3839
+ /**
3840
+ * The definition version serialize emits for a typed action step that is not
3841
+ * yet on the node-type registry: the author's `{ version }` when given,
3842
+ * otherwise the version the step's inputs select, otherwise `undefined` (the
3843
+ * pinned default). Two such families pick a version themselves:
3844
+ *
3845
+ * - `hitl`: `exposeError` selects `@1.2`, per-outcome routing selects `@1.1`;
3846
+ * - `inlineAgent`: the newest bundled version, not the first bundled entry.
3847
+ *
3848
+ * The emit paths read their version here, and `check` resolves the definition
3849
+ * it asks about with this same version (#1041), so the two cannot pick
3850
+ * different definitions. For instance `inlineAgent({ ... })` gives the newest
3851
+ * bundled version in both. A registered family (e.g. `dataFabricRead`, whose
3852
+ * `resultMode` selects `core.datafabric.read@1.4`) gets the same guarantee from
3853
+ * the registry's `resolveVersion`, which check and serialize both call.
3854
+ */
3855
+ export function actionVersion(spec, explicit) {
3856
+ if (explicit !== undefined)
3857
+ return explicit;
3858
+ // Keyed by the node type `bundledActionNodeType` already picks, so the
3859
+ // version rule adds no second dispatch on the step's kind.
3860
+ const type = bundledActionNodeType(spec);
3861
+ if (type === NODE_TYPE.hitl)
3862
+ return hitlNeededVersion(spec?.inputs);
3863
+ if (type === INLINE_AGENT_TYPE)
3864
+ return INLINE_AGENT_DEFAULT_VERSION;
3865
+ return undefined;
3866
+ }
3867
+ /**
3868
+ * The base human task version a task's inputs need when nothing is pinned:
3869
+ * `exposeError` needs 1.2 (it adds the `error` output), and a task that
3870
+ * routes per outcome needs 1.1. Only the base task reaches here: a variant
3871
+ * (quick-form, app task) has its own node type and one definition.
3872
+ */
3873
+ function hitlNeededVersion(inputs) {
3874
+ if (inputs?.exposeError)
3875
+ return '1.2';
3876
+ return hitlExitModel(inputs, undefined).shape === 'per-outcome' ? '1.1' : undefined;
3877
+ }
3838
3878
  /**
3839
3879
  * The bundled definition of `nodeType` that `makeNode` resolves: the author's
3840
3880
  * exact `{ version }` when given, otherwise the pinned default (the first
@@ -4871,7 +4911,9 @@ export function serialize(built, opts = {}) {
4871
4911
  *
4872
4912
  * The child gets its own manual Start node (a subflow always starts manually
4873
4913
  * — nothing schedules a subflow; its caller is the trigger) and its own
4874
- * variables. Every `in` variable carries `triggerNodeId` pointing at that
4914
+ * variables. A child's `.trigger(manual(), { label, version })` sets that
4915
+ * node's canvas label and exact version; `check` refuses any other kind.
4916
+ * Every `in` variable carries `triggerNodeId` pointing at that
4875
4917
  * Start: it is what binds the caller's value, and omitting it is the single
4876
4918
  * defect that makes a subflow validate clean and then fault at run time with
4877
4919
  * a null. It is emitted here, always, so it cannot be forgotten.
@@ -4900,7 +4942,10 @@ export function serialize(built, opts = {}) {
4900
4942
  // Without this a child that reads its own input points at a node that does
4901
4943
  // not exist in its scope.
4902
4944
  scope.rename.nodeIds.set('start', [startId]);
4903
- const start = makeNode(NODE_TYPE.trigger, startId, 'Start', { requestedVersion: child.triggerOptions?.version });
4945
+ // The child's `.trigger(manual(), { label })`, else `SUBFLOW_START_LABEL`.
4946
+ const start = makeNode(NODE_TYPE.trigger, startId, child.triggerOptions?.label ?? SUBFLOW_START_LABEL, {
4947
+ requestedVersion: child.triggerOptions?.version,
4948
+ });
4904
4949
  start.inputs = {};
4905
4950
  scope.nodes.push(start);
4906
4951
  const tails = emit(child.steps, [{ node: startId, port: 'output' }], scope);
@@ -5350,7 +5395,7 @@ export function serialize(built, opts = {}) {
5350
5395
  // the node to another version as a side effect (#956). Both now live in
5351
5396
  // the sidecar and on edges; neither selects a definition. An explicit
5352
5397
  // `{ version }` (what decompile writes back) resolves exactly.
5353
- const version = step.options?.version ?? INLINE_AGENT_DEFAULT_VERSION;
5398
+ const version = actionVersion(spec, step.options?.version);
5354
5399
  // `definitions[]` holds one entry per type@version, so a flow where any
5355
5400
  // agent attaches memory keeps the handle for all of them.
5356
5401
  const withMemory = s.memory !== undefined
@@ -6272,13 +6317,12 @@ export function serialize(built, opts = {}) {
6272
6317
  throw new Error(`"${step.name}": outcomePorts: true, but the '${spec.inputs?.variant}' variant reads its outcomes `
6273
6318
  + `from its app and leaves on its single 'completed' exit. Route on out('${step.name}', 'Action') downstream.`);
6274
6319
  }
6275
- const neededVersion = hitlType !== NODE_TYPE.hitl ? undefined
6276
- : spec.inputs?.exposeError ? '1.2' : exitModel.shape === 'per-outcome' ? '1.1' : undefined;
6277
6320
  if (spec.inputs?.exposeError === true && pinned !== undefined && pinned !== '1.2') {
6278
6321
  throw new Error(`"${step.name}": exposeError needs the task's 1.2 definition, but { version: '${pinned}' } pins it. `
6279
6322
  + `Drop the pin or match it.`);
6280
6323
  }
6281
- const node = makeNode(hitlType, id, step.name, { parentId, requestedVersion: pinned ?? neededVersion });
6324
+ // The same version `check` resolves the definition at (#1041).
6325
+ const node = makeNode(hitlType, id, step.name, { parentId, requestedVersion: actionVersion(spec, pinned) });
6282
6326
  const { inputs, outputs } = hitlInputs(spec.inputs, id, built.id, step.name, scope.rename);
6283
6327
  node.inputs = inputs;
6284
6328
  // The definition's `outputDefinition` gives the two output SLOTS; the form
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/maestro-builder-sdk",
3
- "version": "6.20.3",
3
+ "version": "6.20.5",
4
4
  "description": "Build UiPath Flow, Case, and BPMN artifacts by writing TypeScript.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://docs.uipath.com/maestro",
@@ -92,5 +92,5 @@
92
92
  "@types/node": "^22.7.0",
93
93
  "esbuild": "^0.28.1"
94
94
  },
95
- "gitref": "15fa01717ebe49d6cf51c9ec11cca4a7ebbf9bb7"
95
+ "gitref": "2ed3ce64cea5047f9da44c287cacc18f0f66f37d"
96
96
  }