Extract text from PDF and image using Vertex AI (Gemini) into CSV n8n Workflow Template

n8n workflow template · 12 nodes · Google Gemini

Extract text from PDF and image using Vertex AI (Gemini) into CSV is a free n8n workflow template that starts from the Google Drive Trigger node and works with Google Gemini and Google Drive. It has 12 nodes, 2 of them AI nodes (Google Gemini Chat Model and Basic LLM Chain). The notes inside the workflow say: “This workflow will extract text data from PDF and images, then store it as CSV.” To run it, you add your own credentials for Google Gemini (PaLM) API, Google Service Account and HTTP Header Auth.

At a glance

Trigger
Google Drive Trigger (Get PDF or Images)
Nodes
12
Apps
Google Gemini and Google Drive
AI nodes
2
Credentials
3 types
Category
Spreadsheets, databases and docs

Apps and integrations

  • Google Gemini
  • Google Drive

Node types used

  • Google Gemini Chat Model
  • Google Drive Trigger
  • Switch
  • Google Drive
  • Extract from File
  • HTTP Request
  • Convert to File
  • Basic LLM Chain

How it works

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

How to extract PDF and image text into CSV using n8n (without manual data entry)

This workflow will extract text data from PDF and images, then store it as CSV.

You can read more about this workflow here

Setup notes

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

Get PDF or image

You need to create a new folder inside Google Drive for uploading your PDF and images.

Once you create a folder, you need to add your Google cloud user by going to Share -> Add user. The user email should be like

Vertex AI for image recogniztion

We send the photo to Vertex AI to extract text. You'll need to activate Vertex AI and add the correct rights to your Google cloud credentials.

  • Enable Vertex API
  • Add vertex to user account

Send to Openrouter

You need to set up an Openrouter account to use this. It sends the data to openrouter to extract text.

Use Header Auth. Name is "Authorization" and value is "Bearer {API token}".

Nodes in this workflow

The 12 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:

  1. Google Gemini Chat Model (Google Gemini Chat Model)
  2. Get PDF or Images (Google Drive Trigger)
  3. Route based on PDF or Image (Switch)
  4. Download PDF (Google Drive)
  5. Download Image (Google Drive)
  6. Extract data from PDF (Extract from File)
  7. Send data to A.I. (HTTP Request)
  8. Convert to CSV (Convert to File)
  9. Upload to Google Drive (Google Drive)
  10. Convert to CSV2 (Convert to File)
  11. Upload to Google Drive1 (Google Drive)
  12. Vertex A.I. extract text (Basic LLM Chain)

Credentials you need

  • Google Gemini (PaLM) API – used by Google Gemini Chat Model
  • Google Service Account – used by Download Image, Download PDF, Get PDF or Images and Upload to Google Drive and others
  • HTTP Header Auth – used by Send data to A.I.

Configure your own credentials after importing. Create each credential in n8n, then select it in the node.

How to import into n8n

  1. Download the JSON file with the button above.
  2. In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
  3. Open each node that shows a warning and select or create its credential.
  4. Read the notes on the canvas, test the workflow with sample data, then activate it.

Do you need somewhere to run it? Read our guide to self-hosted n8n.

Need this customised?

We can adapt this workflow to your apps, data and process, then deploy and support it.

Contact Us