Custom Pomodoro Tracker via Telegram and Google Sheets Logging - n8n Workflow

Implement a stateful Pomodoro technique tracker using an n8n workflow. Start, stop, and log 25-minute deep work cycles to Google Sheets via Telegram commands.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Developers looking for complex n8n templates involving static state management.
Productivity enthusiasts who use the Pomodoro technique and want automated tracking.
Remote teams needing a simple way to track deep work sessions via a chat interface.
Users who want to integrate messaging apps with data logging via an n8n workflow.

Overview

This robust n8n workflow transforms your Telegram chat into a powerful, multi-user Pomodoro timer. It solves the challenge of maintaining user state within a stateless automation environment by utilizing n8n's global static data feature. When a user sends a command like /start, the n8n trigger initiates a 25-minute deep work session followed by a short break, automatically notifying the user at each transition via Telegram. Crucially, every completed deep work cycle and the resulting long break are meticulously recorded in Google Sheets, providing valuable analytics for tracking productivity. This advanced n8n node combination ensures high reliability and personalized tracking for multiple users simultaneously, making it one of the most effective n8n templates for boosting focus and tracking time. This reusable n8n workflow minimizes interruptions by managing the timing automatically.

How it Works

The n8n workflow starts with the Telegram trigger waiting for any incoming user message.


  1. Initialization: A critical prerequisite is running the Initiate Static Data Code n8n node once manually to set up the global storage object needed for state tracking.

  2. Trigger & Routing: The Telegram Trigger activates upon a message. The subsequent If n8n node checks if the message is a command (starts with /). If it is not, an instructional message is sent. If it is a command, the flow proceeds to determine if it is /start or /stop.

  3. Start Session: If /start is detected, the user receives a “Time to focus!” notification. The flow then enters a 25-minute delay using the Deep Work Wait n8n node.

  4. Cycle Completion & Tracking: After the delay, a break notification is sent, followed by a short delay (Break n8n node). The Increment Count Code n8n node then executes, fetching the user's state from n8n static data, incrementing the session count, and ensuring a unique Working Session ID is set for the current Pomodoro session.

  5. Data Logging: The Record Deep Work Google Sheets n8n node logs the completed 25-minute block, including the user ID, session ID, and cycle count, into the designated spreadsheet.

  6. Looping Logic: The < 4 Cycles If n8n node checks the count. If the user has completed 4 or fewer cycles, the n8n workflow loops back to start the next 25-minute block.

  7. Long Break & Cleanup: If the user completes more than 4 cycles, they are routed to a Long Break Notification. The Record Long Break Google Sheets n8n node logs the final rest period, and the Clear Variables2 Code n8n node resets the user's state in the n8n static data.

  8. Stop Command: If /stop is received at any point, the session ends, a notification is sent, and the Clear Variables1 Code n8n node removes the user’s session data from the n8n workflow state.

Installation Guide

To deploy this powerful n8n workflow, follow these setup steps:


  1. Import: Import the provided n8n workflow JSON into your n8n instance using the Import feature.

  2. Initialize Static Data: Manually execute the Initiate Static Data Code n8n node once before activating the main workflow. This step is mandatory for creating the global state tracking object within the n8n environment.

  3. Telegram Configuration: Configure credentials for all Telegram nodes. The Telegram Trigger must be set up with your bot token to listen for incoming messages and start the n8n workflow.

  4. Google Sheets Setup:

Ensure you have a spreadsheet ready with necessary headers (e.g., Date, Time, User ID, Block Type, Pomodoro Count, Working Session ID).
Provide Google Sheets API credentials to n8n.
* Configure the Record Deep Work and Record Long Break Google Sheets n8n node instances, selecting your spreadsheet ID and the correct sheet name.

  1. Activation: Save and activate the n8n workflow. Your custom Pomodoro timer is now ready to use via Telegram.

Node Details

Telegram Trigger: The primary n8n trigger. It initiates the n8n workflow whenever a user sends a message to the configured Telegram bot, capturing the command and user ID.
Code (Initiate Static Data): A crucial utility n8n node run once to initialize the global object for storing stateful user data, necessary for a multi-user n8n workflow like this.
If (start or stop?): A flow control n8n node that checks the incoming command. It routes the execution path to either begin the Pomodoro cycles or immediately end the session via a /stop command.
Wait (Deep Work & Break): These n8n nodes handle the precise timing of the Pomodoro technique. Deep Work is configured for 25 minutes, pausing the n8n workflow execution.
Code (Increment Count): This specialized code n8n node retrieves the user's session state from global static data, increments the Pomodoro Count, and ensures session metadata (like sessionId) is generated and maintained throughout the recurring cycles of the n8n workflow.
Telegram (Notifications): Multiple Telegram n8n node instances (Start Cycle Notification, Short Break Notification, etc.) send specific, time-relevant messages back to the user, managing the flow of the session.
Google Sheets (Record Deep Work & Record Long Break): These data n8n node instances use the 'append' operation to log detailed session data, including focus duration, break duration, and session IDs, for comprehensive productivity tracking.
Code (Clear Variables1 & Clear Variables2): Essential cleanup n8n nodes that delete the user's current session entry from the static data, preparing the n8n workflow for the next interaction after a successful completion or an early stop.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by

Automation, AI and Analytics for Supply Chain & Business Optimization Helping businesses streamline operations using n8n, AI agents, and data science to enhance efficiency and sustainability. Linkedin: www.linkedin.com/in/samir-saci

Featured*