Workflow: Extract data from PDF with Claude 3.5 Sonnet or Gemini 2.0 Flash
Configured with Extract From File, Google Drive, HTTP Request. Review the connections and setup before adapting this template.
Node categories in this workflow
- Trigger
- Transform
- Files / media
- Web / API
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| When clicking 'Test workflow' | Trigger | Manual Trigger | See node parameters |
| Extract from File | Transform | Extract From File | binaryToPropery |
| Google Drive | Files / media | Google Drive | download |
| Call Gemini 2.0 Flash with PDF Capabilities | Web / API | HTTP Request | POST |
| Call Claude 3.5 Sonnet with PDF Capabilities | Web / API | HTTP Request | POST |
| Define Prompt | Transform | Edit Fields | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
anthropicApigoogleDriveOAuth2ApigooglePalmApi
Workflow notes
Workflow: Extract data from PDF with Claude 3.5 Sonnet or Gemini 2.0 Flash
Workflow: Extract data from PDF with Claude 3.5 Sonnet or Gemini 2.0 Flash
Overview
- This workflow helps you compare Claude 3.5 Sonnet and Gemini 2.0 Flash when extracting data from a PDF
- This workflow extracts and processes the data within a PDF in one single step, instead of calling an OCR and then an LLM”
How it works
- The initial 2 steps download the PDF and convert it to base64.
- This base64 string is then sent to both Claude 3.5 Sonnet and Gemini 2.0 Flash to extract information.
- This workflow is made to let you compare results, latency, and cost (in their dedicated dashboard).
How to use it
- Set up your Google Drive if not already done
- Select a document on your Google Drive
- Modify the prompt in "Define Prompt" to extract the information you need and transform it as wanted.
- Get a Claude API key and/or Gemini API key
- Note that you can deactivate one of the 2 API calls if you don't want to try both
- Test the Workflow
Sticky Note
You can output the result as JSON by adding the following:
"generationConfig": {
"responseMimeType": "application/json"
or even use a structured output. Check the documentation
Sticky Note2
You can force Claude to output JSON with Prefill response format
Sticky Note3
These 2 steps first download the PDF file, and then convert it to base64. This is required by both APIs to process the file.
Sticky Note4
This prompt is used in both Gemini’s and Claude’s calls to define what information should be extracted and processed.
Workflow: Extract data from PDF with Claude 3.5 Sonnet or Gemini 2.0 Flash
Workflow: Extract data from PDF with Claude 3.5 Sonnet or Gemini 2.0 Flash
Purpose and structure
This folder contains the Workflow: Extract data from PDF with Claude 3.5 Sonnet or Gemini 2.0 Flash workflow. Its executable nodes use extractFromFile, googleDrive, httpRequest, manualTrigger, set. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
When clicking 'Test workflow'
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Extractfromfile/1438_Extractfromfile_Manual_Process_Webhook.json MIT; preserve source notices.