# Attendance system with OpenAI and Google Sheets: n8n workflow

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

Source: https://millionrounds.com/workflow/attendance-system-with-openai-and-google-sheets (Millionrounds; every figure on the page links to its filing or article)

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

# 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.

Large Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fattendance-system-with-openai-and-google-sheets)

**41 steps** Large: read it before trusting it with anything live

**9** Branches: places the flow splits

**1** Loop or waits

**2** Services it connects to

## The flow

Starts it 2 Model 1 Logic 25 Service 13

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

- 1 **Telegram Trigger** Telegram trigger *Starts it*
- 2 **When clicking 'Test workflow'** Manual trigger *Starts it*
- 3 **find required fields** Set *Logic*
- 4 **allow only specific group** Filter *Logic*
- 5 **filter chatId** Filter *Logic*
- 6 **sanitise message** Code *Logic*
- 7 **Merge** Merge *Logic*
- 8 **Merge3** Merge *Logic*
- 9 **Merge4** Merge *Logic*
- 10 **Merge5** Merge *Logic*
- 11 **Merge6** Merge *Logic*
- 12 **Merge7** Merge *Logic*
- 13 **Merge8** Merge *Logic*
- 14 **Merge9** Merge *Logic*
- 15 **Merge10** Merge *Logic*
- 16 **if IN** If *Logic*
- 17 **reply to IN** Telegram *Service*
- 18 **suggest mark In before OUT** Telegram *Service*
- 19 **reply to OUT** Telegram *Service*
- 20 **suggest mark OUT before IN again** Telegram *Service*
- 21 **suggest In before OUT** Telegram *Service*
- 22 **insert IN** Google Sheets *Service*
- 23 **suggest user** Telegram *Service*
- 24 **Merge1** Merge *Logic*
- 25 **get latest data for user for in** Google Sheets *Service*
- 26 **Merge2** Merge *Logic*
- 27 **if OUT** If *Logic*
- 28 **insert IN1** Google Sheets *Service*
- 29 **if no IN records found** If *Logic*
- 30 **insert IN2** Google Sheets *Service*
- 31 **get latest data for user for OUT** Google Sheets *Service*
- 32 **If message not empty** If *Logic*
- 33 **is latest status OUT** If *Logic*
- 34 **if no data** If *Logic*
- 35 **decide if attendance mistake message** Open Ai *Model*
- 36 **If before 10 hours** If *Logic*
- 37 **If current status IN** If *Logic*
- 38 **If attendance mistake message** If *Logic*
- 39 **update OUT** Google Sheets *Service*
- 40 **Wait** Wait *Logic*
- 41 **get data with hours spent** Google Sheets *Service*

## 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.

## 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%2Fattendance-system-with-openai-and-google-sheets)
- **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 Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)

## Workflows like it

Also chat assistants, with the same services where possible, closest in size first.

- [**Generate consensus-based answers with Claude and OpenAI** 41 steps · calls a model · Gmail, Slack](https://millionrounds.com/workflow/generate-consensus-based-answers-with-claude-and-openai)
- [**Forex AI trading assistant for Telegram with Position Sizing** 40 steps · calls a model · Telegram](https://millionrounds.com/workflow/forex-ai-trading-assistant-for-telegram-with-position-sizing)
- [**Automate YouTube Shorts creation from Telegram prompts** 39 steps · calls a model · Google Drive, Telegram](https://millionrounds.com/workflow/automate-youtube-shorts-creation-from-telegram-prompts)
- [**Smart kitchen & inventory assistant with OpenAI** 43 steps · calls a model · Google Sheets, Telegram](https://millionrounds.com/workflow/smart-kitchen-and-inventory-assistant-with-openai)
- [**AI Email Agent with Gmail and Telegram Approval** 38 steps · calls a model · Gmail, Redis](https://millionrounds.com/workflow/ai-email-agent-with-gmail-and-telegram-approval)
- [**AI advanced automation agent with Azure OpenAI and Gmail** 45 steps · calls a model · Gmail, Telegram](https://millionrounds.com/workflow/ai-advanced-automation-agent-with-azure-openai-and-gmail)
