---
schema_version: "1"
id: 4ea9da7776102c0bb9847df17e9c92723b52708b650b517e7c1c830382a8785a
title: Analyzing Documents With Custom User-Defined Schemas
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/idp/analyzing-documents-with-einstein.md
canonical_url: https://docs.mulesoft.com/idp/analyzing-documents-with-einstein
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 6318efe28919ef889069e2fb2793b6fc309601d4ef1d964f9d4344834a72311e
description: MuleSoft Documentation Site
latest: true
---
---
product: IDP
---

# Analyzing Documents With Custom User-Defined Schemas

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Analyze any type of document and fully customize the output structure by creating a Generic document
action and enabling **Customize Schema**. Define the output fields and tables and configure prompt
instructions for Einstein to analyze the document and extract the data.

A _document action_ is a multi-step process that uses multiple AI engines to scan a document, filter
out fields, and return a structured response as a JSON object. Each document action defines the
types of documents it expects as input, the fields to extract, and the fields to filter out from the
response.

Enabling **Customize Schema** reduces the number of requests because IDP queries the entire document
in one prompt, rather than making one request per prompt to Einstein as in a Generic document action
without **Customize Schema** enabled.

You cannot enable **Customize Schema** for existing document actions, you must create a new Generic
document action.

Einstein supports these predictive models:

- OpenAI’s `GPT-4o (gpt-4o)` LLM

- OpenAI’s `GPT-4o Mini (gpt-4o-mini)` LLM

- OpenAI’s `GPT-5.1` LLM

- OpenAI’s `GPT-5.2` LLM

- Google’s `GEMINI-3.5 Flash` LLM

- Anthropic’s `Claude Sonnet 4.6` LLM

- Anthropic’s `Claude Opus 4.6` LLM

> [!WARNING] **Einstein OpenAI GPT-4o and Einstein OpenAI GPT-4o Mini retire January 31, 2027**.
>
> To prevent service interruption, migrate actions to a supported model by January 31, 2027.

Einstein accesses these models through the Salesforce Einstein Trust layer, which is part of the
Salesforce Einstein platform.

Select the model to use during document analysis by clicking **Settings** in the document action
editor.

