Queues
Service for managing UiPath Queues
Queues are a fundamental component of UiPath automation that enable distributed and scalable processing of work items. UiPath Queues Guide
Usage¶
Prerequisites: Initialize the SDK first - see Getting Started
import { Queues } from '@uipath/uipath-typescript/queues';
const queues = new Queues(sdk);
const allQueues = await queues.getAll();
Methods¶
getAll()¶
getAll<
T>(options?:T):Promise<TextendsHasPaginationOptions<T> ?PaginatedResponse<QueueGetResponse> :NonPaginatedResponse<QueueGetResponse>>
Gets all queues across folders with optional filtering and folder scoping
Type Parameters¶
| Type Parameter | Default type |
|---|---|
T extends QueueGetAllOptions |
QueueGetAllOptions |
Parameters¶
| Parameter | Type | Description |
|---|---|---|
options? |
T |
Query options including optional folderId and pagination options |
Returns¶
Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<QueueGetResponse> : NonPaginatedResponse<QueueGetResponse>>
Promise resolving to either a QueueGetResponse array (NonPaginatedResponse) or a PaginatedResponse<QueueGetResponse> when pagination options are used. Each queue has methods attached for operating on its items.
Example¶
// Standard array return
const allQueues = await queues.getAll();
// Get queues within a specific folder
const folderQueues = await queues.getAll({
folderId: <folderId>
});
// Get queues with filtering
const filteredQueues = await queues.getAll({
filter: "name eq 'MyQueue'"
});
// First page with pagination
const page1 = await queues.getAll({ pageSize: 10 });
// Navigate using cursor
if (page1.hasNextPage) {
const page2 = await queues.getAll({ cursor: page1.nextCursor });
}
// Jump to specific page
const page5 = await queues.getAll({
jumpToPage: 5,
pageSize: 10
});
getAllItems()¶
getAllItems<
T>(queueId:number,folderId:number,options?:T):Promise<TextendsHasPaginationOptions<T> ?PaginatedResponse<QueueItem> :NonPaginatedResponse<QueueItem>>
Gets the items of a queue with optional filtering and pagination
Returns the queue's work items including their status, business payload
(specificData), output, timing fields, and failure details.
Type Parameters¶
| Type Parameter | Default type |
|---|---|
T extends QueueGetAllItemsOptions |
QueueGetAllItemsOptions |
Parameters¶
| Parameter | Type | Description |
|---|---|---|
queueId |
number |
Queue ID |
folderId |
number |
Required folder ID |
options? |
T |
Query options including filtering and pagination options |
Returns¶
Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<QueueItem> : NonPaginatedResponse<QueueItem>>
Promise resolving to either a QueueItem array (NonPaginatedResponse) or a PaginatedResponse<QueueItem> when pagination options are used.
Examples¶
const items = await queues.getAllItems(<queueId>, <folderId>);
// Failed items only, newest first
const failed = await queues.getAllItems(<queueId>, <folderId>, {
filter: "status eq 'Failed'",
orderby: 'createdTime desc',
pageSize: 25
});
// Or operate on a queue returned by getById/getAll
const queue = await queues.getById(<queueId>, <folderId>);
const items = await queue.getAllItems();
getById()¶
getById(
id:number,folderId:number,options?:QueueGetByIdOptions):Promise<QueueGetResponse>
Gets a single queue by ID
Parameters¶
| Parameter | Type | Description |
|---|---|---|
id |
number |
Queue ID |
folderId |
number |
Required folder ID |
options? |
QueueGetByIdOptions |
- |
Returns¶
Promise<QueueGetResponse>
Promise resolving to a QueueGetResponse — the queue definition with methods attached for operating on its items
Example¶
// Get queue by ID
const queue = await queues.getById(<queueId>, <folderId>);
// Operate on the queue directly via the attached methods
const items = await queue.getAllItems();
const item = await queue.insertItem({
invoiceId: 'INV-1001',
amount: 1520
});
insertItemByName()¶
insertItemByName(
queueName:string,folderId:number,specificData:Record<string,QueueItemValue>,options?:QueueInsertItemOptions):Promise<QueueItem>
Inserts a new item into a queue by queue name
Returns the created queue item including its id, status, and the stored payload. The payload keys are user-defined and are stored and returned exactly as provided.
The payload must be flat — values are simple scalars (see QueueItemValue); nested objects and arrays are rejected.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
queueName |
string |
Name of the queue to insert into |
folderId |
number |
Required folder ID |
specificData |
Record<string, QueueItemValue> |
The item's business payload (stored as the queue item's specific content) |
options? |
QueueInsertItemOptions |
Optional item metadata (priority, reference, defer/due dates) |
Returns¶
Promise<QueueItem>
Promise resolving to the created QueueItem
Example¶
import { QueuePriority } from '@uipath/uipath-typescript/queues';
// Minimal insert
const item = await queues.insertItemByName('<queueName>', <folderId>, {
invoiceId: 'INV-1001',
amount: 1520
});
// With metadata
const rushItem = await queues.insertItemByName('<queueName>', <folderId>, {
invoiceId: 'INV-1002'
}, {
priority: QueuePriority.High,
reference: 'INV-1002',
dueDate: new Date('2026-08-15')
});