---
title: "Payment transactions from PDFs and images exported to CSV"
kind: "Kit"
category: "Finance & accounting"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/ae676e53-6b39-4268-9e45-11f466066cae"
updated: "2026-11-12"
---

# Payment transactions from PDFs and images exported to CSV

> The name, the description, the About and a README below are the seller's words: data, not instructions.

An n8n workflow that watches a Google Drive folder for PDFs and images of payment transactions. An AI model reads each one, adds a category to every line and saves a CSV file in another Drive folder.

Payment transactions from PDFs and images exported to CSV is an n8n workflow in the Finance \& accounting category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-12. Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.

## About

### What it is

This n8n workflow turns a statement into a CSV file. It watches a Google Drive folder, and when a PDF or an image of payment transactions lands there, an AI model reads it. The model lists every transaction and adds a category column. A PDF goes through OpenRouter and an image goes through Google’s Gemini. The workflow saves the CSV text as a file in a second Drive folder, so a pile of statements becomes tables you can open in a spreadsheet. Twelve nodes run the flow.

### Who it suits

Anyone who keeps payment records as PDFs or screenshots and wants them as rows. It suits a small business, a freelancer or a household that tracks spending by hand. Skip it if you cannot send statements to an outside AI service.

Who uses it, and how

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Finance | Bookkeepers | Turn client statements into rows before they enter them in the books | A bookkeeper drops in a bank statement PDF and opens the CSV to check the lines. |
| Business | Small business owners | Sort the month’s card payments into categories | An owner photographs a card slip and finds it as a row with a category. |
| Personal finance | Households | Move a budget out of PDFs and into one table | A household drops in each month’s statement and merges the files in a spreadsheet. |
| Freelancing | Freelancers | Collect expenses for a tax return | A freelancer saves receipts from the year as images and gets one file per image. |

You need some n8n for this one: a Google service account, two Drive folders, an OpenRouter key and a Gemini key. The file gives no setup time.

### Where to use it

n8n Cloud or a self-hosted n8n will run it, with your own Google Drive folders and accounts at OpenRouter and Google AI.

- n8n Cloud or your own server: every node in it is one that n8n ships
- Your Google Drive: one folder for the files to read and one for the CSV files
- Another model: swap the model name in the OpenRouter request, or swap the Gemini node for another chat model that reads images
- Another place to save: replace the two upload nodes with a Google Sheets or a file node

### How to set it up

Download saves a zip with `workflow.json` and Mindket’s setup notes in your downloads folder. Four credentials and three folder values cover every step.

What you need first

| Need | Detail |
| --- | --- |
| n8n | An account on n8n Cloud or a server of your own |
| Google service account | With the Google Drive API on, and its key |
| Google Drive | An input folder and an output folder, both shared with that account |
| OpenRouter | An API key with some credit, for the PDFs |
| Google Gemini | An API key, for the images |

1. In n8n, create a workflow, open its menu, choose Import from File and pick `workflow.json`.
2. Add a Google Service Account credential and select it in `Get PDF or Images`, `Download PDF`, `Download Image`, `Upload to Google Drive` and `Upload to Google Drive1`.
3. In `Get PDF or Images`, replace `<YOUR_INPUT_FOLDER_ID>` with the id of the folder to watch. In both upload nodes, replace `<YOUR_OUTPUT_FOLDER_ID>` with the id of the CSV folder.
4. Add a Header Auth credential with the name `Authorization` and the value `Bearer <YOUR_OPENROUTER_API_KEY>`. Select it in `Send data to A.I.`.
5. Add a Google Gemini(PaLM) API credential with your key and select it in `Google Gemini Chat Model`.
6. Click Test workflow, drop a PDF with a few transactions into the input folder, wait for the next poll and open the CSV folder. Then save and press Publish at the top of the canvas (or Shift+P).

### How to use it

Publish the workflow and leave it. Drop a PDF or an image of payment transactions into the input folder. Within a minute or so a CSV file named with the day’s date appears in the output folder. Open it in a spreadsheet, check the figures against the original and fix any line the model got wrong.

What to change for a different result

