AI Agents

Connect Telegram with Google Sheets

40 nodes 202 121 Automatic trigger
Download

Workflow Description

An automation that connects Telegram to Google Sheets using an AI agent. It receives messages, analyzes them with OpenAI, stores data in Redis memory, logs entries to Google Sheets, and publishes important messages to Twitter/X automatically.

How it works

  1. 1.Receive and validate incoming Telegram messages in real-time
  2. 2.Analyze message content using an AI agent powered by OpenAI language models
  3. 3.Classify and cache messages in Redis shared memory for performance
  4. 4.Insert processed data into designated Google Sheets worksheets
  5. 5.Publish priority messages to Twitter/X based on predefined conditions

Use cases

  • Automatically collect and document customer inquiries from Telegram into organized spreadsheets
  • Intelligently process incoming requests with automatic categorization by priority and content type

Requirements

  • Active Telegram Bot account with valid API credentials
  • Pre-configured Google Sheets with appropriate edit permissions and column structure
  • OpenAI API key to enable intelligent language analysis for the agent

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

Telegram Redis Google Sheets Memory AI Agent OpenAI If Twitter/X

Details

Trigger Automatic trigger
Nodes 40
Apps 8
Views 202
Downloads 121

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (40)

/

Telegram Trigger

Set

#1

Send Next Question

Set

#2

Send Response

Set

#3

Has No Record?

If

#4

Is Survey Continue?

If

#5

Get State2

Redis

#6

Get Columns1

Google Sheets

#7

Set Variables1

Set

#8

Message Type1

Switch

#9

Get Command1

Set

#10

Bot Actions1

Switch

#11

Memory3

Memory Redis Chat

#12

Get Survey State1

Set

#13

Reset Agent Memory1

Memory Manager

#14

Memory4

Memory Redis Chat

#15

Start Session1

Redis

#16

Get State3

Redis

#17

Increment Index1

Redis

#18

Interview Agent1

Agent

#19

Get Record1

Google Sheets

#20

Append Responses1

Set

#21

Update Answer2

HTTP Request

#22

Get Last Bot Message1

Redis

#23

Update Answer3

HTTP Request

#24

Model2

OpenAI

#25

Model3

OpenAI

#26

Should Follow Up?1

If

#27

Execution Data2

Execution Data

#28

Create Record2

Google Sheets

#29

Sticky Note8

Sticky Note

#30

Send Start

Set

#31

Send Start1

Set

#32

Completed Survey

Set

#33

Sticky Note2

Sticky Note

#34

Create Record1

Google Sheets

#35

Sticky Note3

Sticky Note

#36

Sticky Note4

Sticky Note

#37

Sticky Note5

Sticky Note

#38

Sticky Note6

Sticky Note

#39

Sticky Note7

Sticky Note

#40