Automation library · E-commerce

Extract purchase order data to Excel with Telegram and OCR

Started by an incoming Telegram message, and works across Excel and Telegram. It hands the judgement calls to Gemini. 23 steps, 2 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
2Branches: places the flow splits
0Loops or waits
2Services it connects to

The flow

Starts it 1Model 1Logic 12Service 9

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

  1. 1Telegram TriggerTelegram triggerStarts it
  2. 2Detect File TypeCodeLogic
  3. 3Route by File TypeSwitchLogic
  4. 4Mapping PDFSetLogic
  5. 5Notifikasi file sedang diprosesTelegramService
  6. 6Mapping ImageSetLogic
  7. 7Notifikasi file invalidTelegramService
  8. 8Get PDFTelegramService
  9. 9Get ImageTelegramService
  10. 10Extract PDF TextExtract From FileService
  11. 11Extract Text from Image (OCR)Tesseract NodeService
  12. 12Clean PDF TextCodeLogic
  13. 13Clean OCR TextCodeLogic
  14. 14Prepare PDF DataSetLogic
  15. 15Prepare Image DataSetLogic
  16. 16Extract Structured Data (AI)Google GeminiModel
  17. 17Parse AI ResponseCodeLogic
  18. 18Validate Extracted DataCodeLogic
  19. 19Check Data ValidityIfLogic
  20. 20Format Data for ExcelCodeLogic
  21. 21Send Invalid Data NotificationTelegramService
  22. 22Save Data to ExcelMicrosoft ExcelService
  23. 23Send Success NotificationTelegramService

How it's built

Starts on
An incoming Telegram message
Steps
23, with 2 branches
Size
Large: read it before trusting it with anything live
Connects to
Excel, Telegram
Model
Gemini

Questions

What does it need to run?

An n8n account, plus your own Excel and Telegram accounts, and a key for Gemini. 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. 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.