> [!NOTE] Document actions created before February 5th support only OpenAI’s
> `GPT-4o (gpt-4o-2024-05-13)`. To enable model selection and the new models, create a new document
> action. See [Configure Document Action Settings](#settings) for details about feature availability
> and configuration.

> [!NOTE] Einstein doesn’t use customer data to train any models for document analysis in IDP.

After you create a document action, add reviewers and publish it to Anypoint Exchange. Publishing
the document action enables RPA to execute it and also creates an API that you can call from any
external system to analyze your documents.

> [!WARNING] Do not delete document action assets from Anypoint Exchange. Because the asset is
> discoverable, existing integrations might be using it. Deleting the asset from Exchange breaks
> those integrations and leaves an orphan document action in the IDP UI that is no longer tied to
> any Exchange asset. To retire a document action, see
> [Retire a Document Action](https://docs.mulesoft.com/idp/publishing-document-actions#retire-document-action).

For instructions about using pre-built schemas, see
[Analyzing Documents Using Pre-Built Schemas](https://docs.mulesoft.com/idp/creating-document-actions)

Processing documents consumes Automation Credits. IDP charges Automation Credits per execution,
based on the number of pages in the submitted document, regardless of whether the document was
previously processed. See
[Automation Credits Usage and Rates](https://docs.mulesoft.com/general/automation-credits-usage-and-rates) for details.

> [!IMPORTANT] Resubmitting the same document, retrying a failed or partially failed execution, and
> reprocessing a document all create a new execution. Each of these executions consumes Automation
> Credits in full. IDP doesn’t deduplicate submissions or discount credits for documents that were
> already processed.

## Before You Begin

1.  Ensure you have any of the following Anypoint permissions:

    Manage Actions

    Gives a user complete access to IDP and assigns reviewer permission by default for every
    document action.

    Build Actions

    Enables a user to create, edit, publish, and execute document actions and assign reviewers to
    the actions.

2.  [Enable MuleSoft Anypoint Platform to publish MuleSoft assets to Salesforce](https://help.salesforce.com/s/articleView?id=platform.external_services_manage_your_mulesoft_anypoint_platform_connection.htm&type=5).

3.  [Enable Einstein for Anypoint Platform](https://docs.mulesoft.com/access-management/enabling-generative-ai).

## Create a Generic Document Action and Enable Customize Schema

To analyze documents and fully customize the output structure, create a document action of the
Generic type and enable **Customize Schema**:

1.  In the sidebar, click **Document Actions**.

2.  Click **Create New**.

3.  Select the **Generic** type.

4.  Enable **Customize Schema**.

    By enabling **Customize Schema** you can define fields and tables to create a structured output
    for your analyzed documents. This feature also enables an enhanced preview of the fields and
    tables in the document action builder.

    If **Customize Schema** is disabled, you can still configure Einstein prompts to analyze the
    document. See [Enhancing Data Extraction with Einstein](https://docs.mulesoft.com/idp/enhancing-data-extraction-with-einstein)
    for instructions.

    > [!WARNING] When you create a document action without enabling **Customize Schema**, requests
    > are not optimized and every prompt counts as one API call to the LLM.

5.  Provide a Name and click **Create**.

Next, use AI to discover the data to extract from the document or manually add the fields and tables
to extract.

## Discover Data to Extract from Your Documents with AI

You can use AI to automatically analyze the selected file and create the output.

1.  In the document action builder, click **Select Files** and select the files to use as an example
    or model for the extraction.

2.  In the **Outputs** panel, select **Discover with AI** and click **Next**.

3.  (Optional) Provide instructions in natural language to specify what information to extract.

4.  Click **Discover**.

5.  Click **Save**.

## Manually Add the Fields to Extract

To configure the fields to extract and define the structure of the output document:

1.  In the document action builder, click **Select Files** and select the files to use as an example
    or model for the extraction.

    Skip this step if the example file is already loaded.

2.  In the **Outputs** panel, click **Create Manually**.

3.  Select the **Fields** tab.

4.  Click **Start from Scratch** to add the first field.

5.  Provide a name for the field and a prompt.

    If you don’t configure a prompt, Einstein scans the document and automatically extracts the data
    that better suits the field. However, make sure you test the output to confirm the extracted
    field matches the expected result. Otherwise, configure a prompt to provide Einstein with
    specific instructions about how to populate that field.

6.  Click **Add New** to continue adding fields.

7.  Click **Run** and verify the results of the extraction.

8.  Click **Save**.

## Manually Add the Tables to Extract

To configure data extraction from tables:

1.  In the document action builder, click **Select Files** and select the files to use as an example
    or model for the extraction.

    Skip this step if the example file is already loaded.

2.  In the **Outputs** panel, click **Create Manually**.

3.  Select the **Fields** tab.

4.  Click **Start from Scratch** to add the first table.

5.  Provide a name for the table and a prompt if necessary to configure the data to extract.

6.  Click **Add New Column** and provide a name and prompt for the column.

    - Continue adding columns until the table is complete.

7.  If there are more tables to configure, click **Add New** and repeat the steps to add the table
    columns.

8.  Click **Run** and verify the results of the extraction.

9.  Click **Save**.

After you finish configuring the output schema for your documents, add reviewers and publish your
document action.

> [!NOTE] Some models provide self-reported confidence scores, which become less reliable as the
> document action gets more complex. See
> [Confidence Scores by Model](https://docs.mulesoft.com/idp/supported-models#confidence-scores) for additional information.

## Configure Document Action Settings

After you create a document action, click **Settings** to configure it. The available settings
depend on when you created the document action:

<table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Setting</th><th>Description</th><th>Available From</th><th>Considerations</th></tr></thead><tbody><tr><td><div><div><p><strong>Location callouts</strong></p></div></div></td><td><div><div><p>Show a bounding box around the analyzed value in the document preview.</p></div></div></td><td><div><div><p>March 10th, 2026</p></div></div></td><td><div><div><ul><li><p>Available for Generic document actions with customized schemas.</p></li><li><p>Supported only for Gemini models with Multimodal enabled in the document action.</p></li><li><p>When enabled, confidence score for the field reflects extraction and label geometry.</p></li><li><p>Location callouts support a maximum of 40 fields, including table cells. Each table cell counts as a field. Enable this feature if your document action contains 40 or fewer fields and table cells combined.</p></li><li><p>For the best experience with location callouts, treat every field and table item as a single entity that returns a single value, rather than multiple values or JSON.</p></li></ul></div></div></td></tr><tr><td><div><div><p><strong>Multimodal</strong></p></div></div></td><td><div><div><p>Enables the model to read and interpret images within documents.</p></div></div></td><td><div><div><p>May 8th, 2025</p></div></div></td><td><div><div><ul><li><p>Cannot be used simultaneously with PII masking.</p></li><li><p>Accuracy of checkbox processing varies by model depending on form complexity.</p><div><p>See <a href="https://docs.mulesoft.com/idp/supported-models">Supported Models</a> for more information about how each model performs when processing checkboxes.</p></div></li></ul></div></div></td></tr><tr><td><div><div><p><strong>Model</strong></p></div></div></td><td><div><div><p>Select the predictive large language model (LLM) to use when executing this document action.</p></div></div></td><td><div><div><p>February 5th, 2025</p></div></div></td><td><div><div><p>Choose the model that best fits your document processing needs. See <a href="https://docs.mulesoft.com/idp/supported-models">Supported Models</a> for additional details about each model.</p></div></div></td></tr><tr><td><div><div><p><strong>PII Masking</strong></p></div></div></td><td><div><div><p>Mask personally identifiable information from your documents before sending them to the predictive model.</p></div></div></td><td><div><div><p>February 5th, 2025</p></div></div></td><td><div><div><ul><li><p>Salesforce Organization Preferences override this setting.</p></li><li><p>Reduces character limit to 120,000 per request.</p><div><p>See <a href="https://docs.mulesoft.com/idp/quotas-and-limits#prompt-limits">Prompt Limits</a> for additional details.</p></div></li><li><p>Cannot be used simultaneously with Image Recognition.</p></li><li><p>For more information, see <a href="https://help.salesforce.com/s/articleView?id=ai.generative_ai_trust_layer.htm&amp;type=5">Einstein Trust Layer</a>.</p></li></ul></div></div></td></tr></tbody></table>

> [!NOTE] To access all new features, create a new document action.

## See Also

- [Adding Reviewers](https://docs.mulesoft.com/idp/adding-reviewers)

- [Publishing Document Actions](https://docs.mulesoft.com/idp/publishing-document-actions)

- [Analyzing Documents Using Pre-Built Schemas](https://docs.mulesoft.com/idp/creating-document-actions)

- [RPA Overview](https://docs.mulesoft.com/rpa-home/)
