# Run Extractor

The `Run Extractor` activity takes an extractor definition file and a preprocessed document as its inputs. It performs document extraction in which the required data is extracted from the document according to the extractor definition. It outputs an [`ExtractionResult`](https://docs.visualyze.ai/getting-started/rpa-studio/variables/activity-variables) variable which contains the extracted data.

If the user provides a [`ClassificationResult` ](https://docs.visualyze.ai/getting-started/rpa-studio/variables/activity-variables#classificationresult)output for the document from [`Classify Document`](https://docs.visualyze.ai/rpa-studio/document-ai/tasks/classify-document) activity and if the extractor definition is multi-class then the activity only extracts the data defined under the class predicted in `ClassificationResult`.

{% hint style="info" %}
User should preprocess the document using a Document AI Client with appropriate extraction enabled depending on the extractor used.

* **`Text`**\
  `Regex Extractor`
* **`Skill`**\
  `Skill Extractor`
* **`Form`**\
  `Form Extractor`

The extractor definition can be created using `Create Extractor Window`
{% endhint %}

### Input

* **Processed Document** : [`ProcessedDocument Variable`](https://docs.visualyze.ai/getting-started/rpa-studio/variables/activity-variables#processeddocument) <mark style="color:red;">`Required`</mark>\
  The preprocessed document from the preprocess document activity.<br>
* **Extractor Definition** : [`String Argument`](https://docs.visualyze.ai/getting-started/rpa-studio/arguments) <mark style="color:red;">`Required`</mark>\
  Path to the classifier definition file (`*.extractor.vdai).`<br>
* **Document AI Client** : [`DocAIClient Variable`](https://docs.visualyze.ai/getting-started/rpa-studio/variables/activity-variables) <mark style="color:red;">`Required`</mark>\
  The configured `Document AI Client`.<br>
* **Classification Result** : [`ClassificationResult Variable`](https://docs.visualyze.ai/getting-started/rpa-studio/variables/activity-variables#classificationresult) <mark style="color:red;">`Required`</mark>\
  The `ClassificationResult` if the user has classified the document and the definition is multi-class.

### Options

* **Split Pages** : <mark style="color:red;">`Required`</mark>\
  If `true` and the document has multiple pages then the extraction is applied on each page independently. Available values are :
  * `True`
  * `False`

### Output

* **Extraction Result** : [`ExtractionResult Variable`](https://docs.visualyze.ai/getting-started/rpa-studio/variables/activity-variables#extractionresult) <mark style="color:red;">`Required`</mark> \
  The result of the document extraction.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.visualyze.ai/rpa-studio/document-ai/tasks/run-extractor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
