Convert Bank Statements to Markdown with n8n & Google Gemini

This n8n workflow automates converting bank statement PDFs into detailed markdown using Google Gemini vision models. It solves the challenge of extracting accurate financial data from scanned PDFs, saving time and reducing errors in data processing.
manualTrigger
lmChatGoogleGemini
googleDrive
+9
Workflow Identifier: 2338
NODES in Use: Manual Trigger, Google Gemini Chat Model, Sort, Sticky Note, Google Drive, HTTP Request, Compression, Code, Edit Image, ChainLLM, Aggregate, Information Extractor
Automate bank statements with n8n and Google Gemini

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow downloads bank statement PDFs from Google Drive by file ID automatically.

It breaks each PDF page into images.

Then, a Google Gemini vision model reads each page and transcribes it into markdown, keeping tables and layouts intact.

The markdown pages combine into one text.

Finally, the workflow extracts deposit data from the markdown as structured JSON with date, description, and amount.

This stops the need for manual copy-pasting and checking, saving time and reducing mistakes.


Who Should Use This Workflow

Anyone who handles scanned bank statements in PDF form and needs clean text or structured data from them.

Users who want to avoid manual extraction and errors when working with complex or scanned financial documents will find this useful.


Tools and Services Used

  • Google Drive: Downloads PDFs via OAuth in n8n.
  • Stirling PDF API: Converts PDFs to page images.
  • Compression Node: Unzips image files.
  • Code Node: Splits multiple images into separate items.
  • Edit Image Node: Resizes images for faster AI reading.
  • Google Gemini Chat Model (ChainLLM Node): Transcribes images into markdown.
  • Aggregate Node: Combines markdown from all pages.
  • Information Extractor Node: Extracts deposit lines as JSON.

Inputs, Processing Steps, and Outputs

Inputs

  • Google Drive file ID of a scanned bank statement PDF.

Processing Steps

  1. Download PDF from Google Drive.
  2. Send PDF to Stirling PDF API to convert to JPG images.
  3. Unzip image files.
  4. Split images into separate workflow items.
  5. Sort images by filename to ensure page order.
  6. Resize images to 75% using Edit Image node for speed.
  7. Use Google Gemini vision chat model to transcribe each image to markdown.
  8. Aggregate markdown texts into one blob.
  9. Run Information Extractor to pull out deposit rows as structured JSON.

Outputs

  • Markdown text preserving tables and layout from the entire statement.
  • JSON array listing deposits with date, description, and amount fields.

Beginner Step-by-Step: How to Use This Workflow in n8n

Import the Workflow

  1. Download the workflow file using the Download button on this page.
  2. Go to your n8n editor, click on “Import from File”, and select the downloaded file.

Configure Credentials and IDs

  1. Add or update Google Drive OAuth credentials in the Google Drive node.
  2. Make sure to enter the correct Google Drive file ID for the bank statement.
  3. Check the Stirling PDF API URL is accessible or update if self-hosting.
  4. Confirm Google Gemini (PaLM API) credentials are set properly in the ChainLLM nodes.
  5. If there is any code or prompt in code nodes, copy-paste them carefully; they are ready to use.

Test and Activate

  1. Run the workflow once with Manual Trigger to test if all steps work.
  2. Check for any errors especially at download, PDF splitting, or transcribing.
  3. If all works, activate the workflow in n8n for production.

Follow any error messages and adjust settings or credentials as needed.

For better privacy, consider self-host n8n and Stirling PDF instances.


Common Issues and How to Fix Them

Google Drive File Download Fails

Check if the file ID is correct.

Make sure Google Drive OAuth credentials allow access.

Stirling PDF Conversion Fails

Verify if the Stirling API URL is reachable.

Check network and proper sending of PDF binary data.

Inaccurate or Incomplete Transcription

Try increasing the image resize percentage.

Adjust the transcription prompt wording in the ChainLLM node.


Customization Ideas

  • You can replace the Google Drive node with a Webhook node to accept PDF uploads from other apps.
  • Swap Google Gemini chat models with GPT4o or Claude Sonnet for transcription.
  • Change the extraction prompt to find withdrawals, balances, or other data instead of deposits.
  • Use local PDF-to-image tools instead of Stirling PDF for privacy.
  • Tweak image resizing or add enhancements to improve reading on low-quality scans.

Summary of Benefits and Results

✓ Saves many hours of manual data copying and correcting.

✓ Transforms difficult scanned bank statements into clean markdown.

✓ Automatically extracts deposits into structured JSON for reporting.

✓ Reduces manual errors in transcription.

→ Provides easy input for further finance automation or analysis.


Automate bank statements with n8n and Google Gemini

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes, nodes for Dropbox or OneDrive can be used instead if similar file download access is set up.
Yes, each image page transcription uses Google PaLM API calls billed by the plan.
Data passes through the Stirling service by default but self-hosting Stirling PDF improves security.
Yes, but longer PDFs increase processing time and API costs; batching or limits can help manage this.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.