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<CaseGetAllResponse[]>
Returns¶
Promise<CaseGetAllResponse[]>
Promise resolving to array of Case objects CaseGetAllResponse
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}`);
}
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());
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`);
}