Functions
Service for invoking UiPath Coded Functions.
Coded functions are lightweight units of TypeScript/JavaScript or Python code deployed to UiPath and executed on demand. Each function is packaged as a process, exposed through an HTTP endpoint, and uniquely named within its folder. This service lets you discover deployed functions and invoke them with typed input and output — without dealing with the underlying process and trigger plumbing.
Usage¶
Prerequisites: Initialize the SDK first - see Getting Started
import { Functions } from '@uipath/uipath-typescript/functions';
const functions = new Functions(sdk);
const result = await functions.invoke('my-function', { amount: 42 }, { folderId: <folderId> });
Methods¶
getAll()¶
getAll<
T>(options?:T):Promise<TextendsHasPaginationOptions<T> ?PaginatedResponse<FunctionGetResponse> :NonPaginatedResponse<FunctionGetResponse>>
Gets all functions in a folder with optional filtering and pagination.
Returns each function's identity (name, slug, HTTP method), state, and
packaging details, with an invoke method
bound to each item. Folder context is required — pass one of folderId,
folderKey, or folderPath in the options, or initialize the SDK with a
folder context.
One package can expose several functions, so filter on processName,
processSlug, or processKey to narrow the result to a single package.
Type Parameters¶
| Type Parameter | Default type |
|---|---|
T extends FunctionGetAllOptions |
FunctionGetAllOptions |
Parameters¶
| Parameter | Type | Description |
|---|---|---|
options? |
T |
Query options including folder scoping (folderId / folderKey / folderPath), filtering, and pagination options |
Returns¶
Promise<T extends HasPaginationOptions<T> ? PaginatedResponse<FunctionGetResponse> : NonPaginatedResponse<FunctionGetResponse>>
Promise resolving to either an array of functions NonPaginatedResponse<FunctionGetResponse> or a PaginatedResponse<FunctionGetResponse> when pagination options are used.
Example¶
// Get all functions in a folder
const deployed = await functions.getAll({ folderId: <folderId> });
// By folder path
const shared = await functions.getAll({ folderPath: 'Shared/Finance' });
// With filtering
const enabled = await functions.getAll({
folderId: <folderId>,
filter: 'enabled eq true',
orderby: 'name asc',
});
// Only the functions deployed from one package
const fromPackage = await functions.getAll({
folderId: <folderId>,
filter: "processName eq 'my-functions'",
});
// First page with pagination
const page1 = await functions.getAll({ folderId: <folderId>, pageSize: 10 });
// Navigate using cursor
if (page1.hasNextPage) {
const page2 = await functions.getAll({ folderId: <folderId>, cursor: page1.nextCursor });
}
invoke()¶
invoke<
TInput,TOutput>(name:string,input?:TInput,options?:FunctionInvokeOptions):Promise<TOutput>
Invokes a function by name and returns its output.
The call is synchronous — it resolves with the function's output. Coded functions exposed over HTTP are request/response only, so a run that exceeds the platform's execution limit fails rather than continuing in the background.
Type the input and output by supplying the generics — they should match the
input/output schema the function declares. Folder context is required — pass
one of folderId, folderKey, or folderPath in the options, or initialize
the SDK with a folder context.
Type Parameters¶
| Type Parameter | Default type |
|---|---|
TInput extends object |
Record<string, unknown> |
TOutput |
unknown |
Parameters¶
| Parameter | Type | Description |
|---|---|---|
name |
string |
Name of the function to invoke (unique within a folder) |
input? |
TInput |
Input for the function, sent as the request body (or as query parameters for functions declared with the Get method). Defaults to an empty object. |
options? |
FunctionInvokeOptions |
Folder scoping (folderId / folderKey / folderPath) and parent job attribution (jobKey) |
Returns¶
Promise<TOutput>
Promise resolving to the function's output
Examples¶
// Invoke a function
const result = await functions.invoke('hello', { name: 'Alice' }, { folderId: <folderId> });
// Typed input and output, attributed to a parent job's licensing transaction
interface SyncInput { since: string }
interface SyncOutput { processed: number }
const result = await functions.invoke<SyncInput, SyncOutput>(
'sync-invoices',
{ since: '2026-01-01' },
{ folderPath: 'Shared/Finance', jobKey: '<parentJobKey>' }
);
console.log(result.processed);