← All N8N workflows
Data & databasesCodeGmailGoogle DriveGoogle SheetsIf

receive telegram events and telegram and google drive

Configured with Gmail, Google Drive, Google Sheets, Switch, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
TriggerTelegram TriggerTelegram TriggerRoutingCheck StateSwitchCodeClear StateCodeMessagingaddGPSTelegramMessagingWelcome MessageTelegramRoutingCommand?IfTransformStore GPS LocationEdit FieldsMessagingaddGPS resultTelegramMessagingaddShipmentNumberTelegramTransformShipment NumberEdit FieldsMessagingaddShipmentNumberresultTelegramCodeStore ShipmentCodeCodeStore GPSCodeCodeLoad Workspace DataCodeCodewaitingShipmentNumberCodeCodewaitingGPSCodeMessagingInstructionsTelegramCodewaitingPhotoCodeCodeWaiting ConditionsCodeMessagingaddPhoto resultTelegramMessagingsendPhotoTelegramFiles / mediaUpload PictureGoogle DriveCodeSave Public Image LinkCodeMessagingConfirmation DriverTelegramMessagingDistribution TeamConfirmationGmailTransformExtract FileNameEdit FieldsCodeStore fileNameCodeMessagingGet PictureTelegramFiles / mediaShare PictureGoogle DriveCodeInitiate Workflow DataCodeRoutingSwitch CommandSwitchData storeLoad DeliveryInformationGoogle Sheets

Node categories in this workflow

  • Trigger
  • Routing
  • Code
  • Messaging
  • Transform
  • Files / media
  • Data store

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
Check StateRoutingSwitchSee node parameters
Clear StateCodeCodeSee node parameters
addGPSMessagingTelegramSee node parameters
Welcome MessageMessagingTelegramSee node parameters
Command?RoutingIfSee node parameters
Store GPS LocationTransformEdit FieldsSee node parameters
addGPS resultMessagingTelegramSee node parameters
addShipmentNumberMessagingTelegramSee node parameters
Shipment NumberTransformEdit FieldsSee node parameters
addShipmentNumber resultMessagingTelegramSee node parameters
Store ShipmentCodeCodeSee node parameters
Store GPSCodeCodeSee node parameters
Load Workspace DataCodeCodeSee node parameters
waitingShipmentNumberCodeCodeSee node parameters
waitingGPSCodeCodeSee node parameters
InstructionsMessagingTelegramSee node parameters
waitingPhotoCodeCodeSee node parameters
Waiting ConditionsCodeCodeSee node parameters
addPhoto resultMessagingTelegramSee node parameters
sendPhotoMessagingTelegramSee node parameters
Upload PictureFiles / mediaGoogle DriveSee node parameters
Save Public Image LinkCodeCodeSee node parameters
Confirmation DriverMessagingTelegramSee node parameters
Distribution Team ConfirmationMessagingGmailSee node parameters
Extract FileNameTransformEdit FieldsSee node parameters
Store fileNameCodeCodeSee node parameters
Get PictureMessagingTelegramfile
Share PictureFiles / mediaGoogle Driveshare
Initiate Workflow DataCodeCodeSee node parameters
Switch CommandRoutingSwitchSee node parameters
Load Delivery InformationData storeGoogle Sheetsappend

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

5. Do you need more details?

5. Do you need more details?

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

3. Driver's Input Collection Block

3. Driver's Input Collection Block

Based on the state flag value, the workflow process the input expected from the driver.

The waiting conditions code node is filtering the request based on the workplace state variable value

  • If the value is waitingXXX: the output from the driver is processed, a value is recorded in a code node and a confirmation message is sent to the driver (including the next command to follow)
  • If the value does not start with waiting: a message with instructions is sent to the driver

How to setup?

2. Driver's Input Command Block

2. Driver's Input Command Block

The switch command tunnels the flow based on the command:

  1. The code nodes named waitingXXX are storing a state flag to wait for the user input
  2. Telegram Message Nodes are asking users for the expected input

If the command is /sendConfirmation:

  • A proof of delivery is sent to the logistics team by the Gmail Node
  • Shipment information are recorded in the Google Sheet
  • A confirmation is sent to the driver by the Telegram Node

How to setup?

Initiate Workflow 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

The workflow is triggered by a user message. The second is checking if the message is a command (starting with "/") to route it to the proper block.

How to setup?

receive telegram events and telegram and google drive

receive telegram events and telegram and google drive

Purpose and structure

This folder contains the receive telegram events and telegram and google drive workflow. Its executable nodes use code, gmail, googleDrive, googleSheets, if, set, switch, telegram, telegramTrigger. 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/0789_Telegram_Code_Create_Triggered.json MIT; preserve source notices.

More in Data & databases