Cases
Service for managing UiPath Maestro Cases
UiPath Maestro Case Management describes solutions that help manage and automate the full flow of complex E2E scenarios.
Usage¶
Prerequisites: Initialize the SDK first - see Getting Started
import { Cases } from '@uipath/uipath-typescript/cases';
const cases = new Cases(sdk);
const allCases = await cases.getAll();
Methods¶
getAll()¶
getAll():
Promise<CaseGetAllWithMethodsResponse[]>
Returns¶
Promise<CaseGetAllWithMethodsResponse[]>
Promise resolving to an array of CaseGetAllWithMethodsResponse
Example¶
// Get all case management processes
const allCases = await cases.getAll();
// Access case information
for (const caseProcess of allCases) {
console.log(`Case Process: ${caseProcess.processKey}`);
console.log(`Running instances: ${caseProcess.runningCount}`);
console.log(`Completed instances: ${caseProcess.completedCount}`);
}
getElementStats()¶
getElementStats(
processKey:string,packageId:string,startTime:Date,endTime:Date,packageVersion:string):Promise<ElementStats[]>
Get element stats for case instances
Returns per-element execution counts (success, fail, terminated, paused, in-progress) and duration percentile metrics (min, max, avg, p50, p95, p99) for BPMN elements within a case.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
processKey |
string |
Process key to filter by |
packageId |
string |
Package identifier |
startTime |
Date |
Start of the time range to query |
endTime |
Date |
End of the time range to query |
packageVersion |
string |
Package version to filter by |
Returns¶
Promise<ElementStats[]>
Promise resolving to an array of ElementStats
Example¶
// Get element metrics for a case
const elements = await cases.getElementStats(
'<processKey>',
'<packageId>',
new Date('2026-04-01'),
new Date(),
'1.0.1'
);
// Find elements with failures
const failedElements = elements.filter(e => e.failCount > 0);
for (const element of failedElements) {
console.log(`Failed element: ${element.elementId}, failures: ${element.failCount}`);
}
getInstanceStatusTimeline()¶
getInstanceStatusTimeline(
startTime:Date,endTime:Date,options?:TimelineOptions):Promise<InstanceStatusTimelineResponse[]>
Get all instances status counts aggregated by date for case management processes.
Returns time-grouped counts of case instances grouped by status (Completed, Faulted, Cancelled),
useful for rendering time-series charts. Use groupBy to control the time bucket size
(hour, day, or week) — defaults to day if not provided.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
startTime |
Date |
Start of the time range to query |
endTime |
Date |
End of the time range to query |
options? |
TimelineOptions |
Optional settings for time bucketing granularity |
Returns¶
Promise<InstanceStatusTimelineResponse[]>
Promise resolving to an array of InstanceStatusTimelineResponse
Examples¶
// Get daily instance status for the last 7 days
const now = new Date();
const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
const statuses = await cases.getInstanceStatusTimeline(sevenDaysAgo, now);
for (const entry of statuses) {
console.log(`${entry.startTime} — ${entry.status}: ${entry.count}`);
}
import { TimeInterval } from '@uipath/uipath-typescript/cases';
// Get weekly breakdown
const statuses = await cases.getInstanceStatusTimeline(startTime, endTime, {
groupBy: TimeInterval.Week,
});
// Get all-time data (from Unix epoch to now)
const allTime = await cases.getInstanceStatusTimeline(new Date(0), new Date());
getTopElementFailedCount()¶
getTopElementFailedCount(
startTime:Date,endTime:Date,options?:TopQueryOptions):Promise<ElementGetTopFailedCountResponse[]>
Get the top 10 BPMN elements ranked by failure count within a time range.
Returns an array of up to 10 elements sorted by how many times they failed, useful for identifying the most error-prone activities in case processes.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
startTime |
Date |
Start of the time range to query |
endTime |
Date |
End of the time range to query |
options? |
TopQueryOptions |
Optional filters (packageId, processKey, version) |
Returns¶
Promise<ElementGetTopFailedCountResponse[]>
Promise resolving to an array of ElementGetTopFailedCountResponse
Examples¶
import { Cases } from '@uipath/uipath-typescript/cases';
const cases = new Cases(sdk);
// Get top failing elements for the last 7 days
const topFailing = await cases.getTopElementFailedCount(
new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
new Date()
);
for (const element of topFailing) {
console.log(`${element.elementName} (${element.elementType}): ${element.failedCount} failures`);
}
// Get top failing elements for a specific process
const filtered = await cases.getTopElementFailedCount(
new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
new Date(),
{ processKey: '<processKey>' }
);
getTopExecutionDuration()¶
getTopExecutionDuration(
startTime:Date,endTime:Date,options?:TopQueryOptions):Promise<CaseGetTopDurationResponse[]>
Get the top 5 case processes ranked by total duration within a time range.
Returns an array of up to 5 case processes sorted by their total execution time, useful for identifying the longest-running case processes in a given period.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
startTime |
Date |
Start of the time range to query |
endTime |
Date |
End of the time range to query |
options? |
TopQueryOptions |
Optional filters (packageId, processKey, version) |
Returns¶
Promise<CaseGetTopDurationResponse[]>
Promise resolving to an array of CaseGetTopDurationResponse
Examples¶
import { Cases } from '@uipath/uipath-typescript/cases';
const cases = new Cases(sdk);
// Get top case processes by duration for the last 7 days
const topProcesses = await cases.getTopExecutionDuration(
new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
new Date()
);
for (const process of topProcesses) {
console.log(`${process.packageId}: ${process.duration}ms total`);
}
// Get top case processes by duration for a specific package
const filtered = await cases.getTopExecutionDuration(
new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
new Date(),
{ packageId: '<packageId>' }
);
getTopFaultedCount()¶
getTopFaultedCount(
startTime:Date,endTime:Date,options?:TopQueryOptions):Promise<CaseGetTopFaultedCountResponse[]>
Get the top 10 case processes ranked by failure count within a time range.
Returns an array of up to 10 case processes sorted by how many instances faulted, useful for identifying the most error-prone case processes in a given period.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
startTime |
Date |
Start of the time range to query |
endTime |
Date |
End of the time range to query |
options? |
TopQueryOptions |
Optional filters (packageId, processKey, version) |
Returns¶
Promise<CaseGetTopFaultedCountResponse[]>
Promise resolving to an array of CaseGetTopFaultedCountResponse
Examples¶
import { Cases } from '@uipath/uipath-typescript/cases';
const cases = new Cases(sdk);
// Get top case processes by faulted count for the last 7 days
const topFailing = await cases.getTopFaultedCount(
new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
new Date()
);
for (const process of topFailing) {
console.log(`${process.packageId}: ${process.faultedCount} failures`);
}
// Get top case processes by faulted count for a specific package
const filtered = await cases.getTopFaultedCount(
new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
new Date(),
{ packageId: '<packageId>' }
);
getTopRunCount()¶
getTopRunCount(
startTime:Date,endTime:Date,options?:TopQueryOptions):Promise<CaseGetTopRunCountResponse[]>
Get the top 5 case processes ranked by run count within a time range.
Returns an array of up to 5 case processes sorted by how many times they were executed, useful for identifying the most active case processes in a given period.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
startTime |
Date |
Start of the time range to query |
endTime |
Date |
End of the time range to query |
options? |
TopQueryOptions |
Optional filters (packageId, processKey, version) |
Returns¶
Promise<CaseGetTopRunCountResponse[]>
Promise resolving to an array of CaseGetTopRunCountResponse
Examples¶
import { Cases } from '@uipath/uipath-typescript/cases';
const cases = new Cases(sdk);
// Get top case processes by run count for the last 7 days
const topProcesses = await cases.getTopRunCount(
new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
new Date()
);
for (const process of topProcesses) {
console.log(`${process.packageId}: ${process.runCount} runs`);
}