Repository navigation
feat(integration-service): add execute_activity and execute_http - #2005
Open
chandusailella wants to merge 2 commits into
Open
chandusailella wants to merge 2 commits into
chandusailella wants to merge 2 commits into
Conversation
Add an `integration_service` package to uipath-platform, exposed as `sdk.integration_service`, for parity with the TypeScript SDK (UiPath/uipath-typescript#864). - execute_activity: run a connector object operation, with body keys as paths, multipart file upload, file download as bytes, paging (`page` / `max_records`) and Base64 URL query fields. A connector of version 4 or later runs on the version 4 engine. - execute_http: send a raw HTTP request to the vendor behind a connection, through the version 3 passthrough or the version 4 engine. Neither raises on a non-2xx response. Both have async forms. The existing connections service is not changed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e inputs - execute_activity refuses an object_name with a '.' or '..' segment, and both methods refuse a connection_id of '.' or '..', so a call cannot be resolved off the connection it names. - The trace of an execute call records an allowlist of arguments. The body, headers, query parameters and files are left out, and the execute_http URL is recorded without its query string or credentials. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved defects can overwrite nested request data, mutate caller inputs, incorrectly signal more pages, and place query parameters inside URL fragments where they are not sent to the server.
4 open issues
What changed in this PR
Adds a preview sdk.integration_service API to the UiPath Python SDK for connector activities and vendor HTTP requests, while leaving connection management unchanged.
Changes:
- Adds synchronous and asynchronous execution through the version 3 and version 4 engines.
- Supports body paths, file transfers, pagination, opt-in retries, and folder handling.
- Adds tests and documentation, and bumps
uipath-platformto 0.3.13.
| File | Description |
|---|---|
packages/uipath/uv.lock |
Updates the platform package version. |
packages/uipath/mkdocs.yml |
Adds Integration Service navigation. |
packages/uipath/docs/core/integration_service.md |
Adds generated API documentation. |
packages/uipath-platform/uv.lock |
Updates the platform package version. |
packages/uipath-platform/tests/services/test_integration_service.py |
Tests execution, helpers, and SDK exposure. |
packages/uipath-platform/src/uipath/platform/integration_service/execution/_v4_execute.py |
Builds version 4 requests and decodes responses. |
packages/uipath-platform/src/uipath/platform/integration_service/execution/_url_input.py |
Encodes URL-valued query parameters. |
packages/uipath-platform/src/uipath/platform/integration_service/execution/_response_content.py |
Reads JSON, text, and binary responses. |
packages/uipath-platform/src/uipath/platform/integration_service/execution/_request.py |
Defines requests, endpoints, and method checks. |
packages/uipath-platform/src/uipath/platform/integration_service/execution/_proxy_response.py |
Handles version 3 HTTP passthrough. |
packages/uipath-platform/src/uipath/platform/integration_service/execution/_pagination.py |
Handles paging tokens and gathered results. |
packages/uipath-platform/src/uipath/platform/integration_service/execution/_multipart.py |
Builds multipart uploads. |
packages/uipath-platform/src/uipath/platform/integration_service/execution/_body_paths.py |
Expands body paths into nested structures. |
packages/uipath-platform/src/uipath/platform/integration_service/execution/__init__.py |
Exports execution helpers. |
packages/uipath-platform/src/uipath/platform/integration_service/execution_types.py |
Defines file, response, and paging models. |
packages/uipath-platform/src/uipath/platform/integration_service/_integration_service.py |
Implements public execution APIs and transport logic. |
packages/uipath-platform/src/uipath/platform/integration_service/__init__.py |
Exports the service and public models. |
packages/uipath-platform/src/uipath/platform/_uipath.py |
Exposes sdk.integration_service. |
packages/uipath-platform/pyproject.toml |
Bumps the package to 0.3.13. |
packages/uipath-platform/CLAUDE.md |
Documents the service and package layout. |
Review effort: Balanced
Comment on lines
+25
to
+26
| output: Dict[str, Any] = {} | ||
| for key, value in body.items(): |
Comment on lines
+94
to
+95
| # A list value replaces the whole list | ||
| if isinstance(value, list): |
| """ | ||
| has_more = header_value(headers, HAS_MORE_HEADER) | ||
| next_page_token = header_value(headers, NEXT_PAGE_TOKEN_HEADER) | ||
| if not has_more or not next_page_token or not isinstance(body, list): |
Comment on lines
+44
to
+45
| separator = "&" if "?" in url else "?" | ||
| return f"{url}{separator}{urlencode(query_params)}" |
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
Adds an
integration_servicepackage touipath-platform, exposed assdk.integration_service, for parity with the TypeScript SDK (UiPath/uipath-typescript#864). The existingconnectionspackage andConnectionsServicehave no diff.execute_activity()execute_http()status,headers,body, plusis_vendor_error).Each has an
_asyncform. Both are preview, and neither raises on a non-2xx response: the result carriesok,status,bodyandheaders.execute_activity
{"fields.summary": "x"}is sent as{"fields": {"summary": "x"}}. A body with no path key is sent untouched.filessends the call as a multipart form, with the body as a JSON part.bytes;file_response=Trueforces it.pagewhen more records exist, andmax_recordsfollows the pages (-1for every record).url_input_fieldsBase64-encodes query parameters that take a URL.POST,PUTorPATCHsent without a body carries{}.connector_versionof 4 or later the call goes toelements_/v4/execute, whereobject_name(orscript_ref) names the activity's script.connector_keyis required there,filesis refused, andfile_response,url_input_fieldsandmax_recordsdo not apply. This part is not in the TypeScript PR yet.execute_http
elements_/v3/element/instances/{id}/http-request) by default.elements_/v4/execute) when the caller passesconnector_versionof 4 or later. On version 4 theurlmust be a full URL.file) and returns a vendor file or large body asbytes.Retry and folders
max_retriesis set. Only idempotent methods are retried by default;retry_methodsopts others in. Forexecute_httpand version 4 activities the setting is matched against the vendor or activity method, since the carrier is always aPOST. Only a failure of the Integration Service call is retried.folder_keyorfolder_pathis passed. A deployment-time connection remap is applied through the existingresource_overridemechanism.Layout
integration_service/_integration_service.py: theIntegrationServiceclass.integration_service/execution_types.py: result and file models.integration_service/execution/: pure helpers, one module per concern (body paths, multipart, pagination, URL inputs, response content, version 3 passthrough, version 4 engine), mirroring the TypeScript SDK's folder.Other changes
uipath-platform0.3.12 → 0.3.13, with both lockfiles.core/integration_service.mdand its nav entry;uipath-platform/CLAUDE.md.Differences from the TypeScript SDK
execute();execute_activity()covers it.resource.connection()handle form.connector_version; the SDK does not look it up.Testing
pytestforuipath-platform: passes, including 103 new tests intests/services/test_integration_service.py. The existing connections tests pass unmodified.ruff check,ruff format --check,mypy src tests: clean.execute_activitysingle page with paging state,max_recordsacross pages, a 400 for an unknown object returned without raising; version 3execute_http(vendor 200 and 404); version 4execute_http(JSON); the async forms.execute_activityon the version 4 engine, any write, file upload, version 4 binary download,url_input_fields, body paths.🤖 Generated with Claude Code