> [!CAUTION]
> **Caution** : Document AI Warehouse is deprecated and will no longer be available on Google Cloud after January 16, 2025. To safeguard your data, migrate any documents currently saved in Document AI Warehouse to an alternative like Cloud Storage. Verify that your data migration is completed before the discontinuation date to prevent any data loss. See [Deprecations](https://docs.cloud.google.com/document-warehouse/docs/deprecations) for details.

<br />

> [!WARNING]
>
> **Preview**
>
>
> This feature is
>
> subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the
> [Service Specific
> Terms](https://docs.cloud.google.com/terms/service-terms#1).
>
> Pre-GA features are available "as is" and might have limited support.
>
> For more information, see the
> [launch stage descriptions](https://cloud.google.com/products/#product-launch-stages).

This document describes how to export documents from Document AI Warehouse to the
dataset of a custom document extractor (CDE) in Document AI Workbench.

CDE lets users create document extractors. They import documents into the
processor dataset, then label them before training the model. When users export
selected documents to a CDE's dataset, they can build up the dataset by managing
or searching the documents in Document AI Warehouse.

## Create a CDE in Document AI Workbench

You can find complete instructions on how to create a CDE in [this official
guide](https://docs.cloud.google.com/document-ai/docs/workbench/build-custom-processor). We highlight some
key steps in this guide.

### Create a CDE from the processor list

1. Go to the [**My processors**](https://console.cloud.google.com/ai/document-ai/processors)
   page, and click **Create Custom Processor**:

   ![Step 1](https://docs.cloud.google.com/static/document-warehouse/docs/images/pipeline-ui/workbench_step1.png)
2. Choose **Create Processor** on the **Custom Document Extractor** card:

   ![Step 2](https://docs.cloud.google.com/static/document-warehouse/docs/images/pipeline-ui/workbench_step2.png)
3. Enter a display name and click **Create**:

   ![Step 3](https://docs.cloud.google.com/static/document-warehouse/docs/images/pipeline-ui/workbench_step3.png)

The CDE should be created quickly.

### Set up the dataset of the CDE

1. On the processor details page, click **Set Dataset Location**:

   ![Step 4](https://docs.cloud.google.com/static/document-warehouse/docs/images/pipeline-ui/workbench_step4.png)
2. Specify a bucket path to use to store the documents in the dataset:

   ![Step 5](https://docs.cloud.google.com/static/document-warehouse/docs/images/pipeline-ui/workbench_step5.png)

   It takes a few minutes to finish configuration. Afterward, you can see the
   bucket path and count in the details page:

   ![Step 6](https://docs.cloud.google.com/static/document-warehouse/docs/images/pipeline-ui/workbench_step6.png)

   You need the processor ID above to trigger the export-to-
   Workbench pipeline.

## Trigger the export-to-Workbench pipeline

1. Select documents to export and click **Export to Document AI Workbench** on the
   action bar:

   ![Step 7](https://docs.cloud.google.com/static/document-warehouse/docs/images/pipeline-ui/workbench_step7.png)

   > [!NOTE]
   > **Note:** Currently, the maximum number of selected documents is **3,000** . If the number of documents in the search results exceeds 3,000, **Select All
   > Search Results** is disabled. Refine your search or filter criteria to reduce the amount of documents in the search results.

2. Enter input parameters and trigger the pipeline by copying the processor ID
   from the CDE and pasting it in the dialog.

   You need a staging bucket path to temporarily store the documents before
   exporting them. **Data split** lets users randomly put the document into a
   training or test set. The ratio of the splits is based on this value.

   ![Step 8](https://docs.cloud.google.com/static/document-warehouse/docs/images/pipeline-ui/workbench_step8.png)

   By clicking **Export**, the pipeline job is triggered.
3. Track status.

   After triggering the pipeline, a status tracking page appears. Currently,
   the page does not have in-progress tracking. The status page shows pending
   until the job is complete.

   ![Step 9](https://docs.cloud.google.com/static/document-warehouse/docs/images/pipeline-ui/workbench_step9.png)
4. Examine results.

   1. After the job is completed, you can see the successful documents and
      failed documents.

      ![Step 10](https://docs.cloud.google.com/static/document-warehouse/docs/images/pipeline-ui/workbench_step10.png)
   2. To check if the documents are exported correctly, go back to the CDE's
      details page:

      ![Step 11](https://docs.cloud.google.com/static/document-warehouse/docs/images/pipeline-ui/workbench_step11.png)
   3. If you have the page open before the pipeline execution, refresh it to
      find the updated statistics. The training and test set distributions are
      based on the data-split ratio.

   4. To see the documents in detail, go to the **Train** tab:

      ![Step 12](https://docs.cloud.google.com/static/document-warehouse/docs/images/pipeline-ui/workbench_step12.png)

## Next step

Check out more information about the [runPipeline
API](https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/projects.locations/runPipeline).