# Consuming models via a workflow

> You can consume the predictions of a published Unstructured and Complex Documents model version by building a workflow in UiPath Studio.

You can consume the predictions of a published Unstructured and Complex Documents model version by building a workflow in UiPath Studio.

## Overview

Building an IXP Unstructured and Complex Documents workflow generally involves the following steps:

1. Package installation
2. Taxonomy definition
3. Document digitization
4. Document classification
5. Document extraction
6. Document validation

:::note
The taxonomy definition step only applies to Windows projects, not cross-platform ones. To find out the differences between project types, check the sections that follow.
:::

## Prerequisites

You must have a model published in an **Unstructured and Complex Documents** project.

When you start building your Studio workflow, you must decide what type of project you want to run: **Windows** or **Cross-platform**. Each project type requires different packages.

Regardless of the project type you choose, you can install the packages:

* **Automatically** - Use the [Document Understanding Process template](https://docs.uipath.com/document-understanding/automation-cloud/latest/classic-user-guide/du-process). For more details on how to search and install templates in Studio, check [Project templates](https://docs.uipath.com/studio/standalone/latest/user-guide/project-templates).
* **Manually** - For more details, check [Installing packages](https://docs.uipath.com/studio/standalone/latest/user-guide/managing-activities-packages#installing-packages). If you choose to manually install the packages, make sure you install the following versions or newer, based on the project type:

**Windows**
* UiPath.IntelligentOCR.Activities 6.22.0
* UiPath.System.Activities 24.10.6

**Cross-platform**
* UiPath.DocumentUnderstanding.Activities 2.12.0
* UiPath.System.Activities 24.10.6

:::note
* The **IntelligentOCR** package is compatible with Windows projects, not with cross-platform ones.
* You can build cross-platform workflows and use other templates in Studio Web.
:::

## Building an IXP workflow for Windows projects

The sections that follow contain the steps to apply if you choose not to use one of the Studio templates and start from scratch.

To build an IXP workflow for Windows projects, proceed as follows:

:::note
The variable names used in the following sections are just examples. You may name your variables according to your own conventions.
:::

### 1. Installing the packages

Make sure you install the packages mentioned in the Prerequisites section.

### 2. Defining the taxonomy

1. In Studio Desktop, [create a basic process](https://docs.uipath.com/studio/standalone/latest/user-guide/creating-basic-process#creating-a-basic-process).
2. When configuring your process, in the **Compatibility** field, select what type of workflow you want to build: Windows or Cross-platform. For more details, check [About automation projects](https://docs.uipath.com/studio/standalone/latest/user-guide/about-automation-projects).
3. Open **[Taxonomy Manager](https://docs.uipath.com/document-understanding/automation-cloud/latest/classic-user-guide/taxonomy-manager)** from the **Design** tab and set up your table fields as follows:
   * Create a table field for every field group in your IXP project taxonomy.
   * Add a column in the respective table field for each field defined in the field group.

   :::note
   **Taxonomy Manager**:
   * supports creating tables and fields. When you create IXP Unstructured and Complex Documents workflows, it is recommended to create table fields instead of just fields.
   * is available only when the **IntelligentOCR** package is installed. This means that it is only available on Windows projects, not Cross-platform.
   :::
   
4. Next, you must have a location where you can read documents from. For example, in the project folder, create a new folder named **documents**, and add a few files.
5. In the **Sequence**, add an **[Assign](https://docs.uipath.com/studio/standalone/latest/user-guide/the-assign-activity#the-assign-activity)** activity to specify where you want to read documents from. Configure the following fields:
   * **Save to** - Create and add a variable of type **System.String[]**. In this example, the variable is called **docs**.
   * **Value to save** - Add `Directory.GetFiles("./documents")`.

   ![The Assign activity.](https://dev-assets.cms.uipath.com/assets/images/ixp/UCD_The_Assign_Activity-b76886e8.png)

6. Add a **[Load Taxonomy](https://docs.uipath.com/activities/other/latest/document-understanding/load-taxonomy#load-taxonomy)** activity to store the configured taxonomy in a variable to reference it in the rest of the automation. Create and add a variable of type **DocumentTaxonomy**. In this example, the variable is called **taxo**.

   :::note
   You need to map the variable to the output of the activity.
   :::

   ![The Load Taxonomy activity.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-the-load-taxonomy-activity-632128-c2ce95db.webp)

### 3. Digitizing a document
1. Add a **[For Each](https://docs.uipath.com/activities/other/latest/workflow/for-each)** activity to go through each document. For the input, add the **docs** variable you previously created.

   ![The For Each activity.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-the-for-each-activity-632156-a794867c.webp)

2. Drag and drop the following activity within **For Each**:
   * **[Digitize document](https://docs.uipath.com/activities/other/latest/document-understanding/digitize-document#digitize-document)** - Allows you to read the documents you provided and obtain the **Document Object Model (DOM)** output. Configure the following fields:
     + **Document Path** - Add the **doc** variable. You can find the variable in the **Item name** you configured in the **For Each** activity. In this example, the item name is **doc** and represents the file path of the document you want to digitize.
     + **Document Text** - Create and add the **text** variable.
     + **Document Object Model (DOM)** - Create and add the **dom** variable.

        ![The Digitize Document activity.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-the-digitize-document-activity-632151-28366f19.webp)

### 4. Classifying a document
In the same **For Each** activity, after **Digitize Document**, drag and drop the following activity:
* **[Classify Document Scope](https://docs.uipath.com/activities/other/latest/document-understanding/classify-document-scope#classify-document-scope)** - Allows you to classify the document being processed into one of the defined document types in your taxonomy. For the inputs, add the following:
  + **Document Path** - Add the **doc** variable.
  + **Document Text** - Add the **text** variable.
  + **Document Object Model (DOM)** - Add the **dom** variable.
  + **Taxonomy** - Add the **taxo** variable.For the outputs, add the following:
  + **Classification Results** - Create and add a new variable **ClassificationResults**.

    ![The Classify Document Scope activity.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-the-classify-document-scope-activity-637454-0abdc1c1.webp)

In the **Classify Document Scope**, add the **[Generative Classifier](https://docs.uipath.com/activities/other/latest/document-understanding/document-understanding-ml-generative-classifier)** activity to classify documents using generative models. Configure the activity as follows:
    1. Select **Manage Field Details**.
    2. In the **Document Type** column, select a document type.
    3. In the **Field Details** column, add an optional value to define additional details about the document type. This can be a short description of the document type. The maximum number of characters allowed is 1000.
    4. Select **Save**.

  ![The Generative Classifier activity.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-the-generative-classifier-activity-637450-11f73c5f.webp)

:::note
A classification activity is optional if you only have one document type in your taxonomy. You can copy the document type ID and use that as an input to the **Data Extraction Scope** activity.
:::

### 5. Extracting details from a document
1. Drag and drop the following activity within **For Each**:
   * **[Data Extraction Scope](https://docs.uipath.com/activities/other/latest/document-understanding/data-extraction-scope)** - Allows you to configure extractor activities. For the inputs, add the following:
     + **Document Path** – Add the **doc** variable.
     + **Document Text** – Add the **text** variable.
     + **Document Object Model (DOM)** – Add the **dom** variable.
     + **Taxonomy** – Add the **taxo** variable.
     + **Classification Result** – Add the **ClassificationResults** variable.For the output, add the following:
     + **Extraction Results** – Create and add a new variable **ExtractionResults**.
2. Within the **Data Extraction Scope**, add the **[Document Understanding Project Extractor](https://docs.uipath.com/activities/other/latest/document-understanding/du-app-extractor)** activity to extract the document data.

   ![The Data Extraction Scope activity.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-the-data-extraction-scope-activity-632164-23654c55.webp)

When you add the project extractor activity within the scope, the **Get Capabilities** configuration window should open automatically.

   ![The Get Capabilities wizard in Studio.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-the-get-capabilities-wizard-in-studio-635191-bc622225.webp)

3. If the published project is hosted in a different organization or tenant, or is used in a hybrid setup, add the required details in **Get Capabilties** as follows:
   * Create an external application in the Automation Cloud **Admin** page. For more details, check [Adding an external application](https://docs.uipath.com/orchestrator/standalone/2022.4/user-guide/managing-external-applications#adding-an-external-application).
   * Copy the **App ID** and **App Secret**, where the app secret is the password.
   * [Create an Orchestrator asset credential](https://docs.uipath.com/orchestrator/automation-cloud/latest/user-guide/managing-assets-in-orchestrator#creating-assets).
   * In the **Get Capabilities** window, add the credentials, the application ID and secret.
   * Configure the rest of the fields as described in **[Document Understanding Project Extractor](https://docs.uipath.com/activities/other/latest/document-understanding/du-app-extractor)**.

        ![This image shows the Get Capabilities window in Studio.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-this-image-shows-the-get-capabilities-window-in-studio-565452-b250da50.webp)

     :::note
     When you copy the tenant URL, make sure it includes the organization and tenant names. For example, `https://staging.uipath.com/communicationsminingteam/IXPTesting`, where `communicationsminingteam` is the organization, and `IXPTesting` is the tenant.
     :::
   * In the **Document Understanding Project Extractor** activity, add the asset path as input in the **Runtime Credentials Asset** property of the **Document Understanding Project Extractor** activity. The path should be in the form of &lt;OrchestratorFolderName&gt;/&lt;AssetName&gt;.

   ![The Runtime Credentials Asset property of the Document Understanding Project Extractor.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-the-runtime-credentials-asset-property-of-the-document-understanding-project-extractor-634334-256defd3.webp)

4. If the workflow runs in the same organization and tenant where the project was published, select the published project in the **Document Understanding Project Extractor** activity.

   :::note
   The published model appears in the dropdown options if Studio is connected to the same organization or tenant that the model was published in. If the model does not appear, it may be because it is published in a different organization or tenant. In this case, apply the instructions from the section that follows, Consuming predictions from cross-organization, cross-tenant, or hybrid projects.
   :::

5. Select **Configure Extractors** and use the wizard to map your taxonomy fields to the fields defined in the Unstructured and Complex Documents project.
Figure 1. The Studio Configure Extractors wizard

   ![The image shows the Configure Extractors window in Studio.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-the-image-shows-the-configure-extractors-window-in-studio-565434-457cccef.webp)

### 6. Validating a document
Optionally, you can configure decision criteria to determine whether human validation is required for the classification output.
This can be done using custom business rules or post-processing logic. You can also use custom decision criteria in a workflow to trigger validation, or you can set up field-level confidence thresholds. This decision criteria is contingent on the business process requirements and your use case's allowance for false positives, that is results that skip human validation but have been extracted incorrectly.
Based on these rules, you can control whether a document is automatically validated or is routed to human validation. For more details, check the section **Validation settings** in [Establishing the structure](https://docs.uipath.com/document-understanding/automation-cloud/latest/classic-user-guide/taxonomy-manager#establishing-the-structure).

1. Add the **[Present Validation Station](https://docs.uipath.com/activities/other/latest/document-understanding/present-validation-station#present-validation-station)** activity to validate in Validation Station. The output **ExtractionResults** of the **Data Extraction Scope** activity will be the input of the **Present Validation Station** activity. For the input, add the **ExtractionResults** variable. For the output, create and add a new variable **ValidatedExtractionResults**.
2. For the inputs, add the following:
   * **Document Path** – Add the **doc** variable.
   * **Document Text** – Add the **text** variable.
   * **Document Object Model (DOM)** – Add the **dom** variable.
   * **Taxonomy** – Add the **taxo** variable.
   * **Automatic Extraction Results** – Add the **ExtractionResults** variable.
3. For the output, add the following:
   * **Validated Extraction Results** – Create and add a new variable **ValidatedExtractionResults**.

   ![The Present Validation Station activity.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-the-present-validation-station-activity-632170-ae03186c.webp)
        ![The Present Validation Station activity.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-the-present-validation-station-activity-632170-ae03186c.webp)

In this validation step, you can also use other activities than **Present Validation Station**. For example:
* **[Create Validation Artifacts](https://docs.uipath.com/activities/other/latest/document-understanding/create-document-validation-artifacts)** or **[Create App Task](https://docs.uipath.com/activities/other/latest/workflow/create-user-action)** when you have Apps that use the **Content Validation** component.
* **[Create Document Validation Action](https://docs.uipath.com/activities/other/latest/document-understanding/create-document-validation-action)** or **[Wait For Document Validation Action And Resume](https://docs.uipath.com/activities/other/latest/document-understanding/wait-for-document-validation-action-and-resume)** when you want to send the Validation Station to Action Center.

For more details on validation, check the following resources:
* **Validation Station**
  + [Validation Station](https://docs.uipath.com/activities/other/latest/document-understanding/validation-station)
  + [Classic Validation Station](https://docs.uipath.com/activities/other/latest/document-understanding/classic-validation-station)
  + [Compact Validation Station](https://docs.uipath.com/activities/other/latest/document-understanding/compact-validation-station)
* **Apps**
  + [Validating documents with App actions](https://docs.uipath.com/activities/other/latest/document-understanding/validating-documents-with-app-actions)

## Triggering human validation

Human validation of the classification output is triggered by applying decision logic after the classification step, before the workflow proceeds to extraction. The decision is not automatic by default, it is explicitly controlled through confidence thresholds and business rules defined in the workflow.

The following list shows how human validation can be triggered:

1. **Classification confidence evaluation** Each classification result includes confidence scores that indicate how certain the model is about the predicted document type. These scores are evaluated in the workflow to determine whether the classification is reliable.
2. **Confidence thresholds**You can define a minimum confidence threshold for classification. If the confidence score for the predicted document type falls below this threshold, the classification is considered uncertain, and the document is flagged for human validation.
3. **Business rules and conditional logic** In addition to confidence thresholds, you can apply custom business rules, such as:
   * Specific document types that always require manual review.
   * Mismatches between expected and predicted document types.
   * Rules based on how the document will be processed later. For example, documents that must be verified before extraction or approval.
4. **Triggering the validation step** When the defined criteria are met, the workflow routes the document to a human validation step by invoking one of the validation mechanisms:
   * **Present Validation Station** for in-robot validation.
   * **Create Validation Task** for Action Center-based validation.
   * **Create Document Validation Artifacts** for validation in Apps.
5. **Human confirmation or correction**During validation, the human reviewer confirms or corrects the document type. The validated classification result is then used by subsequent steps, such as data extraction, ensuring that downstream processing is based on an approved document type.
To conclude, human validation for classification is triggered by workflow-controlled rules, typically based on confidence scores and business logic, which determine when a classification result requires manual review before the process continues.

## Interpreting Validation Station results from IXP models

When using workflows that leverage models for IXP Unstructured and complex documents, the **Validation Station** serves as a crucial interface for reviewing, confirming, and refining the extracted data. **Validation Station** shows how the model interpreted the document, allowing you to understand the extraction accuracy, identify uncertain areas, and make corrections where needed.

In **Validation Station**, the document type and its corresponding fields are displayed alongside the extracted values and confidence indicators.
For more details on the validation process, check the following resources:
* [Classic Validation Station](https://docs.uipath.com/activities/other/latest/document-understanding/classic-validation-station)
* [Compact Validation Station](https://docs.uipath.com/activities/other/latest/document-understanding/compact-validation-station)

## Comparing Windows and Cross-platform project workflows

The following table shows a comparison between the IXP workflows for Windows and Cross-platform projects:
|                          | Windows | Cross-platform |
|--------------------------|----------|----------------|
| **Packages required**    | **Intelligent OCR** | **Document Understanding** |
| **Defining the taxonomy** | The **Taxonomy Manager** option allows you to define the list of fields that will show in the Validation Station or included in the extraction results object. **Note:** **Taxonomy Manager** is available only when the **Intelligent OCR** package is installed. | The **Document Understanding** package automatically reads and displays the fields defined in the IXP model schema. These fields are not configured through the workflow. |
