Ready to start automating?
Let’s cut down the manual, unfulfilling work and free up time for what actually drives growth.

Optical Character Recognition (OCR) technology has come a long way from simple text extraction. Today's advanced OCR solutions can intelligently extract structured data from complex documents, making them invaluable for automation workflows. In this post, we'll explore how Llamaindex's extraction and parse tools provide powerful OCR capabilities that can transform how you process documents in your automation workflows—while exploring our n8n template.
Llamaindex Cloud offers two powerful tools for document processing:
Both tools only work with PDF documents, so you'll need to convert other formats before processing.
Let's walk through how to implement Llamaindex Extraction in an n8n workflow to automatically extract structured data from pitch decks.
The process follows these key steps:
First, you need to identify which extraction agent to use. In Llamaindex Cloud, you can create custom extraction agents with specific schemas for different document types.
1curl -X 'GET' \
2 'https://api.cloud.llamaindex.ai/api/v1/extraction/extraction-agents/by-name/{agent_name}' \
3 -H 'accept: application/json' \
4 -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
This API call retrieves the agent ID by name, which you'll need for subsequent steps.
Your document must be in binary format for processing:
// In n8n, use the HTTP Request node to fetch a PDF
// Then set the response format to 'File'
Before processing, you need to create a file object in Llamaindex Cloud:
1curl -X 'POST' \
2 'https://api.cloud.llamaindex.ai/api/v1/files' \
3 -H 'accept: application/json' \
4 -H 'Content-Type: multipart/form-data' \
5 -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
6 -F 'upload_file=@/path/to/your/file.pdf;type=application/pdf'
This creates a reference to your document that the extraction agent can work with.
Now you can run the actual extraction job:
1curl -X 'POST' \
2 'https://api.cloud.llamaindex.ai/api/v1/extraction/jobs' \
3 -H 'accept: application/json' \
4 -H 'Content-Type: application/json' \
5 -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
6 -d '{
7 "extraction_agent_id": "{$AGENT_ID}",
8 "file_id": "{$FILE_ID}",
9}'
The payload includes the file ID from the previous step. You can also configure additional parameters like extraction mode or add a system prompt for more control.
Extraction jobs run asynchronously, so you need to check when they're complete:
1curl -X 'GET' \
2 'https://api.cloud.llamaindex.ai/api/v1/extraction/jobs/{$JOB_ID}' \
3 -H 'accept: application/json' \
4 -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
In n8n, you can use a loop to check the status every 30 seconds until it's no longer "pending" or "in progress".
Once complete, you can fetch the structured data:
1curl -X 'GET' \
2 'https://api.cloud.llamaindex.ai/api/v1/extraction/jobs/{$JOB_ID}/result' \
3 -H 'accept: application/json' \
4 -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY"
This returns your data in the schema format you defined when creating the extraction agent.
The real power of Llamaindex Extraction comes from its ability to extract data according to custom schemas. These schemas define exactly what information you want and how it should be structured.
For example, a pitch deck extraction schema might include:
You can create these schemas manually or let Llamaindex generate them by providing example documents and an extraction prompt.
The structured data from Llamaindex Extraction opens up numerous possibilities:
In our demonstration, we extracted structured data from a pitch deck, including:
This structured output is perfect for:
Llamaindex Extraction and Parse represent significant advancements in document processing technology. By combining these tools with n8n workflows, you can automate the extraction of structured data from documents, eliminating manual data entry and accelerating business processes.
Whether you're processing investment documents, analysing forms, or building knowledge bases, these tools provide a powerful foundation for document automation workflows that save time and improve accuracy.
The ability to transform unstructured documents into structured, machine-readable data opens up new possibilities for automation and analysis that were previously impractical or impossible with traditional OCR approaches.
Let’s cut down the manual, unfulfilling work and free up time for what actually drives growth.
Explore more posts like this.