Skip to content

feat(documents): support DU Framework v2 behind the DocumentsFrameworkV2 flag - #1929

Open
alexandrujircan wants to merge 5 commits into
mainfrom
feat/documents-framework-v2
Open

alexandrujircan wants to merge 5 commits into
mainfrom
feat/documents-framework-v2

Conversation

@alexandrujircan

@alexandrujircan alexandrujircan commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

DocumentsService supports DU Framework API v2 next to v1.1:

  • v1.1 stays the default. Existing consumers see no change.
  • v2 is opt-in through the DocumentsFrameworkV2 feature flag:
    • per job or locally: UIPATH_FEATURE_DocumentsFrameworkV2=true
    • from code or an upstream runtime: FeatureFlags.configure_flags({"DocumentsFrameworkV2": True})
  • The flag reaches every path, including UiPath().documents and the HITL resume triggers. It is read once per service instance, so an operation and the resume of a suspended one use the same version.

Changes:

  • on v2, tag routes use the projects/{id}/tags/{tag}/... shape and allowChangeOfDocumentType goes inside the validation configuration
  • responses are accepted in camelCase or PascalCase. v2 returns PascalCase for orgs that have du-enable-v2-pascal-case-responses on. Document Processing payloads (ExtractionResult, ClassificationResult) are passed through unchanged
  • URL path segments are percent-encoded, so a tag supplied by a user or an LLM cannot add path segments
  • each route family has one helper that picks the versioned or the tagged route, shared by the sync and async methods
  • FieldType gains FieldGroup and MonetaryQuantity, both returned by IXP v2
  • uipath-platform 0.2.34 → 0.2.35

Method signatures and return types are unchanged, and DocumentsService.__init__ keeps its parameters.

What changes with the flag on

These come from the Framework v2 contract:

  • field IDs are prefixed with the document type or group, e.g. Invoices.name, Default.Invoice.InvoiceNumber. Look fields up by FieldName, which is unchanged
  • IXP results use FieldGroup instead of Table → Header/Body: rows sit directly under the group
  • IXP fields are typed (Number, Date, MonetaryQuantity) instead of Text everywhere, so some values are formatted differently, e.g. 1 → 1.00
  • data_projection has one entry per row, as on v1.1
  • Validation Station opens in Compact mode instead of Classic

Framework dependency

  • v2 relies on UiPath/DU-App#38074 for data_projection to contain every row of a field group, both after extraction and after validation.
  • Automation Suite 26.10 needs that fix cherry-picked to release/service-fabric-26.10.

Downstream consumers

All stay on v1.1 until they turn the flag on.

Before opting in:

  • Agent Builder (uipath-agents → uipath-langchain):
    • the IXP extraction tool sends data_projection to the LLM
    • the VS escalation tool returns the validated data_projection
    • both work on v2, which keeps one entry per row
  • vertical-solution-invoice-processing and the FDE Amgen script read data_projection one entry per row, which v2 keeps.
  • fins-vertical-solution (automation_functions/utils/extraction_helpers.py) walks the v1 Table → Body tree in results_document. It needs an update before turning the flag on.
  • UiPath-WorkFusion calls six private DocumentsService methods and checks their signatures at startup. None of them change here.

Testing

  • Unit tests:
    • the existing suite runs with the flag on and covers v2: URL and body shapes, PascalCase responses, IXP v2 FieldGroup/MonetaryQuantity results, and tag percent-encoding
    • a v1.1 suite covers the default: tag routes for classification, extraction, both validations and the IXP retrieves; the top-level allowChangeOfDocumentType; and how the flag is resolved (env var, programmatic config, default)
    • each suite fails when the other API version is forced
  • uipath-platform: 1797 passed, ruff clean, mypy clean
  • Live on an alpha tenant with PascalCase responses on, in both modes:
    • classify and extract on Pretrained, Modern (tag and version) and IXP (tag and version)
    • IXP start and retrieve
    • reading an IXP validation task
  • Also with the flag on:
    • IXP extraction validation, and Modern classification validation by tag
    • IXP bench documents, where every row reached data_projection: 8 monetary amounts, 16 transactions, 23 wells, 13 item components

