At a glance
- Trigger
- Gmail Trigger (Get invoice)
- Nodes
- 21
- Apps
- Gmail, Google Gemini, Google Sheets and Groq
- AI nodes
- 6
- Credentials
- 4 types
- Category
- Email automation
Apps and integrations
Node types used
How it works
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
B. Deal with the data
- Multiple payment info in one mail: input the "sender" of the emails that contain more than one payment info. e.g. credit card daily spend notification
- One payment info in one mail: input the "sender" of the emails that contain only one payment info. e.g. instant credit card spend notification
- Invoices: input the mails that contain one invoice in one mail
C. Get spend details and send to google sheet
- Edit the output schema to fit your google sheet format
- Edit the prompt to fit your needs
Setup notes
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
A. Get data
- Set up labels in Gmail
- Suggested using Gmail filters to move emails to labels automatically
Nodes in this workflow
The 21 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:
- Get invoice (Gmail Trigger)
- Get payment (Gmail Trigger)
- Extract invoice (Extract from File)
- Extract payment (Extract from File)
- HTML (HTML)".spend-table" here is an example when the email use "spend" html tags to display each spends. e.g. Spend 1 Spend 2
- Split Out (Split Out)
- Structured Output Parser1 (Structured Output Parser)
- Google Gemini Chat Model1 (Google Gemini Chat Model)
- Send (Google Sheets)
- Set data 0 (Edit Fields (Set))
- Set data 1 (Edit Fields (Set))
- Set data 2 (Edit Fields (Set))
- Invoice data (Edit Fields (Set))
- Payment data (Edit Fields (Set))
- Switch (Switch)
- Groq Chat Model (Groq Chat Model)
- Structured Output Parser (Structured Output Parser)
- Send1 (Google Sheets)
- Extract details1 (Basic LLM Chain)
- Merge (Merge)
- Extract details (Basic LLM Chain)
Credentials you need
- Gmail OAuth2 – used by Get invoice and Get payment
- Google Gemini (PaLM) API – used by Google Gemini Chat Model1
- Google Sheets OAuth2 – used by Send and Send1
- Groq API – used by Groq Chat Model
Configure your own credentials after importing. Create each credential in n8n, then select it in the node.
How to import into n8n
- Download the JSON file with the button above.
- In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
- Open each node that shows a warning and select or create its credential.
- Read the notes on the canvas, test the workflow with sample data, then activate it.
Do you need somewhere to run it? Read our guide to self-hosted n8n.