Telegram Users Data Collecting

Hi everyone,

I want to collect a few data fields from a Telegram user in a step-by-step chat flow, without using a separate form.

The fields I need are:

  • First name

  • Last name

  • Patronymic / father’s name

  • Telegram user ID

My goal is to ask the user these questions one by one inside the Telegram chat and store the answers during the conversation.

Helllo, Here’s exactly how to build this in n8n step by step.

-You don’t need to ask the user for their Telegram User ID, it’s already available automatically in every message via:
{{ $json.message.from.id }}
So you only need to collect 3 fields: First name, Last name, and Patronymic.

Each Telegram message triggers a fresh workflow execution, so n8n doesn’t remember what step the user was on. You need to store the conversation state somewhere external like Supabase / PostgreSQL and connect that to your agent bot.

Workflow Logic :

Telegram Trigger

Lookup user state from DB (by Telegram ID)

Switch node (based on step field)
step = 0 (new) → Send: “What is your first name?”
step = 1 Save first name → Send: "What is your last name?
step = 2 Save last name → Send: "What is your patronymic?
step = 3 Save patronymic + finalize record → Send: Thank you!

Nodes You’ll Need

  1. Telegram Trigger — fires on every incoming message
  2. Db postgres
  3. Switch node routes based on step value
  4. Update postgres
  5. Telegram node — sends the next question

Hi @Arman_Shamyan you can use HITL in each step.

And so if this is a industry grade automation, then add a text classifier which will validate the information and will output either Good or Bad , if bad the agent would ask all of those again in case of any mis information, and then just move forward, although using the n8n form is a very straight away approach without much effort, let me know what helps you.

If I want to do it without an ai agent, is that possible?

Yes, It is possible if you want just to collect details by using switch case a sequential bot.

You don’t need to ask for the Telegram User ID—it’s automatically available in every message at {{ $json.message.from.id }}