Automation library · Chat assistants

Attendance system with OpenAI and Google Sheets

Started by an incoming Telegram message, and works across Google Sheets and Telegram. It hands the judgement calls to OpenAI. 41 steps, 9 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

41 stepsLarge: read it before trusting it with anything live
9Branches: places the flow splits
1Loop or waits
2Services it connects to

The flow

Starts it 2Model 1Logic 25Service 13

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

  1. 1Telegram TriggerTelegram triggerStarts it
  2. 2When clicking 'Test workflow'Manual triggerStarts it
  3. 3find required fieldsSetLogic
  4. 4allow only specific groupFilterLogic
  5. 5filter chatIdFilterLogic
  6. 6sanitise messageCodeLogic
  7. 7MergeMergeLogic
  8. 8Merge3MergeLogic
  9. 9Merge4MergeLogic
  10. 10Merge5MergeLogic
  11. 11Merge6MergeLogic
  12. 12Merge7MergeLogic
  13. 13Merge8MergeLogic
  14. 14Merge9MergeLogic
  15. 15Merge10MergeLogic
  16. 16if INIfLogic
  17. 17reply to INTelegramService
  18. 18suggest mark In before OUTTelegramService
  19. 19reply to OUTTelegramService
  20. 20suggest mark OUT before IN againTelegramService
  21. 21suggest In before OUTTelegramService
  22. 22insert INGoogle SheetsService
  23. 23suggest userTelegramService
  24. 24Merge1MergeLogic
  25. 25get latest data for user for inGoogle SheetsService
  26. 26Merge2MergeLogic
  27. 27if OUTIfLogic
  28. 28insert IN1Google SheetsService
  29. 29if no IN records foundIfLogic
  30. 30insert IN2Google SheetsService
  31. 31get latest data for user for OUTGoogle SheetsService
  32. 32If message not emptyIfLogic
  33. 33is latest status OUTIfLogic
  34. 34if no dataIfLogic
  35. 35decide if attendance mistake messageOpen AiModel
  36. 36If before 10 hoursIfLogic
  37. 37If current status INIfLogic
  38. 38If attendance mistake messageIfLogic
  39. 39update OUTGoogle SheetsService
  40. 40WaitWaitLogic
  41. 41get data with hours spentGoogle SheetsService

How it's built

Starts on
An incoming Telegram message
Steps
41, with 9 branches, 1 loop or waits
Size
Large: read it before trusting it with anything live
Connects to
Google Sheets, Telegram
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Google Sheets and Telegram accounts, and a key for 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 OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

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