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.
Download this n8n workflow template and start using it instantly.
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.
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.
The n8n workflow starts with the Telegram trigger waiting for any incoming user message.
Initiate Static Data Code n8n node once manually to set up the global storage object needed for state tracking.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./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.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.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.< 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. 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./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.To deploy this powerful n8n workflow, follow these setup steps:
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.Telegram Trigger must be set up with your bot token to listen for incoming messages and start the n8n workflow.Record Deep Work and Record Long Break Google Sheets n8n node instances, selecting your spreadsheet ID and the correct sheet name. 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.
Use this powerful n8n workflow to automate your daily financial and operational briefing. Gathers data from Stripe, Shopify, Banking APIs, and Google Calendar, then summarizes it using OpenAI and sends a secure morning brief.

Automate monitoring of EU legislative procedures related to sustainability. This n8n workflow scrapes data, uses an OpenAI n8n node for classification, and saves actionable items to Google Sheets and Google Tasks.

Audit incoming CSRD XHTML sustainability reports automatically using a sophisticated n8n workflow. This n8n template uses custom JavaScript and GPT-4o AI agents for validation and automated email reporting.

Learn to build a robust n8n workflow for automated AI evaluation. Use the n8n Evaluation node, Google Gemini, and Google Sheets to test and score AI Agent performance automatically. Access powerful n8n templates.

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







































