Nanosaur2-670M
well9472 · Kit
Makes illustrations from text prompts with a small 670M-parameter diffusion model, run through ComfyUI. Built as a low-budget research model for people who wan…
An n8n workflow that reads spending emails under two Gmail labels, opens their PDFs, and asks Gemini or Groq for the date, service, amount, category and currency. It adds one row for each payment to your Google Sheet.
Spending emails in Gmail logged to a Google Sheet by AI is an n8n workflow in the Finance & accounting category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.
New labelled email
It starts when a new email arrives under one of two Gmail labels, checked every minute. It brings:
A Google Sheet with one row for each payment, holding its date, service, details, amount, category and currency
What you need before you start.
Mail source
Watches two labels and downloads the attachments of new mail.
NeedsA Gmail OAuth2 credential
Language model
Reads the emails with several payments or one payment. The copy asks for gemini-3.8-flash.
NeedsA Google AI API key
Language model
Reads the invoices. The copy asks for llama-3.3-70b-versatile.
NeedsA Groq API key
Spreadsheet
Appends one row for each payment.
NeedsA Google Sheets OAuth2 credential and a tab with eight named columns
Checked by Mindket on 13 Nov 2026
This n8n workflow turns spending emails into rows in a Google Sheet. Two Gmail triggers watch an invoice label and a payment label, and download each email’s attachments. A PDF is opened with a password if you give one, and its text joins the email’s text. A Switch node sorts the mail by sender into three groups: emails that list several payments, emails about one payment, and invoices. The first group is cut into one piece per payment. Gemini reads the first two groups and Groq reads the invoices, and each returns the date, service, details, amount, category and currency. A Sheets node then appends one row. The file holds twenty-one nodes beside three sticky notes.
Freelancers, households and small teams who get card alerts and invoices by email and want them in one sheet. Skip it if your payments never reach Gmail, or if you do not want mail text sent to Google and Groq.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Personal finance | Households | Track card spending without typing it in | A parent labels the bank’s alert emails and sees each purchase as a row. |
| Freelance | Self-employed workers | Collect invoices before tax time | A freelancer labels supplier invoices and gets the date, amount and category of each. |
| Accounting | Bookkeepers | Pre-fill a ledger from a client’s mail | A bookkeeper reviews the rows that a client’s labelled receipts produce. |
| Retail | Small shop owners | Log supplier invoices | A shop owner labels delivery invoices and checks the totals by category. |
You need to know n8n and Gmail’s labels: import a file, add four credentials, write sender rules and prepare a sheet.
An n8n that can reach Gmail, Google, Groq and Google Sheets will run it.
Download saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Most of the setup is the sender rules and the sheet.
| Need | Detail |
|---|---|
| n8n | On n8n Cloud or on a server of your own |
| Gmail | An OAuth2 credential and two labels |
| Gemini | A Google AI API key |
| Groq | An API key |
| Google Sheets | An OAuth2 credential and a tab called Expenses with eight named columns |
workflow.json.Get invoice and Get payment, add your Gmail credential and pick the matching label.Switch, replace <YOUR_MULTI_PAYMENT_SENDER> with the address that sends mail listing several payments. In the other two rules, replace <YOUR_SINGLE_PAYMENT_SENDERS> with the senders of one-payment mail, separated by |.<YOUR_PDF_PASSWORD> in Extract invoice and Extract payment.Google Gemini Chat Model1 and a Groq credential in Groq Chat Model.Send and Send1, and replace <YOUR_SHEET_ID> in both with your sheet’s id.Label an email, or let your Gmail filter label it. Within a minute a row appears in your sheet. Check the first rows for the right category and currency before you label more.
| To change | Where |
|---|---|
| Which mail goes where | The three rules in Switch |
| The categories and currencies | The schemas in Structured Output Parser and Structured Output Parser1 |
| How the model reads the mail | The messages in Extract details and Extract details1 |
| The columns | The mapping in Send and Send1, and row 1 of your tab |
A card alert lists three purchases in one email. The multi-payment rule sends it to the model once for each purchase, and one of the results looks like this.
{"date": "2026-11-09 18:42", "service": "Uber Eats", "details": "Dinner delivery", "amount": 18.5, "category": "Food & Beverage", "currency": "USD", "card": "Visa 1234"}The workflow adds three rows to your sheet, one for each purchase, with the card in the payment column.
If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. This one reads mail, sorts it, asks a model for the figures and writes a row. Start with one labelled email and check its row.
For experts. Two triggers share one sorting step and two models share one sheet.
| Node | What it does | What to know |
|---|---|---|
Switch | Sorts mail by sender into three outputs | The first rule that matches wins, so the invoice rule catches all other mail |
HTML | Picks every .spend-table element from a multi-payment email | It only works when the sender marks each payment with that class |
Extract details | Chain with Gemini and a schema that includes card | It reads the first two groups |
Extract details1 | Chain with Groq and a schema without card | It reads the invoices |
Send and Send1 | Append rows to your Expenses tab | Row 1 must hold the eight names |
Mail text goes to two AI providers, so label only mail you are happy to share.
gemini-1.5-flash, so this copy asks for gemini-3.8-flash. Groq retired llama-3.2-11b-text-preview, so it asks for llama-3.3-70b-versatiledate, service, details, amount, category, currency, payment and source, or the sheet step stopsAn n8n workflow that turns spending emails into rows in a Google Sheet. It watches two Gmail labels, one for invoices and one
for payment notices, and opens any PDF attached to them. An AI model then reads each email and returns the date, the
service, the details, the amount, the category and the currency. Each payment becomes one row.
workflow.json: the workflow as n8n exports it, twenty-four nodes. Three are sticky notes. It holds no credential.README.md: these notes.gemini-1.5-flash, which Google's model pages no longer list. Google Gemini Chat Model1gemini-3.8-flash, Google's current Flash model.llama-3.2-11b-text-preview. Groq's deprecation page says that model was replaced by anGroq Chat Model now asks for llama-3.3-70b-versatile, which<YOUR_INVOICE_LABEL_ID>, <YOUR_PAYMENT_LABEL_ID>, <YOUR_PDF_PASSWORD> and <YOUR_SHEET_ID>.Switch held the sender addresses of the author's own banks. Its rules now hold the placeholders<YOUR_MULTI_PAYMENT_SENDER> and <YOUR_SINGLE_PAYMENT_SENDERS>.Extract details named one bank. It now says that 0 means an email with several payments and 1 means ancard field listed the author's card names and their last digits. It is now free text, so the model writes the cardExpenses. The original pointed at a tab by its number.Expenses. Row 1 holds these eight names: date, service, details, amount,category, currency, payment and source. If one is missing, the sheet step stops and says the column names wereworkflow.json.Get invoice and Get payment, add your Gmail OAuth2 credential and pick the matching label. This replaces theSwitch, replace <YOUR_MULTI_PAYMENT_SENDER> with the address that sends mail listing several payments, such as a<YOUR_SINGLE_PAYMENT_SENDERS> with the senders of one-payment|.<YOUR_PDF_PASSWORD> in Extract invoice and Extract payment. Otherwise theGoogle Gemini Chat Model1 and a Groq credential in Groq Chat Model.Send and Send1, and replace <YOUR_SHEET_ID> in both with your sheet's id,/d/ and /edit.Get invoice and Get payment pick up new mail with their label and download its attachments. Extract invoice andExtract payment read the first attachment as a PDF. An email with no attachment carries on without it.Invoice data and Payment data join the email's text and the PDF's text. Switch then sorts the mail by sender.HTML, which picks every element with the class spend-table. Split OutSet data 0 marks it as type 0.Set data 1, type 1. Both paths meet in Merge and go to Extract details.Send appends the row, with the card in the payment column.Set data 2 and Extract details1. Groq reads it, and Send1 appends the row with an emptypayment.Switch..spend-table in HTML.Structured Output Parser andStructured Output Parser1.Extract details and Extract details1.Send and Send1, and row 1 of your tab.Switch, no mail matches the first two rules, so all mail takes the invoicesource column always holds the word n8n.NOTICE.md 626 B README.md 6 KB workflow.json 34 KB
well9472 · Kit
Makes illustrations from text prompts with a small 670M-parameter diffusion model, run through ComfyUI. Built as a low-budget research model for people who wan…
Waqf-AI · Kit
Reads handwritten Arabic text from images and returns it as text. A fine-tuned PaddleOCR-VL model for people digitizing Arabic handwriting.
Wan-AI · Kit
Makes video clips from a text prompt or an image plus text, at up to 720P and 24 frames per second, in the Diffusers format for a single consumer GPU.
NeoQuasar · Kit
Forecasts financial candlestick series with a 4.1M-parameter foundation model trained on data from over 45 exchanges. For quant researchers and developers who…
An n8n workflow that sends a Hebrew WhatsApp reminder for an unpaid invoice 7, 14 and 30 days after its due date. It reads the open invoices from a Google Shee…
An n8n workflow that files invoices. It watches a Google Drive folder, has LlamaParse read each new file and an OpenAI model pick out the line items. Airtable…