Skip to main content

Process large documents with OCR using SubworkflowAI and Gemini

Workflow preview

Workflow preview
100%
Process large documents with OCR using SubworkflowAI and Gemini preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Working with Large Documents In Your VLM OCR Workflow Document workflows are popular ways to use AI but what happens when your document is too large for your app or your AI to handle? Whether its c...

Best for

  • Document Extraction automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.wait, n8n-nodes-base.httprequest, n8n-nodes-base.manualtrigger, n8n-nodes-base.googledrive, n8n-nodes-base.splitout, n8n-nodes-base.stickynote, n8n-nodes-base.if, @n8n/n8n-nodes-langchain.googlegemini

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jimleuk.

Original n8n.io source

1.1 Workflow description

Title
Process large documents with OCR using SubworkflowAI and Gemini
Workflow name
Process large documents with OCR using SubworkflowAI and Gemini

Working with Large Documents In Your VLM OCR Workflow

Document workflows are popular ways to use AI but what happens when your document is too large for your app or your AI to handle? Whether its context window or application memory that's grinding to a halt, Subworkflow.ai is one approach to keep you going.

> Subworkflow.ai is a third party API service to help AI developers work with documents too large for context windows and runtime memory.

Prequisites

  1. You'll need a Subworkflow.ai API key to use the Subworkflow.ai service.
  2. Add the API key as a header auth credential. More details in the official docs https://docs.subworkflow.ai/category/api-reference

How it Works

  1. Import your document into your n8n workflow
  2. Upload it to the Subworkflow.ai service via the Extract API using the HTTP node. This endpoint takes files up to 100mb.
  3. Once uploaded, this will trigger an Extract job on the service's side and the response is a "job" record to track progress.
  4. Poll Subworkflow.ai's Jobs endpoint and keep polling until the job is finished. You can use the "IF" node looping back unto itself to achieve this in n8n.
  5. Once the job is done, the Dataset of the uploaded document is ready for retrieval. Use the Datasets and DatasetItems API to retrieve whatever you need to complete your AI task.
  6. In this example, all pages are retrieved and run through a multimodal LLM to parse into markdown. A well-known process when parsing data tables or graphics are required.

How to use

  • Integrate Subworkflow's Extract API seemlessly into your existing document workflows to support larger documents from 100mb+ to up to 5000 pages.

Customising the workflow

  • Sometimes you don't want the entire document back especially if the document is quite large (think 500+ pages!), instead, use query parameters on the DatasetItems API to pick individual pages or a range of pages to reduce the load.

Need Help?

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 2 - Check Job Status

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - Get Dataset Items

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 4 - Get Dataset

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - When clicking ‘Execute workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 6 - Download file

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 7 - Split Out

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 8 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Extract API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 10 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Job Complete?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 14 - Document OCR via VLM

Type / Role
@n8n/n8n-nodes-langchain.googleGemini - googleGemini
Config choices
Version 1

Block 15 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Process large documents with OCR using SubworkflowAI and Gemini
Complexity advanced
Nodes 16
Categories Document Extraction, Multimodal AI
Author Jimleuk
Published 06 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10566/10566.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Process large documents with OCR using SubworkflowAI and Gemini do?

Working with Large Documents In Your VLM OCR Workflow Document workflows are popular ways to use AI but what happens when your document is too large for your app or your AI to handle? Whether its c...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, Multimodal AI use case.