n8n

How to Automate Telegram Focus Logging to Google Sheets?

Turn Telegram into a simple focus timer that tracks work sessions and saves results to Google Sheets. Teams and students can run Pomodoro cycles, get reminders, and keep clean records without manual logging.

When a user messages the bot, commands are checked first. A start command kicks off a 25 minute deep work block, followed by a 5 minute short break. The bot sends clear notifications at each step. A counter runs in the background to loop up to four cycles. Each deep work session is written to Google Sheets with date, time, user ID, and cycle number. After four cycles, the bot records a long break and resets the state. A stop command can end a session early and clears variables. Static data lets many users run sessions at the same time in one workflow.

Setup needs a Telegram bot and access to a Google Sheet. Timing can be adjusted by changing the wait node values. Expect less manual tracking, better focus habits, and a simple sheet for reporting. Useful for remote teams, agencies, and study groups that already use Telegram for daily work.

What are the key features?

  • Telegram message trigger listens for user commands and routes them with If nodes.
  • /start begins a 25 minute deep work session and sends a start notification.
  • Wait nodes handle 25 minute focus blocks and 5 minute short breaks.
  • Code nodes store and update a per user cycle counter in global static data.
  • Google Sheets append writes each deep work and long break entry with date and time.
  • /stop ends the session early, sends a notice, and clears variables.
  • Loop runs up to four cycles, then triggers a long break and resets state.
  • Instruction message guides users when they send a non command text.

What are the benefits?

  • Reduce manual time tracking from 15 minutes a day to under 2 minutes
  • Automate 100 percent of reminders for work, short breaks, and long breaks
  • Improve data accuracy to near 100 percent with automatic timestamps
  • Support many users at once with per chat state management
  • Connect Telegram and Google Sheets to unify focus data in one place

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Telegram and Google Sheets. See the Tools Required section above for links to create accounts with these services.
  3. Create a Telegram bot token: In Telegram, chat with BotFather, create a new bot, and copy the bot token.
  4. In n8n, open the Telegram Trigger node, choose Credential to connect with, click Create new credential, and paste your bot token. Save the credential.
  5. In the Telegram Trigger node, ensure updates include message so the bot reacts to user texts.
  6. Open the Telegram message nodes and select the same Telegram credential so notifications can be sent.
  7. Prepare your Google Sheet with columns such as Date, Time, User ID, Session, and Cycle.
  8. Open the Google Sheets nodes, choose Credential to connect with, click Create new credential, then follow the on screen steps to sign in with Google and allow access.
  9. In each Google Sheets node, select the target spreadsheet and sheet, then confirm the field mapping matches your columns.
  10. Adjust timings: open the Wait nodes labeled Deep Work and Break and set minutes for focus and short breaks as needed.
  11. Initialize state: run the Initiate Static Data code node once so the global storage is created. You only need to do this one time.
  12. Enable the workflow, send /start to your bot in Telegram, wait for the first notifications, then check your Google Sheet for a new row. Test /stop to confirm it clears the session.
  13. Troubleshooting: if messages do not arrive, recheck the Telegram credential token and that the workflow is active. If rows do not write, confirm the Google Sheets credential and sheet permissions.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Sheets

Sign up

Free: $0 (Google Sheets API usage has no additional cost; quota limits apply)

Telegram

Sign up

Free: $0, Telegram Bot API usage is free for developers

Credits:
Author: Samir Saci. Tutorial: YouTube video

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.