@uipath/uipath-typescript 1.4.2 → 1.5.1

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 (52) hide show
  1. package/README.md +7 -1
  2. package/dist/agent-memory/index.d.ts +4 -1
  3. package/dist/agents/index.cjs +341 -6
  4. package/dist/agents/index.d.ts +717 -16
  5. package/dist/agents/index.mjs +342 -7
  6. package/dist/assets/index.cjs +132 -15
  7. package/dist/assets/index.d.ts +12 -1
  8. package/dist/assets/index.mjs +132 -15
  9. package/dist/attachments/index.cjs +120 -12
  10. package/dist/attachments/index.mjs +120 -12
  11. package/dist/buckets/index.cjs +136 -15
  12. package/dist/buckets/index.d.ts +12 -1
  13. package/dist/buckets/index.mjs +136 -15
  14. package/dist/cases/index.cjs +1203 -938
  15. package/dist/cases/index.d.ts +325 -45
  16. package/dist/cases/index.mjs +1203 -938
  17. package/dist/conversational-agent/index.cjs +48 -10
  18. package/dist/conversational-agent/index.d.ts +117 -6
  19. package/dist/conversational-agent/index.mjs +48 -10
  20. package/dist/core/index.cjs +1 -1
  21. package/dist/core/index.mjs +1 -1
  22. package/dist/entities/index.cjs +448 -9
  23. package/dist/entities/index.d.ts +441 -1
  24. package/dist/entities/index.mjs +447 -10
  25. package/dist/feedback/index.cjs +25 -9
  26. package/dist/feedback/index.mjs +25 -9
  27. package/dist/index.cjs +1281 -330
  28. package/dist/index.d.ts +1988 -143
  29. package/dist/index.mjs +1282 -331
  30. package/dist/index.umd.js +1230 -279
  31. package/dist/jobs/index.cjs +141 -19
  32. package/dist/jobs/index.d.ts +22 -6
  33. package/dist/jobs/index.mjs +141 -19
  34. package/dist/maestro-processes/index.cjs +553 -354
  35. package/dist/maestro-processes/index.d.ts +376 -47
  36. package/dist/maestro-processes/index.mjs +553 -354
  37. package/dist/notifications/index.cjs +2012 -0
  38. package/dist/notifications/index.d.ts +615 -0
  39. package/dist/notifications/index.mjs +2010 -0
  40. package/dist/processes/index.cjs +118 -18
  41. package/dist/processes/index.d.ts +18 -2
  42. package/dist/processes/index.mjs +118 -18
  43. package/dist/queues/index.cjs +131 -14
  44. package/dist/queues/index.d.ts +12 -1
  45. package/dist/queues/index.mjs +131 -14
  46. package/dist/tasks/index.cjs +125 -13
  47. package/dist/tasks/index.d.ts +4 -1
  48. package/dist/tasks/index.mjs +125 -13
  49. package/dist/traces/index.cjs +220 -6
  50. package/dist/traces/index.d.ts +360 -25
  51. package/dist/traces/index.mjs +221 -7
  52. package/package.json +14 -4
@@ -75,6 +75,12 @@ interface TimelineOptions {
75
75
  * @default TimeInterval.Day
76
76
  */
77
77
  groupBy?: TimeInterval;
78
+ /** Filter by package identifier */
79
+ packageId?: string;
80
+ /** Filter by package version */
81
+ version?: string;
82
+ /** Filter by one or more process keys. Pass `['<processKey>']` for a single process. */
83
+ processKeys?: string[];
78
84
  }
79
85
  /**
80
86
  * Final instance statuses returned by the instance status timeline endpoint.
@@ -102,6 +108,17 @@ interface InstanceStatusTimelineResponse {
102
108
  /** Number of instances with this status in the time bucket */
103
109
  count: number;
104
110
  }
111
+ /**
112
+ * Incident count within a specific time bucket.
113
+ */
114
+ interface IncidentTimelineResponse {
115
+ /** Start of the time bucket in local timezone (ISO 8601, e.g. `"2026-05-04T00:00:00"`) */
116
+ startTime: string;
117
+ /** End of the time bucket in local timezone (ISO 8601, e.g. `"2026-05-11T00:00:00"`) */
118
+ endTime: string;
119
+ /** Number of incidents that occurred within this time bucket */
120
+ count: number;
121
+ }
105
122
  /**
106
123
  * Response for the top duration Insights endpoint
107
124
  */
