n8n community node for OCR and document extraction using multiple AI providers (Gemini, OpenAI, Claude, Grok, Vertex)
npm install n8n-nodes-ocr-ain8n-nodes-ocr-ai in the package name field
bash
cd ~/.n8n/nodes
pnpm install n8n-nodes-ocr-ai
`
Credentials
Configure credentials based on the provider you want to use:
| Provider | Credential Type | Required Fields |
|----------|----------------|-----------------|
| Gemini | OCR AI Gemini API | API Key |
| OpenAI | OCR AI OpenAI API | API Key |
| Claude | OCR AI Claude API | API Key |
| Grok | OCR AI Grok API | API Key |
| Vertex AI | OCR AI Vertex AI | Project ID, Location |
Usage
$3
1. Add the OCR AI node to your workflow
2. Select a provider and configure credentials
3. Choose Extract Text operation
4. Select input type (Binary, URL, or Base64)
5. Configure the input source
6. Run the workflow
$3
1. Add the OCR AI node
2. Choose Extract JSON operation
3. Define a JSON schema describing the structure you want to extract
4. The node will return structured data matching your schema
#### Example Schema
`json
{
"invoice_number": "string",
"date": "string",
"total": "number",
"items": [{
"description": "string",
"quantity": "number",
"price": "number"
}]
}
`
Options
| Option | Description |
|--------|-------------|
| Custom Prompt | Guide the extraction with a custom prompt |
| Language | Set extraction language (default: auto) |
| Model | Override the default model for the provider |
| Temperature | Control randomness (0-2) |
| Max Tokens | Maximum tokens in response |
Default Models
| Provider | Default Model |
|----------|--------------|
| Gemini | gemini-1.5-flash |
| OpenAI | gpt-4o |
| Claude | claude-sonnet-4-20250514 |
| Grok | grok-2-vision-1212 |
| Vertex AI | gemini-2.0-flash |
Development
`bash
Install dependencies
pnpm install
Build
pnpm build
Development mode
pnpm dev
Lint
pnpm lint
``