> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cassidyai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced Document Extraction

> Extract text from PDFs, Word docs, PowerPoint, Keynote, and images using AI vision (OCR) in a Workflow.

Extract text from documents and images using AI vision (OCR). Use the **Advanced Document Extraction** action when a previous step in your [Workflow](https://docs.cassidyai.com/workflows/overview.md) outputs a **file** — such as a PDF attachment or a downloaded document — and you need that content as text for later steps like [Extract Information](https://docs.cassidyai.com/reference/actions/extract-information.md) or [Generate Text](https://docs.cassidyai.com/reference/actions/generate-text.md).

> [!NOTE]
>
> Use **Advanced Document Extraction** when your document has complex layouts
> like tables or multi-column structures, poor scan quality, non-Latin scripts
> with diacritics, or when accuracy is very important.

**1. Add the action**

In the Workflow builder, click **+** between blocks and search for **Advanced Document Extraction** or **OCR**, then select it from the action library.

![Action library with Advanced Document Extraction selected](https://mintcdn.com/cassidy/1XIhoA23Ch7hxVJV/images/reference/advanced-document-extraction-img-1.png?fit=max\&auto=format\&n=1XIhoA23Ch7hxVJV\&q=85\&s=97d8a2e8a52bdede96299ace2fea52cd)

![Advanced Document Extraction action added to the Workflow](https://mintcdn.com/cassidy/1XIhoA23Ch7hxVJV/images/reference/advanced-document-extraction-img-2.png?fit=max\&auto=format\&n=1XIhoA23Ch7hxVJV\&q=85\&s=ab63c544aadfd56b071c34846cc1dc00)

**2. Select the document**

In the **Document** field, reference the file you want to read. Use **#** to [reference variables](https://docs.cassidyai.com/guides/prompt-engineering.md#workflow-prompts) from a previous step.

Common sources include:

* **Image uploads** from a [Manual trigger](https://docs.cassidyai.com/reference/triggers/manual.md) file input (images are not auto-parsed like PDFs and Word docs)
* **Email attachments** from an [Email trigger](https://docs.cassidyai.com/reference/triggers/email.md)
* **Downloaded files** from **Download File from URL** or integration download actions (Google Drive, SharePoint, Box, etc.)
* **Files inside a [Loop](https://docs.cassidyai.com/reference/actions/loop.md)** when processing multiple attachments or documents one at a time

**3. Use the output in later steps**

The action outputs the extracted text as a single text variable. Reference it in subsequent actions to summarize, categorize, extract fields, or generate a response.

## Supported file types

| Type | Formats |
| - | - |
| **Documents** | PDF, Word (`.doc`, `.docx`), PowerPoint (`.pptx`), Keynote (`.key`) |
| **Images** | PNG, JPEG, WEBP, GIF |

> [!WARNING]
>
> If the file type isn't supported, the action stops the Workflow with an error.
> Convert the file to a supported format before passing it in.

> [accordion] Advanced: custom instructions
>
> Under **Advanced Settings**, add **Custom Instructions** to tell the AI what to focus on or how to format the output. For example:
>
> * `Extract all table data as markdown tables`
> * `Focus on the invoice number, date, and line items only`
> * `Preserve headings and bullet lists from the original document`
>
> Custom instructions are useful when you need a specific structure rather than a full verbatim transcription.

> [!TIP]
>
> Pair **Advanced Document Extraction** with [Extract
> Information](https://docs.cassidyai.com/reference/actions/extract-information.md) to turn unstructured
> document text into structured fields you can send to CRM actions,
> spreadsheets, or email steps.

## Related

* [Extract Information](https://docs.cassidyai.com/reference/actions/extract-information.md)
* [Get Knowledge Base File](https://docs.cassidyai.com/reference/actions/get-knowledge-base-file.md)
* [Email trigger](https://docs.cassidyai.com/reference/triggers/email.md)
* [Create files with Workflows](https://docs.cassidyai.com/guides/create-files.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.