Automation library · Data collection

Track menu cost ratios from delivery-note photos with Gemini

Started by a clock, and works across Gmail, Google Drive and Google Sheets. It hands the judgement calls to Gemini. 23 steps, 3 branches: large, and worth reading before you trust it with anything live.

LargeCalls a model: Gemini

23 stepsLarge: read it before trusting it with anything live
3Branches: places the flow splits
0Loops or waits
3Services it connects to

The flow

Starts it 2Model 3Logic 9Service 9

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

  1. 1Every morning at 8:00Schedule triggerStarts it
  2. 2GeminiLm Chat Google GeminiModel
  3. 3New invoice photo in DriveGoogle Drive triggerStarts it
  4. 4ConfigSetLogic
  5. 5Suggest actions with AIChain LlmModel
  6. 6Photo or daily check?SwitchLogic
  7. 7Email the alertGmailService
  8. 8Download the photoGoogle DriveService
  9. 9Read ingredientsGoogle SheetsService
  10. 10Read the invoice with GeminiGoogle GeminiModel
  11. 11Read recipesGoogle SheetsService
  12. 12Parse and convert to base unitsCodeLogic
  13. 13Read menuGoogle SheetsService
  14. 14Do the line items add up?IfLogic
  15. 15Compute cost ratiosCodeLogic
  16. 16Split out line itemsSplit OutLogic
  17. 17Ask for a human checkGmailService
  18. 18Write results to Menu sheetGoogle SheetsService
  19. 19Collect alertsCodeLogic
  20. 20Update ingredient pricesGoogle SheetsService
  21. 21Anything over target?IfLogic
  22. 22Confirm what was updatedGmailService
  23. 23All within target - stay quietNo OpLogic

How it's built

Starts on
A clock
Steps
23, with 3 branches
Size
Large: read it before trusting it with anything live
Connects to
Gmail, Google Drive, Google Sheets
Model
Gemini

Questions

What does it need to run?

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

What starts it?

It starts on a clock.

Does it use AI?

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

How long does it take to set up?

Take your time. At 23 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 23 steps before you point it at anything that matters.