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.
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.
| Node | Category | Type | Operation |
|---|---|---|---|
| Split Attachments | Code | Code | See node parameters |
| Download Attachments | Messaging | Microsoft Outlook | get |
| Parse Output | Transform | Edit Fields | See node parameters |
| For Each Message | Routing | Loop Over Items | See node parameters |
| Message Ref | Routing | No Op | See node parameters |
| Message Classifier | AI & models | Text Classifier | See node parameters |
| Extract from File | Transform | Extract From File | binaryToPropery |
| Markdown | Transform | Markdown | See node parameters |
| Empty Response | Transform | Edit Fields | See node parameters |
| Wait | Wait | Wait | See node parameters |
| Filter Invoices | Routing | Filter | See node parameters |
| Has Invoice? | Routing | If | See node parameters |
| Schedule Trigger | Trigger | Schedule Trigger | See node parameters |
| Get Recent Messages | Messaging | Microsoft Outlook | getAll |
| Model | AI & models | LM Chat Google Gemini | See node parameters |
| Microsoft Excel 365 | Data store | Microsoft Excel | worksheet / append |
| Invoice Classifier With Gemini 2.0 | Web / API | HTTP Request | POST |
| File-Based OCR with Gemini 2.0 | Web / API | HTTP Request | POST |
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
googlePalmApimicrosoftExcelOAuth2ApimicrosoftOutlookOAuth2Api
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.