A bot for the team's HR routine
Time off, shift swaps and payslips lived in work chats and got lost. The bot carries them from request to approval, and the manager runs everything from a familiar spreadsheet.
Outcome
- A request goes from submission to approval without a single chat message
- The manager runs the bot from a Google Sheet, never touching the server
- A shift swap cannot go through without the other person agreeing
- A time-off clash shows up on the request, not on the day two people fail to show up
- Role
- Full cycle: spec, build, deploy
- Time it took
- 1 week
The problem
Time off, days off and shift swaps were agreed in work chats. Some people messaged the manager directly, some posted in the group, some just said it out loud. The outcome was predictable: requests got lost, and clashes surfaced on the day two people both failed to show up.
Payslips were a story of their own. They have to reach each person individually, and you need to know who actually read theirs. Dropping files into a shared chat solves neither half.
What I built
The bot runs the whole cycle: request, manager approval, record in the log. The manager gets a message with two buttons and decides from their phone. A payslip arrives privately, with an "I have read this" button, so it is clear who confirmed.
Reminders go out on a schedule by themselves, with no manual "refresh" button.
When it fits
- Time off and swaps get agreed in chats. Someone messages the manager directly, someone posts in the group, and requests get lost.
- The manager does not want to log into a server for a small setting. The admin panel should be the one they already open every day.
- A shift swap can go through behind someone's back. It needs the other side's explicit confirmation, not a silent replacement.
The key decision: the spreadsheet is an admin panel, not a database
The manager should not have to log into a server to change the monthly day-off limit. So the admin panel is a Google Sheet, the one they already open daily.
What matters is not the spreadsheet itself but the direction data flows in. The source of truth always lives inside the bot. A sheet tab is either an input the person fills in, or an output log the bot rewrites in full. Never both at once: a tab edited from two sides eventually holds two different versions of the truth, and no check can then tell you which one is real.
Which tabs the bot overwrites is stated up front, rather than discovered on the day somebody's manual edit disappears.
Safeguards
One person's action on someone else's time never applies immediately. A shift swap is a request first, and only becomes fact once the other side confirms. Otherwise the schedule can be rewritten behind someone's back.
Settings (limits, reminder hour) live inside the bot rather than in a config file on the server. Anything the process owner is entitled to change should not require a developer.
Try it yourself
The «See it live» link opens a demo bot. After Start you get your own made-up team with a two-week schedule, and you are both an employee and the manager in it. Try booking time off on a day when two people are already away: the bot turns it down on its own. Or offer a colleague a shift swap and watch the schedule update once they agree.
In the demo the made-up colleagues answer by themselves within a few seconds, and there is no Google Sheet: everything lives inside the bot. Only you see your actions, and there is no real data in it.
Common questions
Could the manager accidentally overwrite someone else's data in the sheet? No. The direction data flows in is fixed: a tab is either an input a person fills in, or an output the bot rewrites in full, never both at once.
What if two employees ask for time off on the same days? The manager sees it right on the request card: who else is away on those days and whose request is still pending. If a limit on simultaneous absences is set, the bot rejects a request over it on its own, and checks again on Approve, since two requests could arrive at once. Sick leave is never blocked by the limit, only flagged.
Stack
- Python
- aiogram 3
- SQLite
- Google Sheets API
Got a similar task?
Describe it in two sentences. I'll tell you if it can be automated and roughly what it costs.