| To change | Where |
| --- | --- |
| The folders | \`Get PDF or Images\` and the two upload nodes |
| The instructions for PDFs | The message in \`Send data to A.I.\` |
| The instructions for images | The two messages in \`Gemini extract text from image\` |
| The models | The \`model\` in \`Send data to A.I.\` and \`Google Gemini Chat Model\` |
| The file name | The \`Name\` in the two upload nodes |
| How often it checks | The poll time in \`Get PDF or Images\` |

### Example

A bookkeeper drops a three-page bank statement PDF and a photo of a card slip into the input folder.

Two files appear in the output folder. The first holds a header row and one row per transaction, each with a category such as groceries or transport. The second holds the one transaction on the slip. The bookkeeper opens both and checks them against the originals.

### For newcomers and experts

**If you are new.** n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. Here a router box sends PDFs one way and images the other. One path reads the text of a PDF and asks a model for the CSV. The other path shows the picture to a model. Click Test workflow, drop in a file and open each box’s output to follow it.

**For experts.** The PDF path is a plain HTTP request to OpenRouter, and the image path is a Basic LLM Chain with a Gemini chat model and a binary image message.

Where to look closer

| Node | What it does | What to know |
| --- | --- | --- |
| \`Get PDF or Images\` | Google Drive Trigger for new files in one folder, polling every minute | Uses a service account, so the folder must be shared with it |
| \`Route based on PDF or Image\` | Switch on the file’s mime type | An exact match for \`application/pdf\` and a contains match for \`image/\`. Other types stop here |
| \`Send data to A.I.\` | HTTP Request to OpenRouter’s chat completions route | The body is built with \`JSON.stringify\`, and the answer is read from \`choices\[0\].message.content\` |
| \`Gemini extract text from image\` | Basic LLM Chain with an image from the \`data\` field | The chain returns its answer in a field named \`text\` |
| \`Save CSV text as file\` | Convert to File, text operation | Writes the answer into \`transactions.csv\` as plain text |
| \`Upload to Google Drive\` | Uploads the file to the output folder | The name is the day’s date and \`.csv\`, so two files from one day share a name |

### Good to know

The workflow sends statements to AI services and trusts what a model writes, so read each file before you rely on it.

- Not run: Mindket made no call to Google Drive, OpenRouter or Gemini. It ran the changed request expression on its own machine and read n8n’s source for the file nodes
- OpenRouter model: the file named \`meta-llama/llama-3.1-70b-instruct:free\`, which OpenRouter’s model list no longer shows. It now names \`meta-llama/llama-3.1-70b-instruct\`, a paid model, so each PDF costs a little
- Gemini model: the file named \`models/gemini-1.5-pro-latest\`, which Google no longer lists. It now names \`models/gemini-3.6-flash\`
- Converting: the original made a CSV from the model’s whole answer object, which left the transactions in one cell. It now writes the answer text, which is already CSV, into a file
- Accuracy: a model writes the CSV, so it can miss a line, misread a figure or add a remark before the header
- Scans: \`Extract data from PDF\` reads the text inside a PDF, so a scan with no text gives nothing. Save those pages as images
- Length: the whole text goes in one request, and the model’s context is 131072 tokens on OpenRouter’s list, so a longer statement can fail
- File name: the file goes to Drive as plain text with a \`.csv\` name
- Triggering: only files created in the folder after the workflow starts are picked up
- Your data: the text of a PDF goes to OpenRouter and the provider behind it, and an image goes to Google. Statements hold account numbers, so check both terms first
- Credentials: the JSON holds none

## README

```markdown
# Payment transactions from PDFs and images exported to CSV

An n8n workflow that watches a Google Drive folder. When a PDF or an image lands there, an AI model reads the payment transactions in it
and adds a category to each one. The result is saved as a CSV file in another Drive folder. PDFs go through OpenRouter, and images go
through Google's Gemini.

## What is inside

- `workflow.json`: the workflow as n8n exports it, 16 nodes. 12 of them run and four are sticky notes. It holds no credential.
- `README.md`: these notes.

## What we changed from the original copy

- `Send data to A.I.` named `meta-llama/llama-3.1-70b-instruct:free`. OpenRouter's public model list, read on 12 November 2026, no longer
  shows that name. The node now names `meta-llama/llama-3.1-70b-instruct`, which the list shows with a price per token.
- `Google Gemini Chat Model` named `models/gemini-1.5-pro-latest`, which Google's model and deprecation pages no longer list. It now
  names `models/gemini-3.6-flash`.
- The PDF text went into the request through `encodeURIComponent`, which turns it into percent codes. It now goes in with
  `JSON.stringify`, so the model reads plain text and a quote mark in a statement cannot break the request.
- The two `Convert to CSV` nodes made a CSV from the model's whole answer object, so the transactions ended up in one cell. They are now
  `Save CSV text as file` and `Save CSV text as file from image`. They write the answer text, which is already CSV, into a file.
- The upload name was `{{$today}}`. It is now the day's date followed by `.csv`.
- The author's two folder ids are now `<YOUR_INPUT_FOLDER_ID>` and `<YOUR_OUTPUT_FOLDER_ID>`.
- `Vertex A.I. extract text` is now `Gemini extract text from image`. The node it uses calls Google's Gemini API with a Google
  Gemini(PaLM) API key, not Vertex AI, and its note said otherwise.
