Skip to main content

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:

  1. Asks the user for their name
  2. Stores it for future use
  3. Sends a personalized welcome message

Step 1: Create the Trigger

Start by adding a Command Trigger for /start:

  1. Drag Command Trigger onto the canvas
  2. 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.

  1. From the sidebar, find "Ask Question" (under Flow)
  2. Drag it onto the canvas
  3. Connect the trigger to this node
  4. Configure it:
    • Question: What's your name? 🙂
    • Save to Variable: custom_name
How "Ask Question" Works

When this node runs:

  1. First, it sends your question to the user
  2. Then it waits for their reply
  3. When they respond, it saves their answer and continues to the next node

Step 3: Send the Welcome Message

  1. Add a Send Message node
  2. Connect it to the Ask Question node
  3. 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

  1. Save your bot
  2. Open Telegram and send /start
  3. The bot asks your name
  4. Reply with your name
  5. You get a personalized welcome!

Understanding Variables

You just used your first variable! Variables are containers that store information.

SyntaxWhat It MeansExample
var.custom_nameUser's stored name"Alice"
user.first_nameUser's Telegram name"Alice" (from Telegram)
user.idUser's Telegram ID123456789
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

  1. Add a Condition node (under Logic) right after the trigger
  2. Connect the trigger to the Condition
  3. 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?