Execute
Call Signature¶
execute(
uipath:IUiPath,connectionId:string,objectName:string,method?:ExecuteMethod,options?:ExecuteOptions):Promise<ExecuteResult>
Experimental
Execute an arbitrary HTTP operation against a connection instance through the Integration Service passthrough endpoint.
Warning
Preview: This function is experimental and may change or be removed in future releases.
Targets elements_/v3/element/instances/{connectionId}/{objectName}.
Use this when you need to call a connector's runtime API without going
through a curated SDK method.
Unlike standard SDK methods, this does not throw on non-2xx responses.
The full HTTP envelope (ok, status, body, headers) is returned so
callers can surface connector-specific error bodies.
When an admin remapped this connection id at deployment, the call targets the connection it was mapped to.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
uipath |
IUiPath |
UiPath SDK instance providing authentication and configuration |
connectionId |
string |
Connection GUID |
objectName |
string |
Connector object name (e.g. tickets, messages) |
method? |
ExecuteMethod |
HTTP method (defaults to GET) |
options? |
ExecuteOptions |
Body, query params, folder scoping (folderId / folderKey / folderPath), and robustness knobs (retry, timeoutMs, signal) |
Returns¶
Promise<ExecuteResult>
Promise resolving to an ExecuteResult
Examples¶
import { UiPath } from '@uipath/uipath-typescript/core';
import { execute } from '@uipath/uipath-typescript/connections';
const sdk = new UiPath(config);
await sdk.initialize();
// GET — list records
const result = await execute(sdk, '<connectionId>', 'tickets', 'GET');
if (result.ok) {
console.log(result.body);
} else {
console.error(`Connector returned ${result.status}: ${JSON.stringify(result.body)}`);
}
// POST — create a record
const result = await execute(sdk, '<connectionId>', 'tickets', 'POST', {
body: { subject: 'New ticket', priority: 'high' },
});
// GET with query params and folder scoping — folderId and folderPath work too
const result = await execute(sdk, '<connectionId>', 'tickets', 'GET', {
queryParams: { limit: '10', status: 'open' },
folderPath: 'Shared/Finance',
});
// Retry transient connector failures. Retrying is off unless `maxRetries` is set.
const result = await execute(sdk, '<connectionId>', 'tickets', 'GET', {
timeoutMs: 10_000,
retry: {
maxRetries: 3,
initialDelayMs: 500,
backoffStrategy: 'exponential',
backoffFactor: 2,
retryableStatusCodes: [429, 500, 502, 503, 504],
},
});
// POST is not retried by default — a replay can create the same record twice.
// Opt in only when the connector operation is safe to repeat.
const result = await execute(sdk, '<connectionId>', 'tickets', 'POST', {
body: { subject: 'New ticket' },
retry: { maxRetries: 2, retryMethods: ['POST'] },
});
Call Signature¶
execute(
uipath:IUiPath,connection:ConnectionResource,objectName:string,method?:ExecuteMethod,options?:ExecuteOptions):Promise<ExecuteResult>
Experimental
Execute an arbitrary HTTP operation against a connection declared in
uipath_resources.ts, through the Integration Service passthrough endpoint.
Warning
Preview: This function is experimental and may change or be removed in future releases.
When an admin remapped the connection at deployment, the call targets the connection it was mapped to, in that connection's folder, even when a folder option is passed. Like the id form, this does not throw on non-2xx responses.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
uipath |
IUiPath |
UiPath SDK instance providing authentication and configuration |
connection |
ConnectionResource |
Handle created with resource.connection() from @uipath/uipath-typescript/resources |
objectName |
string |
Connector object name (e.g. tickets, messages) |
method? |
ExecuteMethod |
HTTP method (defaults to GET) |
options? |
ExecuteOptions |
Body, query params, folder scoping (folderId / folderKey / folderPath), and robustness knobs (retry, timeoutMs, signal) |
Returns¶
Promise<ExecuteResult>
Promise resolving to an ExecuteResult
Example¶
// uipath_resources.ts
import { resource } from '@uipath/uipath-typescript/resources';
export class ProjectResources {
static readonly helpdesk = resource.connection({ id: '<connectionId>', connector: 'uipath-zendesk' });
}
// anywhere in the project
import { execute } from '@uipath/uipath-typescript/connections';
const result = await execute(sdk, ProjectResources.helpdesk, 'tickets', 'GET');