← All N8N workflows
Data & databasesCodeGoogle SheetsIfTelegramTelegram Trigger

receive telegram events and append google sheets and telegram

Configured with Google Sheets, Telegram, Telegram Trigger, Wait. Review the connections and setup before adapting this template.

Workflow preview
TriggerTelegram TriggerTelegram TriggerRoutingIfIfWaitDeep WorkWaitWaitBreakWaitCodeInitiate Static DataCodeCodeIncrement CountCodeData storeRecord Deep WorkGoogle SheetsData storeRecord Long BreakGoogle SheetsMessagingInstructions MessageTelegramRoutingstart or stop?IfMessagingLong Break NotificationTelegramCodeClear Variables1CodeCodeClear Variables2CodeRouting< 4 CyclesIfMessagingShort BreakNotificationTelegramMessagingBack to WorkNotificationTelegramMessagingStart CycleNotificationTelegramMessagingEnd of SessionNotificationTelegram

Node categories in this workflow

  • Trigger
  • Routing
  • Wait
  • Code
  • Data store
  • Messaging

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Telegram TriggerTriggerTelegram TriggerSee node parameters
IfRoutingIfSee node parameters
Deep WorkWaitWaitSee node parameters
BreakWaitWaitSee node parameters
Initiate Static DataCodeCodeSee node parameters
Increment CountCodeCodeSee node parameters
Record Deep WorkData storeGoogle Sheetsappend
Record Long BreakData storeGoogle Sheetsappend
Instructions MessageMessagingTelegramSee node parameters
start or stop?RoutingIfSee node parameters
Long Break NotificationMessagingTelegramSee node parameters
Clear Variables1CodeCodeSee node parameters
Clear Variables2CodeCodeSee node parameters
< 4 CyclesRoutingIfSee node parameters
Short Break NotificationMessagingTelegramSee node parameters
Back to Work NotificationMessagingTelegramSee node parameters
Start Cycle NotificationMessagingTelegramSee node parameters
End of Session NotificationMessagingTelegramSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

None declared. HTTP requests and Code nodes may still need configuration.

Workflow notes

4. Do you need more details?

4. Do you need more details?

Find a step-by-step guide in this tutorial 🎥 Watch My Tutorial

Initiate Static Data

You only need to run the initialization step once per workflow, regardless of the number of Telegram chat IDs. The initialization creates the telegramStates object within the global static data of the workflow. Once that object exists, the workflow will use it to store the state for any chat ID.

0. Initiate Workplace Static Data

0. Initiate Workplace Static Data

Run it once before activating the workflow to initialize workspace data that will be used to store state flags and outputs from users.

How to setup?

1. Workflow Trigger with Telegram Message

1. Workflow Trigger with Telegram Message

  1. The workflow is triggered by a user message.
  2. The second is checking if the message is a command (starting with "/") to route it to the proper block. If the message is not a command, the bot sends an instruction message to the user.
  3. The third node checks if the message is a /stop. If yes, we stop the workflow the bot send a notice to the user and state variables are clears

How to setup?

2. Deep Work Blocks of 25 minutes

2. Deep Work Blocks of 25 minutes

  1. The bot notifies the user that the session started.
  2. After 25 minutes, it sends a notification to inform the user that [he/she] should take a break.
  3. The loop continues until we reached four working sessions.

Why do we need Google Sheets?

Each deep work session is recorded to help users keep track of their stats.

How to setup?

  • Deep Work & Break Mode: fix the amount of time you want for the deep work session (Default: 25 min) and the short break (Default: 5 min)
  • Telegram Nodes: set up your telegram bot credentials Learn more about the Telegram Trigger Node
  • Record Deep Work in the Google Sheet Node:
    1. Add your Google Sheet API credentials to access the Google Sheet file
    2. Select the file using the list, an URL or an ID
    3. Select the sheet in which you want to record your working sessions
    4. Map the fields Learn more about the Google Sheet Node
3. End of the session for a long break

3. End of the session for a long break

  1. The bot notifies the user that the session ended.
  2. The long break is recorded in the Google Sheets.
  3. Variables are cleared so the workflow is ready for a new session with this user.

How to setup?

receive telegram events and append google sheets and telegram

receive telegram events and append google sheets and telegram

Purpose and structure

This folder contains the receive telegram events and append google sheets and telegram workflow. Its executable nodes use code, googleSheets, if, telegram, telegramTrigger, wait. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

Telegram Trigger

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Telegram/0807_Telegram_Wait_Send_Triggered.json MIT; preserve source notices.

More in Data & databases