Your First Complete Flow
Now that you've built a simple greeting bot, let's create something more useful: a bot that asks for the user's name and remembers it.
What We're Building
A registration flow that:
- Asks the user for their name
- Stores it for future use
- Sends a personalized welcome message
Step 1: Create the Trigger
Start by adding a Command Trigger for /start:
- Drag Command Trigger onto the canvas
- Set the command to
/start
Step 2: Ask a Question
This is where it gets interesting! We'll use an Ask Question node to collect the user's name.
- From the sidebar, find "Ask Question" (under Flow)
- Drag it onto the canvas
- Connect the trigger to this node
- Configure it:
- Question:
What's your name? 🙂 - Save to Variable:
custom_name
- Question:
How "Ask Question" Works
When this node runs:
- First, it sends your question to the user
- Then it waits for their reply
- When they respond, it saves their answer and continues to the next node
Step 3: Send the Welcome Message
- Add a Send Message node
- Connect it to the Ask Question node
- Set the message to:
Welcome, {{var.custom_name}}! 🎉
Thanks for registering. You can now use all features of this bot.
Notice we used {{var.custom_name}} — this inserts the name they just told us!
The Complete Flow
Step 4: Save and Test
- Save your bot
- Open Telegram and send
/start - The bot asks your name
- Reply with your name
- You get a personalized welcome!
Understanding Variables
You just used your first variable! Variables are containers that store information.
| Syntax | What It Means | Example |
|---|---|---|
var.custom_name | User's stored name | "Alice" |
user.first_name | User's Telegram name | "Alice" (from Telegram) |
user.id | User's Telegram ID | 123456789 |
var vs user
var.*— Information you store (stays between conversations)user.*— Information from Telegram (automatic, read-only)
Adding a Check: Are They Registered?
Let's make our bot smarter. If someone runs /start again, we should recognize them!
Add a Condition Node
- Add a Condition node (under Logic) right after the trigger
- Connect the trigger to the Condition
- Set the expression to:
var.registered == true
This checks if we've already registered this user.
Create Two Paths
- If TRUE (already registered): Send "Welcome back!"
- If FALSE (new user): Ask their name (our existing flow)
Don't Forget to Mark as Registered!
After asking for the name, add a Set Variable node:
- Variable:
var.registered - Value:
true
Final Flow Overview
What You Learned
- ✅ How to ask questions and wait for answers
- ✅ How to store information in variables
- ✅ How to use conditions for different paths
- ✅ How to create multi-step conversations
Next Steps
Ready for more?
- Understanding Flows → — Deeper dive into how flows work
- Variables Guide → — Master data storage
- Add Keyboards → — Make interactive buttons