@@ -110,21 +127,12 @@ interface GetTopDurationResponse extends GetTopBaseResponse {
110
127
  duration: number;
111
128
  }
112
129
  /**
113
- * Element count by status for a BPMN element within a process or case
130
+ * Duration percentile stats shared by Insights aggregate endpoints (per-element and per-process/case).
131
+ *
132
+ * For instance-level stats, durations are computed over terminal instances only
133
+ * (Completed, Cancelled, Deleted) and default to `0` when no terminal instances exist.
114
134
  */
115
- interface ElementStats {
116
- /** BPMN element identifier */
117
- elementId: string;
118
- /** Number of successful executions */
119
- successCount: number;
120
- /** Number of failed executions */
121
- failCount: number;
122
- /** Number of terminated executions */
123
- terminatedCount: number;
124
- /** Number of paused executions */
125
- pausedCount: number;
126
- /** Number of in-progress executions */
127
- inProgressCount: number;
135
+ interface DurationStats {
128
136
  /** Minimum duration in milliseconds */
129
137
  minDurationMs: number;
130
138
  /** Maximum duration in milliseconds */
@@ -138,6 +146,65 @@ interface ElementStats {
138
146
  /** 99th percentile duration in milliseconds */
139
147
  p99DurationMs: number;
140
148
  }
149
+ /**
150
+ * Instance count and duration stats aggregated by status for a process or case within a time range.
151
+ *
152
+ * Duration fields are computed over terminal instances only (Completed, Cancelled, Deleted)
153
+ * and default to `0` when no terminal instances exist in the time range.
154
+ */
155
+ interface InstanceStats extends DurationStats {
156
+ /** Total number of instances across all statuses */
157
+ totalCount: number;
158
+ /** Number of currently running instances */
159
+ runningCount: number;
160
+ /** Number of instances in transitioning state */
161
+ transitioningCount: number;
162
+ /** Number of paused instances */
163
+ pausedCount: number;
164
+ /** Number of faulted instances */
165
+ faultedCount: number;
166
+ /** Number of completed instances */
167
+ completedCount: number;
168
+ /** Number of cancelled instances */
169
+ cancelledCount: number;
170
+ /** Number of deleted instances */
171
+ deletedCount: number;
172
+ }
173
+ /**
174
+ * Required request parameters for process-scoped insights stats endpoints
175
+ * (`getElementStats`, `getInstanceStats`).
176
+ *
177
+ * Identifies a single process+package+version and the time range to aggregate over.
178
+ */
179
+ interface MaestroProcessStatsRequest {
180
+ /** Process key to filter by */
181
+ processKey: string;
182
+ /** Package identifier */
183
+ packageId: string;
184
+ /** Package version to filter by */
185
+ packageVersion: string;
186
+ /** Start of the time range to query */
187
+ startTime: Date;
188
+ /** End of the time range to query */
189
+ endTime: Date;
190
+ }
191
+ /**
192
+ * Per-element execution counts and duration percentiles for a BPMN element within a process or case.
193
+ */
194
+ interface ElementStats extends DurationStats {
195
+ /** BPMN element identifier */
196
+ elementId: string;
197
+ /** Number of successful executions */
198
+ successCount: number;
199
+ /** Number of failed executions */
200
+ failCount: number;
201
+ /** Number of terminated executions */
202
+ terminatedCount: number;
203
+ /** Number of paused executions */
204
+ pausedCount: number;
205
+ /** Number of in-progress executions */
206
+ inProgressCount: number;
207
+ }
141
208
 
142
209
  /**
143
210
  * Maestro Process Types
@@ -454,7 +521,7 @@ interface MaestroProcessesServiceModel {
454
521
  *
455
522
  * @param startTime - Start of the time range to query
456
523
  * @param endTime - End of the time range to query
457
- * @param options - Optional settings for time bucketing granularity
524
+ * @param options - Optional settings for filtering and time bucket granularity
458
525
  * @returns Promise resolving to an array of {@link InstanceStatusTimelineResponse}
459
526
  *
460
527
  * @example
@@ -481,11 +548,62 @@ interface MaestroProcessesServiceModel {
481
548
  *
482
549
  * @example
483
550
  * ```typescript
551
+ * // Filter to a specific process
552
+ * const filtered = await maestroProcesses.getInstanceStatusTimeline(startTime, endTime, {
553
+ * processKeys: ['<processKey>'],
554
+ * });
555
+ * ```
556
+ *
557
+ * @example
558
+ * ```typescript
484
559
  * // Get all-time data (from Unix epoch to now)
485
560
  * const allTime = await maestroProcesses.getInstanceStatusTimeline(new Date(0), new Date());
486
561
  * ```
487
562
  */
488
563
  getInstanceStatusTimeline(startTime: Date, endTime: Date, options?: TimelineOptions): Promise<InstanceStatusTimelineResponse[]>;
564
+ /**
565
+ * Get incident counts aggregated by time bucket for maestro processes.
566
+ *
567
+ * Returns time-grouped counts of incidents that occurred within each bucket,
568
+ * useful for rendering incident time-series charts. Use `groupBy` to control
569
+ * the time bucket size (hour, day, or week) — defaults to day if not provided.
570
+ *
571
+ * @param startTime - Start of the time range to query
572
+ * @param endTime - End of the time range to query
573
+ * @param options - Optional settings for filtering and time bucket granularity
574
+ * @returns Promise resolving to an array of {@link IncidentTimelineResponse}
575
+ *
576
+ * @example
577
+ * ```typescript
578
+ * // Get daily incident counts for the last 7 days
579
+ * const now = new Date();
580
+ * const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
581
+ * const incidents = await maestroProcesses.getIncidentsTimeline(sevenDaysAgo, now);
582
+ *
583
+ * for (const incident of incidents) {
584
+ * console.log(`${incident.startTime} → ${incident.endTime}: ${incident.count} incidents`);
585
+ * }
586
+ * ```
587
+ *
588
+ * @example
589
+ * ```typescript
590
+ * import { TimeInterval } from '@uipath/uipath-typescript/maestro-processes';
591
+ *
592
+ * // Get weekly breakdown
593
+ * const incidents = await maestroProcesses.getIncidentsTimeline(startTime, endTime, {
594
+ * groupBy: TimeInterval.Week,
595
+ * });
596
+ * ```
597
+ *
598
+ * @example
599
+ * ```typescript
600
+ * // Filter to a specific process
601
+ * const filtered = await maestroProcesses.getIncidentsTimeline(startTime, endTime, {
602
+ * processKeys: ['<processKey>'],
603
+ * });
604
+ * ```
605
+ */
606
+ getIncidentsTimeline(startTime: Date, endTime: Date, options?: TimelineOptions): Promise<IncidentTimelineResponse[]>;
489
607
  /**
490
608
  * Get the top 5 processes ranked by total duration within a time range.
491
609
  *
@@ -530,22 +648,22 @@ interface MaestroProcessesServiceModel {
530
648
  * Returns per-element execution counts (success, fail, terminated, paused, in-progress) and
531
649
  * duration percentile metrics (min, max, avg, p50, p95, p99) for BPMN elements within a process.
532
650
  *
533
- * @param processKey - Process key to filter by
534
- * @param packageId - Package identifier
535
- * @param startTime - Start of the time range to query
536
- * @param endTime - End of the time range to query
537
- * @param packageVersion - Package version to filter by
651
+ * @param request - Process scope + time range to aggregate over
538
652
  * @returns Promise resolving to an array of {@link ElementStats}
539
653
  * @example
540
654
  * ```typescript
541
- * // Get element metrics for a process
542
- * const elements = await maestroProcesses.getElementStats(
543
- * '<processKey>',
544
- * '<packageId>',
545
- * new Date('2026-04-01'),
546
- * new Date(),
547
- * '1.0.1'
548
- * );
655
+ * // First, list processes to find the processKey, packageId, and available versions
656
+ * const processes = await maestroProcesses.getAll();
657
+ * const process = processes[0];
658
+ *
659
+ * // Get element metrics for that process
660
+ * const elements = await maestroProcesses.getElementStats({
661
+ * processKey: process.processKey,
662
+ * packageId: process.packageId,
663
+ * packageVersion: process.packageVersions[0],
664
+ * startTime: new Date('2026-04-01'),
665
+ * endTime: new Date(),
666
+ * });
549
667
  *
550
668
  * // Analyze element performance
551
669
  * for (const element of elements) {
@@ -553,9 +671,52 @@ interface MaestroProcessesServiceModel {
553
671
  * console.log(` Success: ${element.successCount}, Failed: ${element.failCount}`);
554
672
  * console.log(` Avg duration: ${element.avgDurationMs}ms, P95: ${element.p95DurationMs}ms`);
555
673
  * }
674
+ *
675
+ * // Using bound method on a process — auto-fills processKey and packageId
676
+ * const boundElements = await process.getElementStats(
677
+ * new Date('2026-04-01'),
678
+ * new Date(),
679
+ * process.packageVersions[0]
680
+ * );
681
+ * ```
682
+ */
683
+ getElementStats(request: MaestroProcessStatsRequest): Promise<ElementStats[]>;
684
+ /**
685
+ * Get instance stats for a process.
686
+ *
687
+ * Returns total instance counts broken down by status (running, completed, faulted, etc.)
688
+ * and the average execution duration for all instances of a process within a time range.
689
+ *
690
+ * @param request - Process scope + time range to aggregate over
691
+ * @returns Promise resolving to {@link InstanceStats}
692
+ * @example
693
+ * ```typescript
694
+ * // First, list processes to find the processKey, packageId, and available versions
695
+ * const processes = await maestroProcesses.getAll();
696
+ * const process = processes[0];
697
+ *
698
+ * // Get instance status breakdown for that process
699
+ * const counts = await maestroProcesses.getInstanceStats({
700
+ * processKey: process.processKey,
701
+ * packageId: process.packageId,
702
+ * packageVersion: process.packageVersions[0],
703
+ * startTime: new Date('2026-04-01'),
704
+ * endTime: new Date(),
705
+ * });
706
+ *
707
+ * console.log(`Total: ${counts.totalCount}`);
708
+ * console.log(`Running: ${counts.runningCount}, Completed: ${counts.completedCount}`);
709
+ * console.log(`Faulted: ${counts.faultedCount}, Avg duration: ${counts.avgDurationMs}ms`);
710
+ *
711
+ * // Using bound method on a process — auto-fills processKey and packageId
712
+ * const boundCounts = await process.getInstanceStats(
713
+ * new Date('2026-04-01'),
714
+ * new Date(),
715
+ * process.packageVersions[0]
716
+ * );
556
717
  * ```
557
718
  */
558
- getElementStats(processKey: string, packageId: string, startTime: Date, endTime: Date, packageVersion: string): Promise<ElementStats[]>;
719
+ getInstanceStats(request: MaestroProcessStatsRequest): Promise<InstanceStats>;
559
720
  }
560
721
  interface ProcessMethods {
561
722
  /**
@@ -573,6 +734,33 @@ interface ProcessMethods {
573
734
  * @returns Promise resolving to an array of {@link ElementStats}
574
735
  */
575
736
  getElementStats(startTime: Date, endTime: Date, packageVersion: string): Promise<ElementStats[]>;
737
+ /**
738
+ * Get instance stats for this process
739
+ *
740
+ * @param startTime - Start of the time range to query
741
+ * @param endTime - End of the time range to query
742
+ * @param packageVersion - Package version to filter by
743
+ * @returns Promise resolving to {@link InstanceStats}
744
+ */
745
+ getInstanceStats(startTime: Date, endTime: Date, packageVersion: string): Promise<InstanceStats>;
746
+ /**
747
+ * Get instance status counts aggregated by date for this process.
748
+ *
749
+ * @param startTime - Start of the time range to query
750
+ * @param endTime - End of the time range to query
751
+ * @param options - Optional settings for filtering and time bucket granularity (processKey is auto-captured from this process)
752
+ * @returns Promise resolving to an array of {@link InstanceStatusTimelineResponse}
753
+ */
754
+ getInstanceStatusTimeline(startTime: Date, endTime: Date, options?: Omit<TimelineOptions, 'processKeys'>): Promise<InstanceStatusTimelineResponse[]>;
755
+ /**
756
+ * Get incident counts aggregated by time bucket for this process.
757
+ *
758
+ * @param startTime - Start of the time range to query
759
+ * @param endTime - End of the time range to query
760
+ * @param options - Optional settings for filtering and time bucket granularity (processKey is auto-captured from this process)
761
+ * @returns Promise resolving to an array of {@link IncidentTimelineResponse}
762
+ */
763
+ getIncidentsTimeline(startTime: Date, endTime: Date, options?: Omit<TimelineOptions, 'processKeys'>): Promise<IncidentTimelineResponse[]>;
576
764
  }
577
765
  type MaestroProcessGetAllResponse = RawMaestroProcessGetAllResponse & ProcessMethods;
578
766
  /**
@@ -841,7 +1029,7 @@ interface ProcessInstancesServiceModel {
841
1029
  */
842
1030
  getAll<T extends ProcessInstanceGetAllWithPaginationOptions = ProcessInstanceGetAllWithPaginationOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ProcessInstanceGetResponse> : NonPaginatedResponse<ProcessInstanceGetResponse>>;
843
1031
  /**
844
- * Get a process instance by ID with operation methods (cancel, pause, resume)
1032
+ * Get a process instance by ID with operation methods (cancel, pause, resume, retry)
845
1033
  * @param id The ID of the instance to retrieve
846
1034
  * @param folderKey The folder key for authorization
847
1035
  * @returns Promise resolving to a process instance
@@ -960,6 +1148,35 @@ interface ProcessInstancesServiceModel {
960
1148
  * @returns Promise resolving to operation result with instance data
961
1149
  */
962
1150
  resume(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
1151
+ /**
1152
+ * Retry a faulted process instance
1153
+ *
1154
+ * Re-runs the failed elements of the instance (and the elements that follow) within the
1155
+ * same instance, spawning new jobs. Use to recover from transient/flaky failures.
1156
+ * @param instanceId The ID of the instance to retry
1157
+ * @param folderKey The folder key for authorization
1158
+ * @param options Optional retry options with comment
1159
+ * @returns Promise resolving to operation result with instance data
1160
+ * @example
1161
+ * ```typescript
1162
+ * // Retry a faulted process instance
1163
+ * const result = await processInstances.retry(
1164
+ * <instanceId>,
1165
+ * <folderKey>
1166
+ * );
1167
+ *
1168
+ * // Or using instance method
1169
+ * const instance = await processInstances.getById(
1170
+ * <instanceId>,
1171
+ * <folderKey>
1172
+ * );
1173
+ * if (instance.latestRunStatus === 'Faulted') {
1174
+ * const result = await instance.retry({ comment: 'Retrying flaky failure' });
1175
+ * console.log(`Retried: ${result.success}`);
1176
+ * }
1177
+ * ```
1178
+ */
1179
+ retry(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
963
1180
  /**
964
1181
  * Get global variables for a process instance
965
1182
  *
@@ -1040,6 +1257,13 @@ interface ProcessInstanceMethods {
1040
1257
  * @returns Promise resolving to operation result
1041
1258
  */
1042
1259
  resume(options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
1260
+ /**
1261
+ * Retries this faulted process instance
1262
+ *
1263
+ * @param options - Optional retry options with comment
1264
+ * @returns Promise resolving to operation result
1265
+ */
1266
+ retry(options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
1043
1267
  /**
1044
1268
  * Gets incidents for this process instance
1045
1269
  *
@@ -1460,7 +1684,7 @@ declare class MaestroProcessesService extends BaseService implements MaestroProc
1460
1684
  *
1461
1685
  * @param startTime - Start of the time range to query
1462
1686
  * @param endTime - End of the time range to query
1463
- * @param options - Optional settings for time bucketing granularity
1687
+ * @param options - Optional settings for filtering and time bucket granularity
1464
1688
  * @returns Promise resolving to an array of {@link InstanceStatusTimelineResponse}
1465
1689
  *
1466
1690
  * @example
@@ -1487,11 +1711,62 @@ declare class MaestroProcessesService extends BaseService implements MaestroProc
1487
1711
  *
1488
1712
  * @example
1489
1713
  * ```typescript
1714
+ * // Filter to a specific process
1715
+ * const filtered = await maestroProcesses.getInstanceStatusTimeline(startTime, endTime, {
1716
+ * processKeys: ['<processKey>'],
1717
+ * });
1718
+ * ```
1719
+ *
1720
+ * @example
1721
+ * ```typescript
1490
1722
  * // Get all-time data (from Unix epoch to now)
1491
1723
  * const allTime = await maestroProcesses.getInstanceStatusTimeline(new Date(0), new Date());
1492
1724
  * ```
1493
1725
  */
1494
1726
  getInstanceStatusTimeline(startTime: Date, endTime: Date, options?: TimelineOptions): Promise<InstanceStatusTimelineResponse[]>;
1727
+ /**
1728
+ * Get incident counts aggregated by time bucket for maestro processes.
1729
+ *
1730
+ * Returns time-grouped counts of incidents that occurred within each bucket,
1731
+ * useful for rendering incident time-series charts. Use `groupBy` to control
1732
+ * the time bucket size (hour, day, or week) — defaults to day if not provided.
1733
+ *
1734
+ * @param startTime - Start of the time range to query
1735
+ * @param endTime - End of the time range to query
1736
+ * @param options - Optional settings for filtering and time bucket granularity
1737
+ * @returns Promise resolving to an array of {@link IncidentTimelineResponse}
1738
+ *
1739
+ * @example
1740
+ * ```typescript
1741
+ * // Get daily incident counts for the last 7 days
1742
+ * const now = new Date();
1743
+ * const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
1744
+ * const incidents = await maestroProcesses.getIncidentsTimeline(sevenDaysAgo, now);
1745
+ *
1746
+ * for (const incident of incidents) {
1747
+ * console.log(`${incident.startTime} → ${incident.endTime}: ${incident.count} incidents`);
1748
+ * }
1749
+ * ```
1750
+ *
1751
+ * @example
1752
+ * ```typescript
1753
+ * import { TimeInterval } from '@uipath/uipath-typescript/maestro-processes';
1754
+ *
1755
+ * // Get weekly breakdown
1756
+ * const incidents = await maestroProcesses.getIncidentsTimeline(startTime, endTime, {
1757
+ * groupBy: TimeInterval.Week,
1758
+ * });
1759
+ * ```
1760
+ *
1761
+ * @example
1762
+ * ```typescript
1763
+ * // Filter to a specific process
1764
+ * const filtered = await maestroProcesses.getIncidentsTimeline(startTime, endTime, {
1765
+ * processKeys: ['<processKey>'],
1766
+ * });
1767
+ * ```
1768
+ */
1769
+ getIncidentsTimeline(startTime: Date, endTime: Date, options?: TimelineOptions): Promise<IncidentTimelineResponse[]>;
1495
1770
  /**
1496
1771
  * Get the top 10 processes ranked by failure count within a time range.
1497
1772
  *
@@ -1574,22 +1849,22 @@ declare class MaestroProcessesService extends BaseService implements MaestroProc
1574
1849
  * Returns per-element execution counts (success, fail, terminated, paused, in-progress) and
1575
1850
  * duration percentile metrics (min, max, avg, p50, p95, p99) for BPMN elements within a process.
1576
1851
  *
1577
- * @param processKey - Process key to filter by
1578
- * @param packageId - Package identifier
1579
- * @param startTime - Start of the time range to query
1580
- * @param endTime - End of the time range to query
1581
- * @param packageVersion - Package version to filter by
1852
+ * @param request - Process scope + time range to aggregate over
1582
1853
  * @returns Promise resolving to an array of {@link ElementStats}
1583
1854
  * @example
1584
1855
  * ```typescript
1585
- * // Get element metrics for a process
1586
- * const elements = await maestroProcesses.getElementStats(
1587
- * '<processKey>',
1588
- * '<packageId>',
1589
- * new Date('2026-04-01'),
1590
- * new Date(),
1591
- * '1.0.1'
1592
- * );
1856
+ * // First, list processes to find the processKey, packageId, and available versions
1857
+ * const processes = await maestroProcesses.getAll();
1858
+ * const process = processes[0];
1859
+ *
1860
+ * // Get element metrics for that process
1861
+ * const elements = await maestroProcesses.getElementStats({
1862
+ * processKey: process.processKey,
1863
+ * packageId: process.packageId,
1864
+ * packageVersion: process.packageVersions[0],
1865
+ * startTime: new Date('2026-04-01'),
1866
+ * endTime: new Date(),
1867
+ * });
1593
1868
  *
1594
1869
  * // Analyze element performance
1595
1870
  * for (const element of elements) {
@@ -1597,9 +1872,52 @@ declare class MaestroProcessesService extends BaseService implements MaestroProc
1597
1872
  * console.log(` Success: ${element.successCount}, Failed: ${element.failCount}`);
1598
1873
  * console.log(` Avg duration: ${element.avgDurationMs}ms, P95: ${element.p95DurationMs}ms`);
1599
1874
  * }
1875
+ *
1876
+ * // Using bound method on a process — auto-fills processKey and packageId
1877
+ * const boundElements = await process.getElementStats(
1878
+ * new Date('2026-04-01'),
1879
+ * new Date(),
1880
+ * process.packageVersions[0]
1881
+ * );
1882
+ * ```
1883
+ */
1884
+ getElementStats(request: MaestroProcessStatsRequest): Promise<ElementStats[]>;
1885
+ /**
1886
+ * Get instance stats for a process.
1887
+ *
1888
+ * Returns total instance counts broken down by status (running, completed, faulted, etc.)
1889
+ * and the average execution duration for all instances of a process within a time range.
1890
+ *
1891
+ * @param request - Process scope + time range to aggregate over
1892
+ * @returns Promise resolving to {@link InstanceStats}
1893
+ * @example
1894
+ * ```typescript
1895
+ * // First, list processes to find the processKey, packageId, and available versions
1896
+ * const processes = await maestroProcesses.getAll();
1897
+ * const process = processes[0];
1898
+ *
1899
+ * // Get instance status breakdown for that process
1900
+ * const counts = await maestroProcesses.getInstanceStats({
1901
+ * processKey: process.processKey,
1902
+ * packageId: process.packageId,
1903
+ * packageVersion: process.packageVersions[0],
1904
+ * startTime: new Date('2026-04-01'),
1905
+ * endTime: new Date(),
1906
+ * });
1907
+ *
1908
+ * console.log(`Total: ${counts.totalCount}`);
1909
+ * console.log(`Running: ${counts.runningCount}, Completed: ${counts.completedCount}`);
1910
+ * console.log(`Faulted: ${counts.faultedCount}, Avg duration: ${counts.avgDurationMs}ms`);
1911
+ *
1912
+ * // Using bound method on a process — auto-fills processKey and packageId
1913
+ * const boundCounts = await process.getInstanceStats(
1914
+ * new Date('2026-04-01'),
1915
+ * new Date(),
1916
+ * process.packageVersions[0]
1917
+ * );
1600
1918
  * ```
1601
1919
  */
1602
- getElementStats(processKey: string, packageId: string, startTime: Date, endTime: Date, packageVersion: string): Promise<ElementStats[]>;
1920
+ getInstanceStats(request: MaestroProcessStatsRequest): Promise<InstanceStats>;
1603
1921
  }
1604
1922
 
1605
1923
  declare class ProcessInstancesService extends BaseService implements ProcessInstancesServiceModel {
@@ -1645,7 +1963,7 @@ declare class ProcessInstancesService extends BaseService implements ProcessInst
1645
1963
  */
1646
1964
  getAll<T extends ProcessInstanceGetAllWithPaginationOptions = ProcessInstanceGetAllWithPaginationOptions>(options?: T): Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<ProcessInstanceGetResponse> : NonPaginatedResponse<ProcessInstanceGetResponse>>;
1647
1965
  /**
1648
- * Get a process instance by ID with operation methods (cancel, pause, resume)
1966
+ * Get a process instance by ID with operation methods (cancel, pause, resume, retry)
1649
1967
  * @param id The ID of the instance to retrieve
1650
1968
  * @param folderKey The folder key for authorization
1651
1969
  * @returns Promise<ProcessInstanceGetResponse>
@@ -1706,6 +2024,17 @@ declare class ProcessInstancesService extends BaseService implements ProcessInst
1706
2024
  * @returns Promise resolving to operation result with updated instance data
1707
2025
  */
1708
2026
  resume(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
2027
+ /**
2028
+ * Retry a faulted process instance
2029
+ *
2030
+ * Re-runs the failed elements of the instance (and the elements that follow) within
2031
+ * the same instance, spawning new jobs. Use to recover from transient/flaky failures.
2032
+ * @param instanceId The ID of the instance to retry
2033
+ * @param folderKey The folder key for authorization
2034
+ * @param options Optional retry options with comment
2035
+ * @returns Promise resolving to operation result with updated instance data
2036
+ */
2037
+ retry(instanceId: string, folderKey: string, options?: ProcessInstanceOperationOptions): Promise<OperationResponse<ProcessInstanceOperationResponse>>;
1709
2038
  /**
1710
2039
  * Parses BPMN XML to extract variable metadata from uipath:inputOutput elements
1711
2040
  * @private
@@ -1774,4 +2103,4 @@ declare class ProcessIncidentsService extends BaseService implements ProcessInci
1774
2103
  }
1775
2104
 
1776
2105
  export { DebugMode, InstanceFinalStatus, MaestroProcessesService as MaestroProcesses, MaestroProcessesService, ProcessIncidentSeverity, ProcessIncidentStatus, ProcessIncidentType, ProcessIncidentsService as ProcessIncidents, ProcessIncidentsService, ProcessInstancesService as ProcessInstances, ProcessInstancesService, TimeInterval, createProcessInstanceWithMethods, createProcessWithMethods };
1777
- export type { BpmnXmlString, ElementGetTopFailedCountResponse, ElementMetaData, ElementStats, GetTopBaseResponse, GetTopDurationResponse, GetTopFaultedCountResponse, GetTopRunCountResponse, GlobalVariableMetaData, InstanceStatusTimelineResponse, MaestroProcessGetAllResponse, MaestroProcessesServiceModel, ProcessGetTopDurationResponse, ProcessGetTopFaultedCountResponse, ProcessGetTopRunCountResponse, ProcessIncidentGetAllResponse, ProcessIncidentGetResponse, ProcessIncidentsServiceModel, ProcessInstanceExecutionHistoryResponse, ProcessInstanceGetAllOptions, ProcessInstanceGetAllWithPaginationOptions, ProcessInstanceGetResponse, ProcessInstanceGetVariablesOptions, ProcessInstanceGetVariablesResponse, ProcessInstanceMethods, ProcessInstanceOperationOptions, ProcessInstanceOperationResponse, ProcessInstanceRun, ProcessInstancesServiceModel, ProcessMethods, RawMaestroProcessGetAllResponse, RawProcessInstanceGetResponse, TimelineOptions, TopQueryOptions };
2106
+ export type { BpmnXmlString, DurationStats, ElementGetTopFailedCountResponse, ElementMetaData, ElementStats, GetTopBaseResponse, GetTopDurationResponse, GetTopFaultedCountResponse, GetTopRunCountResponse, GlobalVariableMetaData, IncidentTimelineResponse, InstanceStats, InstanceStatusTimelineResponse, MaestroProcessGetAllResponse, MaestroProcessStatsRequest, MaestroProcessesServiceModel, ProcessGetTopDurationResponse, ProcessGetTopFaultedCountResponse, ProcessGetTopRunCountResponse, ProcessIncidentGetAllResponse, ProcessIncidentGetResponse, ProcessIncidentsServiceModel, ProcessInstanceExecutionHistoryResponse, ProcessInstanceGetAllOptions, ProcessInstanceGetAllWithPaginationOptions, ProcessInstanceGetResponse, ProcessInstanceGetVariablesOptions, ProcessInstanceGetVariablesResponse, ProcessInstanceMethods, ProcessInstanceOperationOptions, ProcessInstanceOperationResponse, ProcessInstanceRun, ProcessInstancesServiceModel, ProcessMethods, RawMaestroProcessGetAllResponse, RawProcessInstanceGetResponse, TimelineOptions, TopQueryOptions };