# Extract spending history from Gmail to google sheet: n8n workflow

> Started by an arriving email, and works across Gmail and Google Sheets. It hands the judgement calls to Gemini and Groq.

Source: https://millionrounds.com/workflow/extract-spending-history-from-gmail-to-google-sheet (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Data collection](https://millionrounds.com/workflows?category=Data+collection#library)

# Extract spending history from Gmail to google sheet

Started by an arriving email, and works across Gmail and Google Sheets. It hands the judgement calls to Gemini and Groq. 21 steps, 1 branch: large, and worth reading before you trust it with anything live.

Large Calls a model: Gemini, Groq

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fextract-spending-history-from-gmail-to-google-sheet)

**21 steps** Large: read it before trusting it with anything live

**1** Branch: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 2 Model 6 Logic 9 Service 4

The steps in the order they run, from what starts it.

- 1 **Get invoice** Gmail trigger *Starts it*
- 2 **Get payment** Gmail trigger *Starts it*
- 3 **Structured Output Parser1** Output Parser Structured *Model*
- 4 **Google Gemini Chat Model1** Lm Chat Google Gemini *Model*
- 5 **Groq Chat Model** Lm Chat Groq *Model*
- 6 **Structured Output Parser** Output Parser Structured *Model*
- 7 **Extract invoice** Extract From File *Service*
- 8 **Extract payment** Extract From File *Service*
- 9 **Extract details** Chain Llm *Model*
- 10 **Extract details1** Chain Llm *Model*
- 11 **Invoice data** Set *Logic*
- 12 **Payment data** Set *Logic*
- 13 **Send** Google Sheets *Service*
- 14 **Send1** Google Sheets *Service*
- 15 **Switch** Switch *Logic*
- 16 **HTML** Html *Logic*
- 17 **Set data 1** Set *Logic*
- 18 **Set data 2** Set *Logic*
- 19 **Split Out** Split Out *Logic*
- 20 **Merge** Merge *Logic*
- 21 **Set data 0** Set *Logic*

## How it's built

- **Starts on:** An arriving email
- **Steps:** 21, with 1 branch
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Google Sheets
- **Model:** Gemini, Groq

## Questions

What does it need to run?

An n8n account, plus your own Gmail and Google Sheets accounts, and a key for Gemini and Groq. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an arriving email.

Does it use AI?

Yes. It calls Gemini and Groq. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 21 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 21 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fextract-spending-history-from-gmail-to-google-sheet)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)

## Workflows like it

Also data collection, with the same services where possible, closest in size first.

- [**ACOP - bank account opening AI agent with Gemini** 21 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/acop-bank-account-opening-ai-agent-with-gemini)
- [**Automate HR celebrations with Gemini and Sheets** 21 steps · calls a model · Google Sheets](https://millionrounds.com/workflow/automate-hr-celebrations-with-gemini-and-sheets)
- [**Automating SAP B1 journal entries with JSON and Google Sheets** 21 steps · calls a model · Google Sheets](https://millionrounds.com/workflow/automating-sap-b1-journal-entries-with-json-and-google-sheet)
- [**Build an EU AI Act risk inventory with OpenAI** 21 steps · calls a model · Email, Google Sheets](https://millionrounds.com/workflow/build-an-eu-ai-act-risk-inventory-with-openai)
- [**Cluster webpage topics from Google Sheets** 21 steps · calls a model · Google Sheets](https://millionrounds.com/workflow/cluster-webpage-topics-from-google-sheets)
- [**Customer personality (BaZi, DISC, Numerology) with Gemini** 21 steps · calls a model · Google Sheets](https://millionrounds.com/workflow/customer-personality-bazi-disc-numerology-with-gemini)