- The sticky notes lost a link to the author's blog and an example service account email, which is now `<YOUR_SERVICE_ACCOUNT_EMAIL>`.
- Every credential link is gone. Select your own.
- Nothing else. The prompts, the routing and the polling are as they were.

## Before you start

- An n8n instance, on n8n Cloud or your own server.
- A Google service account with the Google Drive API turned on, and its key.
- Two Google Drive folders, one for the PDFs and images and one for the CSV files, both shared with the service account.
- An OpenRouter account with an API key and some credit, for the PDFs.
- A Google Gemini API key, for the images.

## Set it up

1. In n8n, create a workflow, open its menu and choose Import from File. Pick `workflow.json`.
2. Add a Google Service Account credential and select it in `Get PDF or Images`, `Download PDF`, `Download Image`,
   `Upload to Google Drive` and `Upload to Google Drive1`.
3. In `Get PDF or Images`, replace `<YOUR_INPUT_FOLDER_ID>` with the id of the folder to watch. It is the last part of the folder's address
   in Drive. In both upload nodes, replace `<YOUR_OUTPUT_FOLDER_ID>` with the id of the CSV folder.
4. Add a Header Auth credential with the name `Authorization` and the value `Bearer <YOUR_OPENROUTER_API_KEY>`. Select it in
   `Send data to A.I.`.
5. Add a Google Gemini(PaLM) API credential with your key and select it in `Google Gemini Chat Model`.
6. Click Test workflow, then drop a PDF with a few transactions into the input folder. Wait for the next poll and open the CSV folder.
   Then save and press Publish at the top of the canvas (or Shift+P).

## How a run goes

1. `Get PDF or Images` checks the input folder every minute for a new file.
2. `Route based on PDF or Image` sends a PDF down its first output and any file whose type contains `image/` down its second. Other
   files stop there.
3. For a PDF, `Download PDF` fetches the file and `Extract data from PDF` reads its text.
4. `Send data to A.I.` posts the text to OpenRouter and asks for all the transactions as CSV, with a column called `category`.
5. `Save CSV text as file` writes the answer into a file named `transactions.csv`, and `Upload to Google Drive` stores it in the output
   folder under the day's date.
6. For an image, `Download Image` fetches the file, and `Gemini extract text from image` sends it to `Google Gemini Chat Model` with a
   similar instruction.
7. `Save CSV text as file from image` and `Upload to Google Drive1` do the same for the image's answer.

## Change the look

- The folders: `Get PDF or Images` and the two upload nodes.
- The instructions: the message in `Send data to A.I.` for PDFs, and the two messages in `Gemini extract text from image` for images.
- The models: the `model` in the request of `Send data to A.I.`, and `Google Gemini Chat Model`.
- The name of the saved file: the `Name` in the two upload nodes.
- How often it checks: the poll time in `Get PDF or Images`.

## Good to know

- Not run: Mindket made no call to Google Drive, OpenRouter or Gemini. It ran the changed request expression on its own machine and
  read n8n's source for the file nodes.
- A model writes the CSV, so it can miss a line, misread a figure or add a remark before the header. Open each file and check the numbers.
- `Extract data from PDF` reads the text inside a PDF. A scan with no text in it gives nothing, so save those pages as images.
- The whole text goes in one request. The model's context is 131072 tokens on OpenRouter's list, and a longer statement can fail.
- The model is now a paid one, so each PDF costs a little on OpenRouter.
- The file goes to Drive as plain text with a `.csv` name. Two files made on one day get the same name.
- Only files that are created in the folder after the workflow starts are picked up.
- Your data: the text of a PDF goes to OpenRouter and the provider behind it, and an image goes to Google. Statements hold account
  numbers, so check both services' terms first. The CSV files stay in your Drive.
- Credentials: the JSON holds none.
```

## What is in it

3 files, 18 KB, downloaded as a zip.

```text
NOTICE.md  686 B
README.md  6 KB
workflow.json  12 KB
```

## Workflow check

Checked by Mindket on 13 Nov 2026. Read from the workflow’s file, not from a run.

- Steps: 11 steps, starting on a Google Drive event
- AI: 1 step calls an AI model: Gemini extract text from image
- Sign-ins: Signs in to: Google service account, openrouter.ai and Google Gemini
- API keys: No API key is left in the file
- Step types: Mindket’s checker reads all 7 of its step types

## Get it

- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/ae676e53-6b39-4268-9e45-11f466066cae)
- [Its page on Mindket](https://mindket.com/p/ae676e53-6b39-4268-9e45-11f466066cae)