🤖 Generated with Claude Code

- send api-version=2.0 and use the v2 tags/{tag} routes
- read PascalCase responses, which v2 returns for orgs with
  du-enable-v2-pascal-case-responses on
- percent-encode URL path segments, so a tag cannot change the route
- send allowChangeOfDocumentType inside the validation configuration
- add the FieldGroup and MonetaryQuantity field types returned by IXP v2

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 09:43
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Oct 7, 2026

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.

Copilot review overview

🟡 Changes recommended

The downstream packages/uipath/uv.lock remains pinned to 0.2.34 and can break its propagated locked CI job.

Review effort: Balanced
Findings: 1 High severity · 1 Low severity

Open (2)
What changed in this PR

Migrates DocumentsService to DU Framework v2 while preserving existing APIs.

Changes:

  • Updates v2 routes, response casing normalization, and URL encoding.
  • Adds v2 field types and validation configuration.
  • Expands tests and bumps the package version.
File Description
packages/​uipath-platform/​src/​uipath/​platform/​documents/​_documents_service.py Implements Framework v2 requests and normalization.
packages/​uipath-platform/​src/​uipath/​platform/​documents/​documents.py Adds v2 field types and documentation.
packages/​uipath-platform/​tests/​services/​test_documents_service.py Updates and expands v2 coverage.
packages/​uipath-platform/​tests/​services/​tests_data/​documents_service/​ixp_extraction_response_v2.json Adds an IXP v2 response fixture.
packages/​uipath-platform/​pyproject.toml Bumps the package version.
packages/​uipath-platform/​uv.lock Updates the local locked package version.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/uipath-platform/pyproject.toml Outdated
Comment thread packages/uipath-platform/src/uipath/platform/documents/documents.py Outdated
… async

- pick versioned or tagged routes in one helper per route family instead of
  repeating the branch in every sync and async method
- share the operation status check between the sync and async retrieve
- regenerate the uipath lockfile for uipath-platform 0.2.35
- document that field IDs are prefixed by document type and field group

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@uipathepixa-dogfood

uipathepixa-dogfood Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Epixa-Dogfood Review

Review unavailable: required_pr_review_evidence_unavailable

Not reviewed: packages/uipath-platform/pyproject.toml, packages/uipath-platform/src/uipath/platform/documents/_documents_service.py, packages/uipath-platform/src/uipath/platform/documents/documents.py +4 more

What this PR does

The pull request author describes the intended change as follows: feat(documents): move the documents service to DU Framework v2

This review did not reuse a local review of this change. Set up Epixa local review.

Full review: adc6e05 0 findings

…kV2 flag

- call Framework API v1.1 by default, and v2 when the DocumentsFrameworkV2
  feature flag is on, e.g. UIPATH_FEATURE_DocumentsFrameworkV2=true
- read the flag once per service instance, so one operation and the resume of
  a suspended one use the same API version
- route tags and allowChangeOfDocumentType per API version

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@alexandrujircan alexandrujircan changed the title feat(documents): move the documents service to DU Framework v2 feat(documents): support DU Framework v2 behind the DocumentsFrameworkV2 flag Oct 12, 2026
alexandrujircan and others added 2 commits October 12, 2026 12:25
0.2.35 was released from main in the meantime.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🚨 Heads up: uipath-integrations cross-tests are FAILING 🚨

Your changes may break one or more integrations in uipath-integrations-python:

  • uipath-openai-agents
  • uipath-google-adk
  • uipath-agent-framework
  • uipath-llamaindex
  • uipath-pydantic-ai

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

@github-actions

Copy link
Copy Markdown

🚨 Heads up: uipath-langchain cross-tests are FAILING 🚨

Your changes may break the uipath-langchain-python integration.

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

@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