---
title: "Use AI in your workflow to extract, validate, or analyze data"
canonical_url: "https://www.nutrient.io/guides/workflow-automation/admin-guide/processes/tasks/integration-task/integration-task-ai-data-extraction/"
md_url: "https://www.nutrient.io/guides/workflow-automation/admin-guide/processes/tasks/integration-task/integration-task-ai-data-extraction.md"
last_updated: "2026-05-23T00:08:18.199Z"
description: "Use the AI Data Extraction task type to extract data from documents with AI services such as OpenAI and Claude. This task type processes data in the background for use anywhere in your workflow."
---

# Use AI in your workflow to extract, validate, or analyze data

Use the **AI Data Extraction** task type to extract data with AI services such as OpenAI, Claude, etc. This task type processes data in the background so it can be used anywhere in your workflow.

This feature involves large language models (LLMs). While LLMs are powerful, they can occasionally generate inaccurate or fabricated information (hallucinations). Always test your prompts with sample documents to ensure high-quality results.

## Prerequisites

Complete the [common AI configurations](https://www.nutrient.io/guides/workflow-automation/ai-capabilities-in-workflow/common-ai-configurations.md) guide before proceeding.

## Workflow overview

Below is a simplified workflow for using the AI Data Extraction task.

1. **Design your process**

   Create a workflow process with forms that include file upload fields and target fields for extracted data.

2. **Add and configure the AI Data Extraction task**
   - Add the AI Data Extraction task to your process.
   - Select the AI provider connection.
   - Add a custom prompt describing what to extract.
   - Configure prefills to reference uploaded documents.
   - Test with **Test with response values** disabled first to see what the AI extracts from the prompt.
   - Configure **Response Values** and select only the **AI Response Field** entries you need.
   - Test again with **Test with response values** turned on to confirm extraction is limited to mapped values.

## Step 1: Design your workflow process

**Steps:**

1. **Create initial form task**
   - Add a form task where users can upload documents.
   - Include file attachment fields for documents to be processed.
   - Add any other input fields needed for the workflow.

2. **Add target forms for extracted data**
   - Create forms with fields that will hold the AI-extracted data.
   - For example, if extracting invoice information, include fields such as:
     - Invoice Number
     - Due Date
     - Customer Name
     - Payment Terms
     - Total Amount

3. **Design process flow**
   - Connect your tasks in the desired sequence.
   - Plan where the AI Data Extraction task will fit in your process flow.

Forms are just one example. Data extracted by the AI Data Extraction task can be used in any subsequent task in the workflow.

## Step 2: Add and configure the AI Data Extraction task

**Steps:**

1. **Add the task to your process**
   - In the process designer, add a new AI Data Extraction task to your workflow.

2. **Configure AI settings**
   - Right-click on the AI Data Extraction task > **Configuration** > **Configure Task** to open configuration.
   - In the **Settings** tab, under **AI Settings**:
     - Select the **AI Connection** created in [common AI configurations](https://www.nutrient.io/guides/workflow-automation/ai-capabilities-in-workflow/common-ai-configurations.md) (required to save the task).
     - The selected provider and model are displayed.
     - If a connection is flagged as using a deprecated model, update it in **AI Sources** before finalizing task configuration.
     - Workflow may display a warning if the selected model is less reliable for this task type.

3. **Create the prompt with prefills**

   Set the prompt. This instruction tells the AI what to extract and is essential for accurate results.

   - Enter a prompt describing the information needed.
   - Specify the exact fields expected in the response, and describe each field for better results.

   **Adding document references**
   To reference uploaded documents from previous tasks, use prefills:

   - Click **Add prefills to Prompt**.
   - Select the task and field containing the uploaded document.
   - The picker inserts the correct reference token into your prompt automatically. Don’t type prefill tokens manually — they contain unique internal identifiers for each task and field.

     An example prompt might be:

     ```

     Extract the following from the attached invoice:
     1. Title — The title or subject line of the invoice.
     2. Customer Name — The name of the billed customer or company.
     3. Summary — A 1–2 paragraph overview of the items or services invoiced.
     4. Invoice Number — The unique identifier assigned to this invoice.

     Document to process:
     <inserted via Add prefills to Prompt>
     ```

   - Nutrient Workflow Automation processes responses automatically. Focus your prompt on the business information you need to capture.
   - Large language models might guess or invent information not found in the source document. If precision is critical, add a disclaimer such as: **Only provide information you are 100 percent sure about. If you are unsure or the data is not in the document, respond with "Not available."**

4. **Configure advanced settings** (optional)

   Fine-tune AI behavior such as temperature, token limits, and stop sequences. See the [advanced AI settings](https://www.nutrient.io/guides/workflow-automation/ai-capabilities-in-workflow/advanced-settings.md) guide for details.

   - **Retry on Error** — Enable this to automatically retry processing when the AI provider returns an error (such as a timeout or rate limit).
   - **Max Retries** — The number of retry attempts when an error occurs. Only applies when **Retry on Error** is enabled.

5. **Test the configuration**

   Test your AI configuration before deploying:

   1. In the **Test the prompt** section, set **Test Prefill Values**.
   2. For file-attachment prefills, upload sample documents.
   3. Click **Run Test** to execute the test.
   4. Use **Test with response values** in this order:
      - **Disabled first** — See what fields the AI extracts from your prompt.
      - Configure **Response Values** and select only required **AI Response Field** entries.
      - **Enabled next** — Confirm the result is restricted to the mapped values you need.
   5. Review the test output and refine the prompt and response values if needed.

## Step 3: Configure response values

Use **Response Values** to define which fields the AI should return and how those values are stored for downstream tasks.

**Steps:**

1. **Open the Response Values tab**

   Click **Response Values** in task configuration.

2. **Add response values**

   For each field you want to extract:

   1. Click **Add**.
   2. **Key**: Unique identifier for this output.
   3. **Label**: Display name shown in mapping/prefill pickers.
   4. **AI Response Field**: Field name expected from AI output.
   5. **Data Type**: String, Number, Date, or File Attachment.

   **Example values**

   - Key — `invoice_number`, AI Response Field — `invoice_number`, Data Type — String
   - Key — `total_amount`, AI Response Field — `total_amount`, Data Type — Number
   - Key — `invoice_date`, AI Response Field — `invoice_date`, Data Type — Date

   When response values are configured, Workflow handles the extraction behavior automatically based on the selected model.

3. **Configure file-attachment outputs** (optional)

   For extracted files or generated documents:

   - Set **Data Type** to **File Attachment**.
   - Set **Filename** (fixed value or mapped from AI output).
   - Ensure the AI response contains base64 file content for the attachment value.

## Step 4: Use extracted data in subsequent tasks

Once the AI Data Extraction task completes, use the extracted data in subsequent form tasks.

**Steps:**

1. **Create follow-up form tasks**

   Add form tasks after the AI Data Extraction task with fields for the extracted data.

2. **Configure prefills in forms**

   In your form fields, set up prefills to populate with extracted data:

   1. Right-click the Form task > **Configuration** > **Configure Task** to open configuration.
   2. Go to the **PREFILL SETTINGS** tab.
   3. Edit 🖊️ each field to prefill with the extracted data from the AI
      - **Source** — Select Data
      - **Task** — Select your AI Data Extraction task
      - **Field** — Select the corresponding response output label defined in Step 3

      **Example**

      - Invoice Number field prefilled with `Invoice Number` output
      - Total Amount field prefilled with `Total Amount` output

## Step 5: Deploy and monitor

**Steps:**

1. **Test end to end**

   Run a complete test of your workflow:

   - Submit documents through the initial form.
   - Monitor the AI Data Extraction task execution.
   - Verify extracted data appears correctly in subsequent forms.

## Tips and best practices

- **Provide clear instructions** — Write concise, direct prompts for better results.

- **Validate the AI output** — Confirm the AI response includes the required fields and expected values.

- **Refine iteratively** — Small changes in prompt wording can produce significantly different results.

- **Watch for hallucinations** — AI may sometimes provide information not present in a document. If this occurs, reinforce instructions to omit any unverified content.
---

## Related pages

- [Configure a Database Push task](/guides/workflow-automation/admin-guide/processes/tasks/integration-task/integration-task-database-push.md)
- [Configure a Database Pull task](/guides/workflow-automation/admin-guide/processes/tasks/integration-task/integration-task-database-pull.md)
- [Optimize your processes with AWS Lambda integration](/guides/workflow-automation/admin-guide/processes/tasks/integration-task/integration-task-lambda.md)
- [Configure REST client for web service integration](/guides/workflow-automation/admin-guide/processes/tasks/integration-task/integration-task-rest-client.md)
- [Configure a Web Service task](/guides/workflow-automation/admin-guide/processes/tasks/integration-task/integration-task-web-service.md)
- [Effortlessly upload files to SharePoint via Lambda](/guides/workflow-automation/admin-guide/processes/tasks/integration-task/upload-file-to-sharepoint.md)

