Skip to content

feat(integration-service): add execute_activity and execute_http - #2005

Open
chandusailella wants to merge 2 commits into
mainfrom
feat/integration-service-execute-activity-http
Open

chandusailella wants to merge 2 commits into
mainfrom
feat/integration-service-execute-activity-http

Conversation

@chandusailella

Copy link
Copy Markdown

Summary

Adds an integration_service package to uipath-platform, exposed as sdk.integration_service, for parity with the TypeScript SDK (UiPath/uipath-typescript#864). The existing connections package and ConnectionsService have no diff.

Method What it does
execute_activity() Runs one operation on a connector object through a connection.
execute_http() Sends one HTTP request to the vendor behind a connection and returns the vendor's response (status, headers, body, plus is_vendor_error).

Each has an _async form. Both are preview, and neither raises on a non-2xx response: the result carries ok, status, body and headers.

execute_activity

  • Body paths: a top-level body key can be a path, so {"fields.summary": "x"} is sent as {"fields": {"summary": "x"}}. A body with no path key is sent untouched.
  • File upload: files sends the call as a multipart form, with the body as a JSON part.
  • File download: a binary or attachment response is returned as bytes; file_response=True forces it.
  • Paging: the result carries page when more records exist, and max_records follows the pages (-1 for every record).
  • URL inputs: url_input_fields Base64-encodes query parameters that take a URL.
  • A POST, PUT or PATCH sent without a body carries {}.
  • Version 4 engine: with connector_version of 4 or later the call goes to elements_/v4/execute, where object_name (or script_ref) names the activity's script. connector_key is required there, files is refused, and file_response, url_input_fields and max_records do not apply. This part is not in the TypeScript PR yet.

execute_http

  • Uses the version 3 passthrough (elements_/v3/element/instances/{id}/http-request) by default.
  • Uses the version 4 engine (elements_/v4/execute) when the caller passes connector_version of 4 or later. On version 4 the url must be a full URL.
  • Version 4 supports sending a file as the request body (file) and returns a vendor file or large body as bytes.

Retry and folders

  • Retrying is off unless max_retries is set. Only idempotent methods are retried by default; retry_methods opts others in. For execute_http and version 4 activities the setting is matched against the vendor or activity method, since the carrier is always a POST. Only a failure of the Integration Service call is retried.
  • A folder header is sent only when folder_key or folder_path is passed. A deployment-time connection remap is applied through the existing resource_override mechanism.

Layout

  • integration_service/_integration_service.py: the IntegrationService class.
  • 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-platform 0.3.12 → 0.3.13, with both lockfiles.
  • Docs page core/integration_service.md and its nav entry; uipath-platform/CLAUDE.md.

Differences from the TypeScript SDK

  • No plain execute(); execute_activity() covers it.
  • No resource.connection() handle form.
  • The caller supplies connector_version; the SDK does not look it up.

Testing

  • pytest for uipath-platform: passes, including 103 new tests in tests/services/test_integration_service.py. The existing connections tests pass unmodified.
  • ruff check, ruff format --check, mypy src tests: clean.
  • Run by hand, GET only, against a live Slack connection (2.17.3) on an alpha test tenant, before the version 4 activity path was added: execute_activity single page with paging state, max_records across pages, a 400 for an unknown object returned without raising; version 3 execute_http (vendor 200 and 404); version 4 execute_http (JSON); the async forms.
  • Not run live: execute_activity on the version 4 engine, any write, file upload, version 4 binary download, url_input_fields, body paths.

🤖 Generated with Claude Code

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>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 20:45
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Nov 19, 2026
…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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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-platform to 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)}"
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants