# Analyze invoices from Google Drive with Gemini and OpenAI: n8n workflow

> Started by an incoming Telegram message, and works across Google Drive, Google Sheets and Telegram. It hands the judgement calls to Gemini and OpenAI.

Source: https://millionrounds.com/workflow/analyze-invoices-from-google-drive-with-gemini-and-openai (Millionrounds; every figure on the page links to its filing or article)

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

# Analyze invoices from Google Drive with Gemini and OpenAI

Started by an incoming Telegram message, and works across Google Drive, Google Sheets and Telegram. It hands the judgement calls to Gemini and OpenAI. 19 steps, 1 branch, 2 loops or waits: a working afternoon to understand properly.

Medium Calls a model: Gemini, OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fanalyze-invoices-from-google-drive-with-gemini-and-openai)

**19 steps** Medium: a working afternoon

**1** Branch: places the flow splits

**2** Loops or waits

**3** Services it connects to

## The flow

Starts it 2 Model 3 Logic 7 Service 7

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

- 1 **Telegram Trigger** Telegram trigger *Starts it*
- 2 **Google Drive Trigger** Google Drive trigger *Starts it*
- 3 **Save_drive** Google Drive *Service*
- 4 **Mapeo** Set *Logic*
- 5 **Loop Over Items** Split In Batches *Logic*
- 6 **Switch** Switch *Logic*
- 7 **download image** Google Drive *Service*
- 8 **Download PDF** Google Drive *Service*
- 9 **Download image** Google Drive *Service*
- 10 **analyze image** Open Ai *Model*
- 11 **analyze document** Google Gemini *Model*
- 12 **analyze image1** Open Ai *Model*
- 13 **Edit Fields1** Set *Logic*
- 14 **Edit Fields** Set *Logic*
- 15 **Edit Fields2** Set *Logic*
- 16 **Put data in table1** Google Sheets *Service*
- 17 **Put data in table** Google Sheets *Service*
- 18 **Put data in table2** Google Sheets *Service*
- 19 **Wait** Wait *Logic*

## How it's built

- **Starts on:** An incoming Telegram message
- **Steps:** 19, with 1 branch, 2 loops or waits
- **Size:** Medium: a working afternoon
- **Connects to:** Google Drive, Google Sheets, Telegram
- **Model:** Gemini, OpenAI

## Questions

What does it need to run?

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

What starts it?

It starts on an incoming Telegram message.

Does it use AI?

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

How long does it take to set up?

Plan an afternoon. 19 steps is enough that you should read each one before running it.

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 19 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%2Fanalyze-invoices-from-google-drive-with-gemini-and-openai)
- **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.

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

## Workflows like it

Also money admin, with the same services where possible, closest in size first.

- [**Automate personalized Upwork proposals with OpenAI** 19 steps · calls a model · Google Docs, Google Drive](https://millionrounds.com/workflow/automate-personalized-upwork-proposals-with-openai)
- [**Process scanned invoices with Google Drive and OCR** 19 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/process-scanned-invoices-with-google-drive-and-ocr)
- [**Score Upwork jobs and generate proposals with Apify and OpenAI** 19 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/score-upwork-jobs-and-generate-proposals-with-apify-and-open)
- [**AAAS: AI Accounts Assistant for Invoices, GST & Reminders** 19 steps · Google Drive, Google Sheets](https://millionrounds.com/workflow/aaas-ai-accounts-assistant-for-invoices-gst-and-reminders)
- [**Automate payment gateway & database transaction reconciliation** 19 steps · Email, Google Sheets](https://millionrounds.com/workflow/automate-payment-gateway-and-database-transaction-reconcilia)
- [**Automated event management with Typeform and Stripe** 19 steps · Gmail, Google Calendar](https://millionrounds.com/workflow/automated-event-management-with-typeform-and-stripe)
