← All N8N workflows
Messaging & emailCodeExtract From FileFilterHTTP RequestIf

transcribing bank statements to markdown using gemini vision ai

Configured with Extract From File, Filter, HTTP Request, LM Chat Google Gemini, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
CodeSplit AttachmentsCodeMessagingDownload AttachmentsMicrosoft OutlookTransformParse OutputEdit FieldsRoutingFor Each MessageLoop Over ItemsRoutingMessage RefNo OpAI & modelsMessage ClassifierText ClassifierTransformExtract from FileExtract From FileTransformMarkdownMarkdownTransformEmpty ResponseEdit FieldsWaitWaitWaitRoutingFilter InvoicesFilterRoutingHas Invoice?IfTriggerSchedule TriggerSchedule TriggerMessagingGet Recent MessagesMicrosoft OutlookAI & modelsModelLM Chat Google GeminiData storeMicrosoft Excel 365Microsoft ExcelWeb / APIInvoice Classifier WithGemini 2.0HTTP RequestWeb / APIFile-Based OCR withGemini 2.0HTTP Request

Node categories in this workflow

  • Code
  • Messaging
  • Transform
  • Routing
  • AI & models
  • Wait
  • Trigger
  • Data store
  • 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.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Split AttachmentsCodeCodeSee node parameters
Download AttachmentsMessagingMicrosoft Outlookget
Parse OutputTransformEdit FieldsSee node parameters
For Each MessageRoutingLoop Over ItemsSee node parameters
Message RefRoutingNo OpSee node parameters
Message ClassifierAI & modelsText ClassifierSee node parameters
Extract from FileTransformExtract From FilebinaryToPropery
MarkdownTransformMarkdownSee node parameters
Empty ResponseTransformEdit FieldsSee node parameters
WaitWaitWaitSee node parameters
Filter InvoicesRoutingFilterSee node parameters
Has Invoice?RoutingIfSee node parameters
Schedule TriggerTriggerSchedule TriggerSee node parameters
Get Recent MessagesMessagingMicrosoft OutlookgetAll
ModelAI & modelsLM Chat Google GeminiSee node parameters
Microsoft Excel 365Data storeMicrosoft Excelworksheet / append
Invoice Classifier With Gemini 2.0Web / APIHTTP RequestPOST
File-Based OCR with Gemini 2.0Web / APIHTTP RequestPOST

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. 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

  • googlePalmApi
  • microsoftExcelOAuth2Api
  • microsoftOutlookOAuth2Api

Workflow notes

2. Classify If Attachment is Invoice

2. Classify If Attachment is Invoice

Learn more about the Outlook node

For each qualifying message, we will need to know which of the attachments contained are actual invoice documents. To do this, we can use Google Gemini's docuemnt understanding capabilities to validate this test. We're using Gemini specifically in this case because at time of writing, Gemini is the only one of the few LLM providers that are currently accepting PDF documents. If you're not using Gemini, you may need to convert the PDF document to an image first - check out an example of this here.

3. Extract Invoice Details

3. Extract Invoice Details

Learn more about the HTTP Request node

With our invoice PDFs ready to go, we'll again use the Gemini API to extract the required details from them. I'm using the HTTP request node because unfortunately, Gemini works best for data extraction when using the API's "generationConfig" parameter which isn't supported in n8n's native AI nodes. The output is then merged with the original email to keep the reference between them.

1. Check for Invoice Emails

1. Check for Invoice Emails

Learn more about the text classifier node

The Outlook node fetches all inbox messages within the last hour and classifies each message prior to downloading the attachments. This is a really good early check to reduce the comsumption of resources. In this use-case, using AI for contextual reasoning regarding the intent of the email can be much more powerful than simple keyword matching. The latter is more prone to matching false positives. Note: we're not using the Outlook Trigger node because it doesn't allow setting for dateTime filters.

4. Upload to Excel Workbook

4. Upload to Excel Workbook

Read more about the Excel node

Finally to capture the data, we can map these to an Excel workflow which can be reviewed by a human before it enters the accounting system.

Try it out

Try it out

This n8n template monitors an Outlook mailbox for invoices, automatically parses/extracts data from them and then uploads the output to an Excel Workbook.

One of my top workflow requests, this template can save in order of 100s of hours of manual labour for you or your finance team.

How it works

  • A scheduled trigger is set to fetch recent Outlook messages to the Accounts receivable mailbox.
  • Each message is analysed to determine whether or not it from a supplier and is issuing/contains an invoice.
  • For each valid message, the attachments are downloaded and non-invoice documents are filtered out via AI Vision classification.
  • Invoices are then processed through a AI vision model again to extract the details.
  • The extracted data can then be used for reconciliation or otherwise. For this demonstration, we'll just append the row to an Excel sheet for now.

How to use

  • Ensure your Microsoft365 credential points to the correct mailbox. If a shared folder is used, toggle "shared folder" option to "on" and for the principal ID, use the email address.
  • If you receive lots of other types of messages such as replies and forwards, you may want to implement additional checks to prevent processing invoices twice. The "remove duplicates" node can help with this.

Need Help?

Join the Discord or ask in the Forum!

Happy Hacking!

Where Next? It's Up to You!

Where Next? It's Up to You!

This template is deliberately cut short to demonstrate the build but should be easily modified to upload directly to an accounting system or even extended for other tasks such as invoice reconciliation and more.

transcribing bank statements to markdown using gemini vision ai

transcribing bank statements to markdown using gemini vision ai

Purpose and structure

This folder contains the transcribing bank statements to markdown using gemini vision ai workflow. Its executable nodes use code, extractFromFile, filter, httpRequest, if, lmChatGoogleGemini, markdown, microsoftExcel, microsoftOutlook, noOp, scheduleTrigger, set, splitInBatches, textClassifier, wait. 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

Schedule Trigger

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/Wait/0820_Wait_Code_Send_Webhook.json MIT; preserve source notices.

More in Messaging & email