AI Agents

Process Telegram Messages with AI and Log to Google Sheets

40 nodes 284 144 Automatic trigger
Download

Workflow Description

Advanced workflow that receives Telegram messages, analyzes them using an OpenAI-powered AI agent, automatically classifies content, and stores relevant data in Google Sheets while maintaining conversation history in Redis for continuous context.

How it works

  1. 1.Receive message from Telegram and trigger workflow automatically
  2. 2.Analyze message content using OpenAI AI agent
  3. 3.Classify message and extract key data with conditional logic
  4. 4.Store conversation record in Redis for future reference and context
  5. 5.Log results and extracted data to Google Sheets table

Use cases

  • Track and organize customer inquiries from Telegram in a centralized spreadsheet
  • Automatically document meeting notes and important conversations while preserving context

Requirements

  • Active Telegram account with configured bot and API token
  • Google Sheets account with edit permissions
  • OpenAI API key for AI processing capabilities
  • Redis server or connection for storing conversation data

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 284
Downloads 144

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