# Consuming models via automations

> Consume the predictions of IXP models built in Flow Extract nodes in UiPath Studio™, using the Document Understanding activities in Studio Web and Studio Desktop.

In Maestro Flow, the **Extract** node runs the model as part of your flow, and downstream nodes consume the output of the node.

To consume the model outside of Flow, in a UiPath Studio™ workflow, use the Document Processing activity packages, as described in the following sections.

## Prerequisites

* An IXP model built in an **Extract** node within a solution, deployed to a folder. For details, refer to [Deploying models](deploying-models.md).
* One of the activity packages for the activities that you use, in the following versions or newer:
  * **UiPath.DocumentUnderstanding.Activities 3.6.0-preview** - for cross-platform and Windows RPA workflows.
  * **UiPath.IntelligentOCR.Activities 7.6.0-preview** - for Windows RPA workflows.

:::note
Choose one of the two packages, they are not compatible to be used within the same workflow.
:::

## Consuming models using the UiPath.DocumentUnderstanding.Activities package

Use the [Extract Document Data](https://docs.uipath.com/activities/other/latest/document-understanding/extract-document-data) activity in an RPA workflow to extract data with the model of an **Extract** node. Optionally, add a [Create Validation Task](https://docs.uipath.com/activities/other/latest/document-understanding/document-understanding-create-document-validation-action) activity to send the extraction results for human review in Action Center.

![An RPA workflow in Studio Web, with the Extract Document Data and Create Validation Task activities highlighted.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-sw-workflow-ccfb1685.webp)

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

To extract data with the model of an **Extract** node, proceed as follows:

1. Open or create an RPA workflow in a project/solution. 
2. Add the [Extract Document Data](https://docs.uipath.com/activities/other/latest/document-understanding/extract-document-data) activity to your workflow.
3. In the **Input** field, add the file to process. For example, select **Create variable**, and create a variable of type **File**. In this example, the variable is called **doc**. 
4. If you are editing a project not part of a solution, or if you do not want to use solution resources (you intentionally switch the **Use Solution Resources** flag to off), then: 
  a. From the **Project** dropdown list, select the IXP model of your **Extract** node. The models of **Extract** nodes are listed by the name of the node, for example, **Extract document (Preview)**.

   ![The Document Understanding project dropdown list in Studio Web, with the model of an Extract node highlighted.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-sw-select-extract-node-model-0104e957.webp)

  b. Select the **Version** and the **Document type** of the model.

   ![The Extract Document Data activity in Studio Web, with the Input, Document Understanding project, Version, and Document type fields highlighted.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-sw-extract-document-data-b3394435.webp)

5. Otherwise, if you are editing a project part of a solution, and you choose to use Solution Resources (you leave the flag set to ON). Then, from the **IXP Model** dropdown list, select the IXP model of your **Extract** node. 
6. In the **Output** section, check the **Document data** variable, which stores the extraction results. UiPath Studio creates this variable automatically.

For details on all the fields of the activity, check [Extract Document Data](https://docs.uipath.com/activities/other/latest/document-understanding/extract-document-data).

:::note
If the model is in a different organization or tenant, set the "Use Solution Resources" check to OFF and configure the following fields in the **External connection** section, and then select **Connect to tenant**:
   * **Credentials Asset** - The Orchestrator credentials asset path, in the format `<orchestratorFolder>/<assetName>`.
   * **Tenant URL** - The URL of the tenant, in the format `https://<base_url>/<organization>/<tenant>`.
:::

   ![The Output and External connection sections of the Extract Document Data activity in Studio Web, highlighted.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-sw-extract-document-data-output-4cd7155b.webp)

To use the extraction results in the next activities of the workflow, use the output variable of the **Extract Document Data** activity from the list of variables, and navigate to the information of interest as per the activity documentation.

![The list of variables in Studio Web, with the outputs of the Extract Document Data activity highlighted.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-sw-extract-document-data-variables-10132b1d.webp)

## Consuming models using the UiPath.IntelligentOCR.Activities package

In Windows projects in Studio Desktop, you can use the [Document Understanding Project Extractor](https://docs.uipath.com/activities/other/latest/document-understanding/du-app-extractor) activity of the **IntelligentOCR** package, within a [Data Extraction Scope](https://docs.uipath.com/activities/other/latest/document-understanding/data-extraction-scope) activity.

### Defining the taxonomy in Studio

The **IntelligentOCR** document processing framework requires a taxonomy to be defined in **Taxonomy Manager**. 

To define the taxonomy, proceed as follows:

1. Open [Taxonomy Manager](https://docs.uipath.com/document-understanding/automation-cloud/latest/classic-user-guide/taxonomy-manager) from the **Design** tab.
2. Define the taxonomy in one of the following ways:
   * Import the taxonomy - In **Taxonomy Manager**, select the **Import from IDP projects** icon, and then select the published **Extract** node of your flow. Select the available version and the target document type, select a name you wish to use for that document type in your automation taxonomy, then hit **Import**.

     ![Taxonomy Manager in Studio Desktop, with the Import from IDP projects icon and its tooltip highlighted.](https://dev-assets.cms.uipath.com/assets/images/ixp/ixp-flow-sd-taxonomy-manager-import-b07788f3.webp)

   * Create the taxonomy manually - Set up your field groups and tables:
     * Create a field group or table field that you want to capture data from the **Extract** node in.
     * Add child fields or columns in the respective parent field for each field you need in your automation and is available in your model.

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

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

### Extracting the data

To consume the model, proceed as follows:

1. Add a [Data Extraction Scope](https://docs.uipath.com/activities/other/latest/document-understanding/data-extraction-scope) activity to your workflow. For the **Taxonomy** input, add the **taxo** variable.
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. The **Get Capabilities** configuration window opens.

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

   ![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 workflow is part of a solution, the **Use Solution Resource** should be enabled, and then select your model.
4. If the workflow is not part of a solution, or your model is not in the same tenant, select your model from the **Project** dropdown list. Then, select the version, the tag, and select **Get Capabilities**.
   
     ![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)

5. Select **Configure Extractors**, and use the wizard to map your taxonomy fields to the fields defined in the taxonomy of the **Extract** node.

   ![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)

## Validating the extracted data

Optionally, route the extraction results to human validation. Use one of the following activities, depending on the activity package of choice and validation task type: 
* [Present Validation Station](https://docs.uipath.com/activities/other/latest/document-understanding/present-validation-station#present-validation-station) - attended robot validation task.
* [Create Validation Task](https://docs.uipath.com/activities/other/latest/document-understanding/document-understanding-create-document-validation-action) and [Wait for Validation Task and Resume](https://docs.uipath.com/activities/other/latest/document-understanding/wait-for-document-validation-task-and-resume), or [Create Validation Task and Wait](https://docs.uipath.com/activities/other/latest/document-understanding/create-validation-task-and-wait) - Document Validation task in Action Center, after the [Extract Document Data](https://docs.uipath.com/activities/other/latest/document-understanding/extract-document-data) activity.
* [Create Document Validation Action](https://docs.uipath.com/activities/other/latest/document-understanding/create-document-validation-action) and [Wait For Document Validation Action And Resume](https://docs.uipath.com/activities/other/latest/document-understanding/wait-for-document-validation-action-and-resume) - Document Validation task in Action Center, after the **Data Extraction Scope** activity.
* [Create Document Validation Artifacts](https://docs.uipath.com/activities/other/latest/document-understanding/create-document-validation-artifacts) and [Create App Task](https://docs.uipath.com/activities/other/latest/workflow/create-user-action) - Low-code or coded app tasks in Action Center that use Document Validation components, paired with their counterparts, **Wait for App Task** and **Retrieve Document Validation Artifacts**.

For details on validation, check the following resources:

* [Validation Station](https://docs.uipath.com/activities/other/latest/document-understanding/validation-station)
* [Compact Validation Station](https://docs.uipath.com/activities/other/latest/document-understanding/compact-validation-station)
* [Validating documents with App actions](https://docs.uipath.com/activities/other/latest/document-understanding/validating-documents-with-app-actions)
