Telegram + Google Sheets: attendance logs without mess
Attendance tracking gets messy fast when it lives in chat messages, paper notes, and “I’ll fix it later” spreadsheets. People forget to log, managers chase updates, and payroll ends up doing detective work instead of approving hours.
If you’re a team lead trying to keep timesheets honest, you already know the pain. Ops managers feel it at month-end. So do agency owners running small teams. This Telegram attendance logs automation gives you a clean record without turning you into the attendance police.
You’ll set up a Telegram bot that lets employees check in, check out, and view today’s status, while n8n writes clean rows to Google Sheets and blocks duplicates automatically.
How This Automation Works
Here’s the complete workflow you’ll be setting up:
n8n Workflow Template: Telegram + Google Sheets: attendance logs without mess
flowchart LR
subgraph sg0["Telegram Flow"]
direction LR
n0["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Telegram Trigger"]
n1@{ icon: "mdi:swap-horizontal", form: "rounded", label: "IF /start|/menu", pos: "b", h: 48 }
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Send Main Menu"]
n3@{ icon: "mdi:swap-horizontal", form: "rounded", label: "IF callback_query", pos: "b", h: 48 }
n4@{ icon: "mdi:cog", form: "rounded", label: "Aggregate", pos: "b", h: 48 }
n5@{ icon: "mdi:swap-horizontal", form: "rounded", label: "IF menu_attendance", pos: "b", h: 48 }
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Send Check In/Out Menu"]
n7@{ icon: "mdi:database", form: "rounded", label: "Sheets Read (employee)", pos: "b", h: 48 }
n8@{ icon: "mdi:database", form: "rounded", label: "Sheets Read (Attendance Stat..", pos: "b", h: 48 }
n9@{ icon: "mdi:swap-horizontal", form: "rounded", label: "IF employee", pos: "b", h: 48 }
n10["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Reply Attendance Status"]
n11@{ icon: "mdi:code-braces", form: "rounded", label: "Format Attendance Status", pos: "b", h: 48 }
n12["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Reply Not Employee"]
n13["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Reply Not Employee1"]
n14@{ icon: "mdi:database", form: "rounded", label: "Sheets Read (duplicate atten..", pos: "b", h: 48 }
n15@{ icon: "mdi:swap-horizontal", form: "rounded", label: "IF duplicate attendance", pos: "b", h: 48 }
n16["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Reply Duplicate Attendance"]
n17["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/telegram.svg' width='40' height='40' /></div><br/>Reply Attendance OK"]
n18@{ icon: "mdi:database", form: "rounded", label: "Sheets Read (employee)1", pos: "b", h: 48 }
n19@{ icon: "mdi:swap-horizontal", form: "rounded", label: "IF menu_attendance_status", pos: "b", h: 48 }
n20@{ icon: "mdi:swap-horizontal", form: "rounded", label: "IF Employee", pos: "b", h: 48 }
n21@{ icon: "mdi:database", form: "rounded", label: "Sheets Append (Attendance)", pos: "b", h: 48 }
n4 --> n11
n20 --> n14
n20 --> n13
n9 --> n8
n9 --> n12
n1 --> n2
n0 --> n1
n0 --> n5
n0 --> n19
n0 --> n3
n3 --> n18
n5 --> n6
n7 --> n9
n15 --> n16
n15 --> n21
n18 --> n20
n11 --> n10
n19 --> n7
n21 --> n17
n8 --> n4
n14 --> n15
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n1,n3,n5,n9,n15,n19,n20 decision
class n7,n8,n14,n18,n21 database
class n11 code
classDef customIcon fill:none,stroke:none
class n0,n2,n6,n10,n12,n13,n16,n17 customIcon
Why This Matters: Attendance Tracking Breaks Quietly
Attendance errors rarely look dramatic in the moment. It’s one “I forgot to check in,” one duplicate entry, one manager approving hours based on memory. Then it compounds. By the end of the week you’re sorting messages, scanning spreadsheets for duplicates, and trying to reconstruct what actually happened on Tuesday. That time doesn’t come back, and worse, the team loses trust when pay or hours feel inconsistent. Honestly, the worst part is the mental load: you’re always half-worried the sheet is wrong.
It adds up fast. Here’s where it breaks down in real teams.
- Check-ins arrive in different formats, so someone has to “normalize” the sheet by hand.
- Duplicates slip in when people tap the button twice or try again after a slow connection.
- Unregistered users can submit bogus logs unless you validate employees every time.
- Status questions (“Did I check out?”) interrupt managers all day and still don’t fix the data.
What You’ll Build: A Telegram Bot That Logs Clean Attendance Rows
This workflow turns Telegram into a simple attendance terminal your team will actually use. An employee opens your bot, taps Check-in or Check-out, and n8n immediately validates that they’re on your approved employee list in Google Sheets. If they’re not registered, the bot replies with a clear “not allowed” message and nothing gets logged. If they are registered, n8n checks today’s attendance history to prevent duplicates, then appends a clean row to your Attendance sheet. When someone asks for today’s status, the workflow looks up their entries, merges the results, formats a readable reply, and sends it back in Telegram. Everything stays in one place, ready for reporting.
The workflow starts with a Telegram message or button press. Google Sheets becomes the source of truth for employee validation and attendance logs. Finally, Telegram confirms what happened, so employees don’t guess and managers don’t have to.
What You’re Building
| What Gets Automated | What You’ll Achieve |
|---|---|
|
|
Expected Results
Say you have 15 employees. Without automation, even a “quick” process like DM’ing a manager and then updating a sheet can take about 2 minutes per check-in or check-out, plus another 30 minutes a week cleaning duplicates and chasing missing entries. That’s roughly 6 hours of admin work a week. With this workflow, employees tap once in Telegram and the bot confirms instantly, while Google Sheets updates in the background. You still review payroll, but you stop rebuilding the data.
Before You Start
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Telegram Bot for check-in/check-out and status replies
- Google Sheets to store employees and attendance rows
- Telegram API token (get it from BotFather)
Skill level: Beginner. You’ll connect accounts, copy a Sheet template, and map a few fields.
Want someone to build this for you? Talk to an automation expert (free 15-minute consultation).
Step by Step
A Telegram message or button tap triggers the workflow. The Telegram Update Trigger listens for /start, /menu, and menu selections, then routes the request to the right branch.
The workflow decides what the user is trying to do. Using simple “if/switch” logic, it separates check-in/check-out actions from “show me today’s status,” so you can keep the experience clean for employees.
Google Sheets validation and duplicate prevention happen next. n8n retrieves your Employee sheet to confirm the Telegram username (or ID) is registered, then looks up today’s attendance rows before it writes anything new.
Telegram confirms the result. If the entry is valid, the workflow appends a row to your Attendance sheet and replies with a confirmation message. If it’s a duplicate or an unregistered user, it replies with a clear warning instead.
You can easily modify the employee matching rules to use a different identifier (like employee ID) based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Telegram Trigger
This workflow starts when a Telegram update (message or callback query) is received. The trigger fans out into multiple branches for menu handling and check-in/out actions.
- Add and open Telegram Update Trigger.
- Credential Required: Connect your telegramApi credentials.
- Set Updates to include
messageandcallback_query. - Confirm the execution flow: Telegram Update Trigger outputs to Branch Start Or Menu, Branch Attendance Menu, Branch Status Menu, and Check Callback Action in parallel.
Step 2: Connect Google Sheets
Google Sheets is used for employee lookups and attendance tracking. Multiple nodes share the same sheet, so connect credentials consistently.
- Open Retrieve Employee Sheet and set Document ID to your spreadsheet ID (replace
[YOUR_ID]). - In Retrieve Employee Sheet, set the filter lookupColumn to
username_telegramand lookupValue to{{ $json.callback_query.from.username }}. - Open Fetch Attendance Status and set filters for username_telegram to
{{ $json.username_telegram }}and date to{{ $today.format('dd-MM-yyyy') }}. - Open Lookup Duplicate Attendance and confirm filters include attendance_type with
{{ $('Check Callback Action').item.json.callback_query.data }}. - Open Append Attendance Row and confirm Operation is
appendwith column mappings fordate,time,timestamp_iso, andattendance_type. - Credential Required: Connect your googleSheetsOAuth2Api credentials for all Google Sheets nodes (Retrieve Employee Sheet, Fetch Attendance Status, Lookup Duplicate Attendance, Retrieve Employee Sheet Alt, Append Attendance Row).
Employee or Attendance, the filters won’t return data. Update the Sheet Name in each Google Sheets node.Step 3: Set Up Processing and Branching Logic
Branching logic decides whether to show menus, check employee records, prevent duplicates, or return status messages.
- In Branch Start Or Menu, verify the regex condition uses
{{ String($json.message?.text || $json.channel_post?.text || '') }}and matches^/(start|menu)$. - In Branch Attendance Menu and Branch Status Menu, confirm the conditions check
{{ $json.callback_query?.data || '' }}formenu_attendanceandmenu_attendance_status. - In Check Callback Action, keep Combine Operation as
anyto matchcheckinorcheckout. - Ensure Validate Employee Record and Validate Employee Alt use the boolean condition
{{ $json.isNotEmpty() }}to gate access. - Open Format Status Message and keep the function that builds the check-in/out status text exactly as provided.
Step 4: Configure Telegram Output Nodes
Telegram nodes deliver menus, confirmations, and error notices. This workflow includes multiple Telegram nodes, so apply the same credentials and confirm message mappings.
- In Deliver Main Options, set Chat ID to
{{ $json.message?.chat?.id }}and keep the inline keyboard buttons formenu_attendanceandmenu_attendance_status. - In Deliver Check In Out Menu, set Chat ID to
{{ $json.callback_query.message.chat.id }}and keep buttons forcheckinandcheckout. - In Send Status Reply, set Text to
{{ $json.text }}and Chat ID to{{ $('Branch Status Menu').item.json.callback_query.message.chat.id }}. - In Warn Duplicate Attendance, confirm the message uses
=Your {{ $('Check Callback Action').item.json.callback_query.data}} has already been recorded ⚠️. - In Confirm Attendance Logged, keep the conditional text expression
{{ $('Check Callback Action').item.json.callback_query.data === 'checkin' ? 'Check-in recorded. ⏰' : 'Check-out recorded. 🏁' }}. - Credential Required: Connect your telegramApi credentials for all Telegram nodes (Deliver Main Options, Deliver Check In Out Menu, Send Status Reply, Notify Not Employee, Notify Not Employee Alt, Warn Duplicate Attendance, Confirm Attendance Logged).
Step 5: Test and Activate Your Workflow
Run a controlled test to validate menu routing, attendance logging, and duplicate detection before turning the workflow on.
- Click Execute Workflow and send
/startto your Telegram bot to trigger Deliver Main Options. - Tap 🕘 Check In/Out and confirm Deliver Check In Out Menu appears.
- Perform a
checkinand verify Append Attendance Row writes to theAttendancesheet and Confirm Attendance Logged sends a message. - Use the status menu option and confirm Send Status Reply displays the formatted summary from Format Status Message.
- When everything works as expected, toggle the workflow to Active.
Troubleshooting Tips
- Telegram credentials can expire or be configured with the wrong bot token. If replies stop working, check the Telegram credential in n8n first and confirm it matches the token from BotFather.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Google Sheets lookups fail quietly when the sheet name, column headers, or sharing permissions change. Verify the template tabs (Employee/Attendance) and re-check the Google Sheets credential access.
Quick Answers
About 30 minutes if your bot and Sheet are ready.
No. You’ll mostly connect Telegram and Google Sheets, then map a few fields in n8n.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI API costs if you keep the AI nodes enabled, which are usually small for short messages.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and it’s common. You can change how employees are matched by editing the Google Sheets “Retrieve Employee Sheet” lookup and the “Validate Employee Record” / “Validate Employee Alt” checks (for example, match on employee ID instead of Telegram username). People also customize the “Append Attendance Row” fields to include location, project code, or shift name, and tweak “Format Status Message” to match the wording your team expects.
Usually it’s the bot token. Regenerate or re-copy the token from BotFather and update your Telegram credentials in n8n, then re-test the trigger. Also confirm the bot is the one employees are messaging (teams sometimes set up two bots and wire the wrong one). If it works sometimes and fails during busy periods, Telegram rate limits can be the culprit, so reduce noisy replies and avoid sending multiple messages per tap.
For most small teams, it’s effectively “as much as you need.” On n8n Cloud, your monthly execution limit depends on the plan, and each check-in/check-out is typically one execution. If you self-host, there’s no platform execution cap, but your server and Google Sheets API limits still matter. Practically, teams can handle dozens of employees logging twice a day without issues, especially if your Sheet lookups are optimized and you keep the bot replies simple.
Often, yes, if you care about validation and duplicates. This workflow relies on branching logic (menu routing, employee checks, duplicate lookups), and n8n handles that kind of “if this, then that, otherwise reply” flow cleanly. You also get the option to self-host for unlimited executions, which matters when every check-in is an execution. Zapier or Make can be fine for a simple “Telegram message → add row,” but once you add status lookups and guardrails, costs and complexity tend to creep up. If you want a second opinion for your exact team size and process, Talk to an automation expert.
Once this is running, attendance becomes a quick habit instead of a weekly repair job. Your sheet stays clean, your team gets instant confirmation, and payroll stops guessing.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.