name: uipath-typescript-sdk
description: >-
Write, debug, and explain code that uses the UiPath TypeScript SDK
(@uipath/uipath-typescript) to talk to UiPath Automation Cloud. Use this
whenever the user is building or editing a UiPath Coded App, dashboard, or any
TypeScript/JavaScript that calls UiPath — initializing/authenticating the SDK
(OAuth, PAT/secret, or Coded App), starting or monitoring Orchestrator Jobs,
Processes, Queues, Assets, Buckets, or Attachments, working with Action Center
Tasks, reading/writing Data Fabric Entities or ChoiceSets, controlling Maestro
processes/cases and their running instances, or wiring up Conversational
Agents. Trigger this even when the user only says things like "UiPath SDK",
"coded app", "Orchestrator API in code", "Action Center task in TypeScript",
pastes UiPath TS SDK code, or is working on the vendor-risk-orchestrator /
Third-Party Risk Gate project. Prefer this over guessing method names — the
SDK has several non-obvious return-type and folder-scoping rules that are easy
to get wrong from memory.
UiPath TypeScript SDK
The @uipath/uipath-typescript package is a typed client for UiPath Automation
Cloud. You use it to build Coded Apps and dashboards that read and control
Orchestrator (Jobs, Processes, Queues, Assets, Buckets, Tasks/Action Center),
Data Fabric (Entities, ChoiceSets), Maestro (processes, cases, and their running
instances), and Conversational Agents.
This SKILL.md covers the setup, the few rules that break code if you get them
wrong, and a map of which reference file to read for each service. Read the
relevant reference file before writing more than a trivial snippet — the
method signatures there are the source of truth; do not invent method names or
parameters from memory.
Install and import
npm install @uipath/uipath-typescript
Two import styles exist. Prefer the modular style — it keeps the bundle
small by pulling in only the services you use:
import { UiPath } from '@uipath/uipath-typescript/core';
import { Tasks } from '@uipath/uipath-typescript/tasks';
const sdk = new UiPath({ /* config */ });
await sdk.initialize(); // see auth rules below
const tasks = new Tasks(sdk); // construct each service with the sdk
The all-in-one style also works but bundles every service whether you use it or
not: import { UiPath } from '@uipath/uipath-typescript' then sdk.tasks.getAll().
Critical rules (these are the things that break SDK code)
1. OAuth must call initialize(); secret/PAT does not
- OAuth: you MUST
await sdk.initialize() before calling any service, and it
must succeed. Wrap it in try/catch.
- Secret / PAT (Personal Access Token) / Bearer token: the SDK
auto-initializes when you construct it — calling
initialize() is not needed.
- Coded App (deployed on the platform): construct with
new UiPath() (no
args) — config is injected as meta tags — then await sdk.initialize().
See references/auth-and-setup.md for all three flows, the OAuth callback
helpers (completeOAuth, isInOAuthCallback, etc.), updateToken() for
externally-managed tokens, and a runnable auth test script.
2. The return type of getAll/list methods depends on whether you pass pagination options
For most paginated services, getAll() (and similar list methods) returns:
- a
NonPaginatedResponse<T> (has .items and .totalCount) when you pass no
pagination options, or
- a
PaginatedResponse<T> (adds .hasNextPage, .nextCursor, .previousCursor,
etc.) when you pass any of pageSize, cursor, or jumpToPage.
Because the type is conditional, TypeScript needs a cast when you chain cursors:
let page = await assets.getAll({ pageSize: 10 }) as PaginatedResponse<AssetGetResponse>;
while (page.hasNextPage) {
page.items.forEach(a => console.log(a.name));
page = await assets.getAll({ cursor: page.nextCursor }) as PaginatedResponse<AssetGetResponse>;
}
3. Not every getAll returns .items — some return a plain array
This is the single easiest mistake to make. These methods return a plain
array (iterate directly, no .items):
entities.getAll() → EntityGetResponse[]
choicesets.getAll() → ChoiceSetGetAllResponse[]
maestroProcesses.getAll() → array
cases.getAll() → array
conversationalAgent.getAll() → AgentGetResponse[]
- the Maestro/Cases analytics methods (
getTopRunCount, getInstanceStatusTimeline, etc.) → arrays
Everything else with pagination (assets, jobs, processes, queues,
buckets, tasks, processInstances, caseInstances, conversations,
exchanges getAll; entities.getAllRecords()/queryRecordsById();
buckets.getFiles()/getFileMetaData(); choicesets.getById()) returns the
.items-wrapped response from rule 2. When in doubt, check the reference file.
4. Folder scoping: Orchestrator uses folderId (number), Maestro uses folderKey (string GUID)
- Orchestrator
getById and most operations require a numeric folderId.
Many getAll/getByName/start methods also accept folder scoping as
folderId, folderKey (GUID), or folderPath (e.g. 'Shared/Finance').
- Maestro process/case instance methods (
getById, cancel, pause,
resume, close, reopen, getIncidents, getVariables, getBpmn) take a
string folderKey, not a numeric folderId.
tasks.complete(...) and tasks.create(...) require folderId as a second
argument.
5. Objects returned by getById/getAll carry bound methods
Returned entities are not plain data — they have operations bound to them. e.g.
task.assign({ userId }), job.getOutput(), instance.cancel(),
entity.insertRecord({...}), conversation.startSession(). You can call the
service method (tasks.assign({ taskId, userId })) or the bound instance method
(task.assign({ userId })) interchangeably — the bound form fills in the ids
for you.
6. jobs.getAll() never includes input/output
inputArguments, inputFile, outputArguments, and outputFile are always
null in getAll results. To read a job's output, call
jobs.getOutput(jobKey, folderId) (or job.getOutput()).
Pagination
The pagination model (cursor navigation + optional page-jumping), the
PaginationOptions / PaginatedResponse<T> shapes, and the table of which
methods support jumpToPage live in references/pagination.md. Read it whenever
you build a list view or iterate over more than one page.
Service map — which reference to read
| You're working with… |
Read |
| SDK init, OAuth/PAT/Coded-App auth, token handling |
references/auth-and-setup.md |
| Paging through any list, cursors, page-jump |
references/pagination.md |
| Jobs (start/monitor/restart/resume/stop/output), Processes (start by key/name) |
references/orchestrator-jobs-processes.md |
| Action Center Tasks (get/create/complete/assign/reassign/unassign, users) |
references/action-center-tasks.md |
| Assets, Queues, Buckets (files/upload/download), Attachments |
references/orchestrator-storage.md |
| Data Fabric Entities (records CRUD, attachments, queries) and ChoiceSets |
references/data-fabric.md |
| Maestro processes & cases + their running instances (lifecycle, incidents, SLA, analytics) |
references/maestro.md |
| Conversational Agents (real-time WebSocket streaming, history) |
references/conversational-agents.md |
Where this fits the vendor-risk-orchestrator project
The Third-Party Risk Gate runs a Maestro workflow that scores vendors, routes
risky ones to a human reviewer, and keeps an audit trail. If you build a Coded
App / dashboard on top of it with this SDK, the high-value areas are, in rough
order:
- Action Center Tasks (
action-center-tasks.md) — the human-in-the-loop
review. Listing pending review tasks, showing the brief, and completing a
task with an Approve/Reject action is the core interaction.
- Maestro (
maestro.md) — monitoring process/case instances, their status,
incidents, and SLA; pausing/resuming/cancelling a run from a dashboard. Use
the folderKey (string) scoping rule here.
- Jobs & Processes (
orchestrator-jobs-processes.md) — starting an
automation and polling a job to a final state.
- Data Fabric Entities or Queues (
data-fabric.md / orchestrator-storage.md)
— if the audit trail / vendor records are stored as Data Fabric records or
Orchestrator queue items, this is how you read and write them.
- Auth (
auth-and-setup.md) — a deployed Coded App uses the zero-arg
new UiPath() flow; local dev/standalone uses OAuth or a PAT.
Conversational Agents (conversational-agents.md) is the SDK's chat-streaming
API and is most likely not needed for this project — the project's "Agent
Builder" agents are a different platform feature. Read that reference only if you
are explicitly building a real-time chat UI.
General guidance
- Always check the reference file for exact signatures before writing code; the
SDK's conditional return types and folder-scoping rules are hard to remember.
- Prefer the modular imports.
- Wrap OAuth
initialize() and any operation that can fail (stop/restart/resume,
uploads, completions) in try/catch.
- Treat the uploaded SDK docs as the authority. If something you need isn't in
the references and isn't in the docs, say so rather than guessing a method.
1---2name: uipath-typescript-sdk3description: Write, debug, and explain code that uses the UiPath TypeScript SDK (@uipath/uipath-typescript) to talk to UiPath Automation Cloud. Use this whenever the user is4---5---6name: uipath-typescript-sdk7description: >-8 Write, debug, and explain code that uses the UiPath TypeScript SDK9 (@uipath/uipath-typescript) to talk to UiPath Automation Cloud. Use this10 whenever the user is building or editing a UiPath Coded App, dashboard, or any11 TypeScript/JavaScript that calls UiPath — initializing/authenticating the SDK12 (OAuth, PAT/secret, or Coded App), starting or monitoring Orchestrator Jobs,13 Processes, Queues, Assets, Buckets, or Attachments, working with Action Center14 Tasks, reading/writing Data Fabric Entities or ChoiceSets, controlling Maestro15 processes/cases and their running instances, or wiring up Conversational16 Agents. Trigger this even when the user only says things like "UiPath SDK",17 "coded app", "Orchestrator API in code", "Action Center task in TypeScript",18 pastes UiPath TS SDK code, or is working on the vendor-risk-orchestrator /19 Third-Party Risk Gate project. Prefer this over guessing method names — the20 SDK has several non-obvious return-type and folder-scoping rules that are easy21 to get wrong from memory.22---2324# UiPath TypeScript SDK2526The `@uipath/uipath-typescript` package is a typed client for UiPath Automation27Cloud. You use it to build Coded Apps and dashboards that read and control28Orchestrator (Jobs, Processes, Queues, Assets, Buckets, Tasks/Action Center),29Data Fabric (Entities, ChoiceSets), Maestro (processes, cases, and their running30instances), and Conversational Agents.3132This SKILL.md covers the setup, the few rules that break code if you get them33wrong, and a map of which reference file to read for each service. **Read the34relevant reference file before writing more than a trivial snippet** — the35method signatures there are the source of truth; do not invent method names or36parameters from memory.3738## Install and import3940```bash41npm install @uipath/uipath-typescript42```4344Two import styles exist. **Prefer the modular style** — it keeps the bundle45small by pulling in only the services you use:4647```ts48import { UiPath } from '@uipath/uipath-typescript/core';49import { Tasks } from '@uipath/uipath-typescript/tasks';5051const sdk = new UiPath({ /* config */ });52await sdk.initialize(); // see auth rules below53const tasks = new Tasks(sdk); // construct each service with the sdk54```5556The all-in-one style also works but bundles every service whether you use it or57not: `import { UiPath } from '@uipath/uipath-typescript'` then `sdk.tasks.getAll()`.5859## Critical rules (these are the things that break SDK code)6061### 1. OAuth must call `initialize()`; secret/PAT does not62- **OAuth**: you MUST `await sdk.initialize()` before calling any service, and it63 must succeed. Wrap it in try/catch.64- **Secret / PAT (Personal Access Token) / Bearer token**: the SDK65 auto-initializes when you construct it — calling `initialize()` is not needed.66- **Coded App** (deployed on the platform): construct with `new UiPath()` (no67 args) — config is injected as meta tags — then `await sdk.initialize()`.6869See `references/auth-and-setup.md` for all three flows, the OAuth callback70helpers (`completeOAuth`, `isInOAuthCallback`, etc.), `updateToken()` for71externally-managed tokens, and a runnable auth test script.7273### 2. The return type of `getAll`/list methods depends on whether you pass pagination options74For most paginated services, `getAll()` (and similar list methods) returns:75- a `NonPaginatedResponse<T>` (has `.items` and `.totalCount`) when you pass **no**76 pagination options, or77- a `PaginatedResponse<T>` (adds `.hasNextPage`, `.nextCursor`, `.previousCursor`,78 etc.) when you pass **any** of `pageSize`, `cursor`, or `jumpToPage`.7980Because the type is conditional, TypeScript needs a cast when you chain cursors:8182```ts83let page = await assets.getAll({ pageSize: 10 }) as PaginatedResponse<AssetGetResponse>;84while (page.hasNextPage) {85 page.items.forEach(a => console.log(a.name));86 page = await assets.getAll({ cursor: page.nextCursor }) as PaginatedResponse<AssetGetResponse>;87}88```8990### 3. Not every `getAll` returns `.items` — some return a plain array91This is the single easiest mistake to make. These methods return a **plain92array** (iterate directly, no `.items`):93- `entities.getAll()` → `EntityGetResponse[]`94- `choicesets.getAll()` → `ChoiceSetGetAllResponse[]`95- `maestroProcesses.getAll()` → array96- `cases.getAll()` → array97- `conversationalAgent.getAll()` → `AgentGetResponse[]`98- the Maestro/Cases analytics methods (`getTopRunCount`, `getInstanceStatusTimeline`, etc.) → arrays99100Everything else with pagination (`assets`, `jobs`, `processes`, `queues`,101`buckets`, `tasks`, `processInstances`, `caseInstances`, `conversations`,102`exchanges` `getAll`; `entities.getAllRecords()`/`queryRecordsById()`;103`buckets.getFiles()`/`getFileMetaData()`; `choicesets.getById()`) returns the104`.items`-wrapped response from rule 2. When in doubt, check the reference file.105106### 4. Folder scoping: Orchestrator uses `folderId` (number), Maestro uses `folderKey` (string GUID)107- Orchestrator `getById` and most operations **require** a numeric `folderId`.108 Many `getAll`/`getByName`/`start` methods also accept folder scoping as109 `folderId`, `folderKey` (GUID), or `folderPath` (e.g. `'Shared/Finance'`).110- Maestro process/case **instance** methods (`getById`, `cancel`, `pause`,111 `resume`, `close`, `reopen`, `getIncidents`, `getVariables`, `getBpmn`) take a112 string **`folderKey`**, not a numeric folderId.113- `tasks.complete(...)` and `tasks.create(...)` require `folderId` as a second114 argument.115116### 5. Objects returned by `getById`/`getAll` carry bound methods117Returned entities are not plain data — they have operations bound to them. e.g.118`task.assign({ userId })`, `job.getOutput()`, `instance.cancel()`,119`entity.insertRecord({...})`, `conversation.startSession()`. You can call the120service method (`tasks.assign({ taskId, userId })`) or the bound instance method121(`task.assign({ userId })`) interchangeably — the bound form fills in the ids122for you.123124### 6. `jobs.getAll()` never includes input/output125`inputArguments`, `inputFile`, `outputArguments`, and `outputFile` are always126`null` in `getAll` results. To read a job's output, call127`jobs.getOutput(jobKey, folderId)` (or `job.getOutput()`).128129## Pagination130131The pagination model (cursor navigation + optional page-jumping), the132`PaginationOptions` / `PaginatedResponse<T>` shapes, and the table of which133methods support `jumpToPage` live in `references/pagination.md`. Read it whenever134you build a list view or iterate over more than one page.135136## Service map — which reference to read137138| You're working with… | Read |139| --- | --- |140| SDK init, OAuth/PAT/Coded-App auth, token handling | `references/auth-and-setup.md` |141| Paging through any list, cursors, page-jump | `references/pagination.md` |142| Jobs (start/monitor/restart/resume/stop/output), Processes (start by key/name) | `references/orchestrator-jobs-processes.md` |143| Action Center Tasks (get/create/complete/assign/reassign/unassign, users) | `references/action-center-tasks.md` |144| Assets, Queues, Buckets (files/upload/download), Attachments | `references/orchestrator-storage.md` |145| Data Fabric Entities (records CRUD, attachments, queries) and ChoiceSets | `references/data-fabric.md` |146| Maestro processes & cases + their running instances (lifecycle, incidents, SLA, analytics) | `references/maestro.md` |147| Conversational Agents (real-time WebSocket streaming, history) | `references/conversational-agents.md` |148149## Where this fits the vendor-risk-orchestrator project150151The Third-Party Risk Gate runs a Maestro workflow that scores vendors, routes152risky ones to a human reviewer, and keeps an audit trail. If you build a Coded153App / dashboard on top of it with this SDK, the high-value areas are, in rough154order:1551561. **Action Center Tasks** (`action-center-tasks.md`) — the human-in-the-loop157 review. Listing pending review tasks, showing the brief, and completing a158 task with an Approve/Reject action is the core interaction.1592. **Maestro** (`maestro.md`) — monitoring process/case instances, their status,160 incidents, and SLA; pausing/resuming/cancelling a run from a dashboard. Use161 the `folderKey` (string) scoping rule here.1623. **Jobs & Processes** (`orchestrator-jobs-processes.md`) — starting an163 automation and polling a job to a final state.1644. **Data Fabric Entities or Queues** (`data-fabric.md` / `orchestrator-storage.md`)165 — if the audit trail / vendor records are stored as Data Fabric records or166 Orchestrator queue items, this is how you read and write them.1675. **Auth** (`auth-and-setup.md`) — a deployed Coded App uses the zero-arg168 `new UiPath()` flow; local dev/standalone uses OAuth or a PAT.169170Conversational Agents (`conversational-agents.md`) is the SDK's chat-streaming171API and is most likely **not** needed for this project — the project's "Agent172Builder" agents are a different platform feature. Read that reference only if you173are explicitly building a real-time chat UI.174175## General guidance176- Always check the reference file for exact signatures before writing code; the177 SDK's conditional return types and folder-scoping rules are hard to remember.178- Prefer the modular imports.179- Wrap OAuth `initialize()` and any operation that can fail (stop/restart/resume,180 uploads, completions) in try/catch.181- Treat the uploaded SDK docs as the authority. If something you need isn't in182 the references and isn't in the docs, say so rather than guessing a method.