{{ first_name }} in the text and the subscriber sees their own name. The same block or broadcast reaches
everyone personally, with nothing to substitute by hand.
BotFlow’s syntax is double curly braces: {{ name }}. Spaces inside the braces are optional,
{{ first_name }} and {{first_name}} work the same.
Substitution works everywhere you write text to a subscriber: in the text and buttons of
flow builder blocks, in block and arrow conditions, in an operator’s messages in the
Messenger and in the text of broadcasts.
What it looks like
Say the start block contains:{{ first_name }}; an unfilled variable becomes an empty string.
System variables
These variables are built in and always available, you don’t create them. They are collected from the subscriber’s Telegram profile and from their subscription data.The start parameter {{ tag }}
{{ tag }} is the value a subscriber launched the bot with. When somebody opens the link
t.me/your_bot?start=123, the bot remembers 123, and you can substitute it with {{ tag }}. The value is
fixed once, on the first entry into the bot, and does not change afterwards. If the bot was launched from an
ordinary link without a parameter, {{ tag }} is empty.
This is handy for splitting scenarios by source. In the flow builder {{ tag }} is often
put into a start block condition: the block fires on /start;123, and subscribers with different parameters
in the link land in different branches of the funnel.
If the parameter in the link is a click from the Tracker, it goes into click attribution, and
{{ tag }} stays empty in that case. For ad campaign labels use {{ click_id }} and the event variables
from the table below.Tracker event variables
If a subscriber came through a campaign link and postbacks arrive for them, you can substitute conversion data into the text. This is a fixed set of fields; they are filled in once a postback arrives for the subscriber and are taken from their latest tracker event.
Values are updated as postbacks arrive for the main events: registration (Reg), first deposit (FTD), repeat
deposit (RD) and withdrawal.
Event variables are filled in only for subscribers who already had a postback. The set of fields above is
fixed: an arbitrary postback parameter does not become a variable of its own. Where events come from and how
to set up postbacks is described in Tracker. For
{{ click_id }} in links and buttons there
are examples in Flow builder.Channel exit variables
Filled in only in the block the exit from the channel started and in its actions, including the “External URL” API
request. The blocks for exits do not always run in the order of the exits: to reconcile exits, sort them by
{{ event.exit_at }}. When the “Left the channel” event fires is described in Flow builder.Custom variables
Besides the built-in ones you create your own variables for your own data: a support address, the current price, a channel link, the current promo code, anything. Every custom variable in the list shows a “Type”. By default it is per subscriber: each subscriber may have their own value, and while there is none the bot substitutes the default value. The “Global” checkbox makes the value the same across the whole bot: change it in one place and it updates in every message where its token is used.Where they are managed
Custom variables live in the bot’s Variables section, which sits in the Setup menu group (the same group as the flow builder and “AI Settings”). The section is available to the manager role and above.Open the Variables section
In the bot menu choose the “Setup” group, then “Variables”. At the top of the page there is a hint about substitution with
{{ name }} in messages, conditions and broadcasts.Press «Variable»
The button in the top right corner opens the creation dialog. Enter a Name: latin letters, digits and underscores only, and it may not start with a digit. For example
promo_code or support_link.Set a value
In the Default value field enter what the bot will substitute. For a global variable this is its value for the whole bot.
Choose the variable type
The Global checkbox is unticked by default: such a variable stores its value for each subscriber separately. Tick it if you need a single value for the whole bot.
Paste it into the text
In the list, clicking the
{{ name }} token copies it to the clipboard. Paste it into a block’s text, a button, a condition or a broadcast.Which value wins
If one name appears in several places, the bot substitutes it by a strict priority:- System variable. Built-in names such as
first_nameandtagalways come first. - Custom variable. A value set in the “Variables” section.
- Tracker event.
click_idandevent.*are substituted if the name is not taken above.
What’s next
Flow builder
Where to substitute variables into block text, buttons and conditions.
Broadcasts
Mass messages with personal substitutions for every subscriber.
Messenger
How an operator writes to a subscriber; substitution works here too.
Tracker
Campaigns and postbacks that fill
click_id and event.*.