<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alex</title>
    <description>The latest articles on DEV Community by Alex (@alex_prog).</description>
    <link>https://dev.to/alex_prog</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3371369%2Fad653e90-38c6-4925-9a6c-ed136d4959ba.png</url>
      <title>DEV Community: Alex</title>
      <link>https://dev.to/alex_prog</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alex_prog"/>
    <language>en</language>
    <item>
      <title>Add a CRM, Live Chat and Analytics to a Telegram Bot You Already Wrote</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Sun, 30 Aug 2026 12:44:40 +0000</pubDate>
      <link>https://dev.to/flowcastle/add-a-crm-live-chat-and-analytics-to-a-telegram-bot-you-already-wrote-ncc</link>
      <guid>https://dev.to/flowcastle/add-a-crm-live-chat-and-analytics-to-a-telegram-bot-you-already-wrote-ncc</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://flowcastle.ai/blog/add-crm-analytics-to-existing-telegram-bot?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;FlowCastle blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Writing bot code is fun. Then the bot gets real users, and the questions change: who is actually talking to it? Which conversations end in a sale? Can support take over a chat when the bot gets stuck? Can we message everyone who dropped off before paying?&lt;/p&gt;

&lt;p&gt;None of that is bot logic, and none of it belongs in your handlers. It's the layer &lt;em&gt;around&lt;/em&gt; a bot — and every tool that offers it wants your bot token and wants to host the bot for you, which means throwing away the code you wrote.&lt;/p&gt;

&lt;p&gt;This article shows the third option: keep your grammY, Telegraf, aiogram or python-telegram-bot bot exactly where it is, and add that layer with an open-source middleware. By the end you'll have a contact record for every user, goals showing up in funnels, a &lt;code&gt;/human&lt;/code&gt; command that hands the chat to a person, and — optionally — flows your teammates build visually that run through your bot process. The full example bot is linked at the end; it exists for all four frameworks.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you'll add, and what stays yours
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stays in your code&lt;/th&gt;
&lt;th&gt;Added by FlowCastle&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Your framework, handlers, database, hosting&lt;/td&gt;
&lt;td&gt;Contact CRM with traits, tags and history&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Your Telegram bot token — FlowCastle never receives it&lt;/td&gt;
&lt;td&gt;Live Chat: a person replies in the same Telegram chat, through your bot&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Polling or webhooks, exactly as today&lt;/td&gt;
&lt;td&gt;Broadcasts and drip sequences, sent through your bot&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Anything you'd rather keep in source control&lt;/td&gt;
&lt;td&gt;Goals, funnels, conversion analytics&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;A read-only map of the conversations your code already handles&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The SDK is MIT-licensed, lives on &lt;a href="https://github.com/FlowCastle/flowcastle-sdk" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, has zero runtime dependencies on Node and uses only the standard library on Python. The hosted part is the FlowCastle dashboard, which has a free plan with no card required.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Create the SDK key
&lt;/h2&gt;

&lt;p&gt;In the &lt;a href="https://dashboard.flowcastle.ai/register?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;FlowCastle dashboard&lt;/a&gt;, open your application and click &lt;strong&gt;Add bot&lt;/strong&gt;. Pick &lt;strong&gt;Code SDK&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F06g8s13a26fc499qom5k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F06g8s13a26fc499qom5k.png" alt="The Add bot dialog in FlowCastle with the Code SDK option: connect a bot you already run in code — grammY, Telegraf, aiogram or python-telegram-bot" width="800" height="1384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice what it doesn't ask for: a Telegram token. Give the connection a name and create it. You get an &lt;code&gt;fc_sdk_…&lt;/code&gt; key, and the install instructions for your library.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxdrvv9z67lzfzweu61j7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxdrvv9z67lzfzweu61j7.png" alt="The SDK bot created: API key, a library picker set to grammY, the install command and a three-line integration snippet" width="800" height="1199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Switch the picker and the instructions follow — here's the same screen for aiogram:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flhrqb6rsqpezquvkboal.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flhrqb6rsqpezquvkboal.png" alt="The same dialog with aiogram 3 selected: pip install command and the Python integration snippet" width="800" height="1300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Put the key next to your existing &lt;code&gt;BOT_TOKEN&lt;/code&gt; as &lt;code&gt;FLOWCASTLE_API_KEY&lt;/code&gt;. Treat it like a secret — it's how your bot authenticates with FlowCastle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Add the middleware (three lines)
&lt;/h2&gt;

&lt;p&gt;grammY:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Bot&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Context&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;grammy&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;flowcastle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;FlowCastleFlavor&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@flowcastle/grammy&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;BotContext&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;FlowCastleFlavor&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Context&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;bot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Bot&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;BotContext&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;BOT_TOKEN&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;flowcastle&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;BotContext&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;FLOWCASTLE_API_KEY&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;privacy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;                 &lt;span class="c1"&gt;// commands and button taps are shared, free text is not&lt;/span&gt;
  &lt;span class="na"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;  &lt;span class="c1"&gt;// lets visually built flows run through this bot (Step 6)&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nx"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fc&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;                   &lt;span class="c1"&gt;// before your handlers, so it sees every update&lt;/span&gt;

&lt;span class="c1"&gt;// ...your existing handlers, unchanged...&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;fc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;aiogram 3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;flowcastle&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FlowCastleCore&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;FlowCastleOptions&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;flowcastle.adapters.aiogram&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AiogramAdapter&lt;/span&gt;

&lt;span class="n"&gt;core&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FlowCastleCore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;FlowCastleOptions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;FLOWCASTLE_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;privacy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{},&lt;/span&gt; &lt;span class="n"&gt;runtime_enabled&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;adapter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AiogramAdapter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;core&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ready&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;adapter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;install&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# outer middleware; handlers get `flowcastle` in their data
&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;dp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start_polling&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Telegraf and python-telegram-bot are the same shape; the &lt;a href="https://github.com/FlowCastle/flowcastle-sdk#integrate-in-minutes" rel="noopener noreferrer"&gt;README&lt;/a&gt; has all four.&lt;/p&gt;

&lt;p&gt;Two things about that snippet worth knowing before you run it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;privacy: {}&lt;/code&gt; is a choice you're making explicitly.&lt;/strong&gt; With it, the SDK sends commands and callback identifiers but strips free text before anything leaves your process. Contacts get a Telegram user id and nothing else unless you allow specific profile fields (&lt;code&gt;contactFields: ['username', 'languageCode']&lt;/code&gt;). If your FlowCastle flows need to read what users type — say, for AI answers — set &lt;code&gt;messageContent: 'full'&lt;/code&gt; and, if you want, a &lt;code&gt;transformText&lt;/code&gt; callback that redacts emails or card numbers locally. A callback that throws or times out drops the field rather than sending it unredacted.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your handlers never wait on FlowCastle.&lt;/strong&gt; After local filtering, the event goes into a bounded in-memory queue (500 events, oldest dropped under pressure) and your handler runs immediately. Delivery is batched every three seconds with one background retry. If FlowCastle is unreachable, your bot loses some analytics, not its users.&lt;/p&gt;

&lt;p&gt;Run the bot and send it &lt;code&gt;/start&lt;/code&gt;. Back in the dashboard, the bot's &lt;strong&gt;SDK&lt;/strong&gt; tab flips to &lt;em&gt;Connected&lt;/em&gt;, and the person who sent &lt;code&gt;/start&lt;/code&gt; is now a contact.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foizbxgqlp81h2mpn757k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foizbxgqlp81h2mpn757k.png" alt="Bot settings, SDK tab: connection status Connected, the API key row and the per-library install instructions" width="800" height="621"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's the whole integration. Everything below is about using it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Turn your handlers into a CRM
&lt;/h2&gt;

&lt;p&gt;The middleware puts a small API on the context — &lt;code&gt;ctx.flowcastle&lt;/code&gt; in Node, the &lt;code&gt;flowcastle&lt;/code&gt; argument (aiogram) or &lt;code&gt;context.flowcastle&lt;/code&gt; (python-telegram-bot) in Python. Three calls do most of the work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;identify&lt;/code&gt;&lt;/strong&gt; sets traits on the contact. In the example bot, &lt;code&gt;/start&lt;/code&gt; records the display name, and a three-question &lt;code&gt;/qualify&lt;/code&gt; command — plain inline keyboards, all in code — saves the answers as traits when it completes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;lead&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;leadNeed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;website_lead_bot&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;leadBudget&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;500_2k&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;leadTimeline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;this_month&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flowcastle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;identify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lead&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;goal&lt;/code&gt;&lt;/strong&gt; records something that matters to the business. The example fires one from a demo button and one when qualification completes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flowcastle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;goal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lead_qualified&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;lead&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Goal keys are yours to name — &lt;code&gt;subscription_started&lt;/code&gt;, &lt;code&gt;order_paid&lt;/code&gt;, whatever your funnel is made of. Add a numeric &lt;code&gt;value&lt;/code&gt; prop and revenue shows up in analytics.&lt;/p&gt;

&lt;p&gt;Here's what the contact looks like after one run through &lt;code&gt;/qualify&lt;/code&gt; — the traits your code sent, next to the tags and status FlowCastle keeps:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsa21y0woz96p8pdq0te4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsa21y0woz96p8pdq0te4.png" alt="A FlowCastle contact record filled from the grammY bot: a qualified tag and the leadNeed, leadBudget and leadTimeline traits set by identify" width="800" height="1265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And on the Goals tab, the two goals the handlers fired:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fni55goyxagfbodri9crt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fni55goyxagfbodri9crt.png" alt="The same contact's Goals tab listing demo_goal and lead_qualified, each with the time it was reached" width="800" height="963"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nothing in the bot changed except two lines inside a handler that already existed. Your database is still the source of truth for whatever it was the source of truth for; this is the &lt;em&gt;view&lt;/em&gt; your growth and support people were asking you to build.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Hand a chat to a human
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;requestLiveAgent&lt;/code&gt;&lt;/strong&gt; is the third call. The example bot wires it to &lt;code&gt;/human&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;command&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;human&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flowcastle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;requestLiveAgent&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;note&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;User asked to talk to a human.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Connecting you with a teammate — they will reply right here. 💬&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message:text&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flowcastle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isLiveAgentActive&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// a person has this chat; don't echo over them&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Echo: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The conversation opens in FlowCastle's Live Chat. When a teammate replies there, the reply is delivered through &lt;em&gt;your&lt;/em&gt; bot process — the SDK pulls it as a job and sends it with your bot's own connection. FlowCastle can only ask your process to run a short allowlist of Bot API methods (&lt;code&gt;sendMessage&lt;/code&gt;, &lt;code&gt;sendPhoto&lt;/code&gt;, &lt;code&gt;answerCallbackQuery&lt;/code&gt; and the like); token, webhook and polling methods are refused no matter what the server sends.&lt;/p&gt;

&lt;p&gt;The whole handoff is visible on the contact's activity trail — the user's messages, the live-agent request, the bot's acknowledgement, and the agent's reply delivered back through your bot:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwjndyi2vlu9qmlx00lmw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwjndyi2vlu9qmlx00lmw.png" alt="The contact's activity log in FlowCastle: three incoming messages ending in " width="800" height="1303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;isLiveAgentActive&lt;/code&gt; is a local, optimistic hint — a 30-minute window opened by the request and refreshed by delivered agent replies — so your auto-replies step back while a person is engaged. (It's Node-only for now; the Python SDK doesn't expose it yet.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: See the bot your code already is
&lt;/h2&gt;

&lt;p&gt;This one surprises people. From the sanitized traffic — which commands lead to which replies, which buttons get pressed — FlowCastle reconstructs the conversations your code handles and lists them on the Automation canvas next to your other flows, one map per entry point, each labeled &lt;strong&gt;Observed&lt;/strong&gt;. For the example bot that's four: &lt;code&gt;/start&lt;/code&gt;, &lt;code&gt;/qualify&lt;/code&gt;, &lt;code&gt;/human&lt;/code&gt; and the plain-message fallback. Open &lt;code&gt;/qualify&lt;/code&gt;, hit &lt;strong&gt;Auto-arrange&lt;/strong&gt;, and the journey you wrote in code is laid out as a flow: three questions, nine option buttons, the closing message.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq3ehtpvlemn5r7d176o1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq3ehtpvlemn5r7d176o1.png" alt="The observed /qualify journey of the grammY bot opened on the FlowCastle Automation canvas after auto-arrange: three question messages with their option buttons and the closing message, reconstructed from traffic, marked Observed and read-only; the flow list shows the other observed entry points" width="800" height="442"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These maps aren't a source of truth — your repository is — and you can delete one at any time and let it rebuild from fresh activity. What it's for: the teammate who can't read your handlers can now see what the bot does, and every step on the map is connected to the analytics below. "Where do people drop off in &lt;code&gt;/qualify&lt;/code&gt;?" stops being a question only you can answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6 (optional): Let teammates build alongside your code
&lt;/h2&gt;

&lt;p&gt;Because &lt;code&gt;runtime: { enabled: true }&lt;/code&gt; is on, the same Automation workspace can hold flows built in the visual editor — onboarding, a follow-up sequence, a support FAQ — and they execute through your bot process. The rules are simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An update that matches a deployed FlowCastle trigger (say, a &lt;code&gt;/faq&lt;/code&gt; command your code doesn't handle) is answered by the flow and &lt;em&gt;doesn't&lt;/em&gt; reach your handlers, so nobody replies twice.&lt;/li&gt;
&lt;li&gt;Everything unmatched falls through to your code exactly as before.&lt;/li&gt;
&lt;li&gt;Your code can start a flow explicitly. The example does this when &lt;code&gt;/qualify&lt;/code&gt; completes, passing the answers as inputs:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flowcastle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;runFlow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lead-follow-up&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;inputs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;lead&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Only flows you've marked &lt;em&gt;callable from SDK&lt;/em&gt; in the dashboard can be started this way. A marketer can then change the follow-up copy, add a step, or A/B the timing — and none of it is a deploy of your bot.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you get on the dashboard side
&lt;/h2&gt;

&lt;p&gt;Goals, contacts, broadcasts and the observed map all feed one analytics view: subscriber growth, which broadcasts moved which goals, revenue if you send a &lt;code&gt;value&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdcw5ybu2118oac2mk2td.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdcw5ybu2118oac2mk2td.png" alt="The FlowCastle analytics dashboard connecting conversations, subscriber growth, goals and campaign activity in one view" width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Broadcasts and drip sequences are built in the dashboard and sent through your bot — segmented by the traits and goals your handlers set, so "everyone with &lt;code&gt;leadBudget = 2k_plus&lt;/code&gt; who never reached &lt;code&gt;order_paid&lt;/code&gt;" is a filter, not a script.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The example bot&lt;/strong&gt;, in all four frameworks: &lt;a href="https://github.com/FlowCastle/flowcastle-sdk/tree/main/examples" rel="noopener noreferrer"&gt;&lt;code&gt;examples/&lt;/code&gt;&lt;/a&gt; in the SDK repo — &lt;code&gt;/start&lt;/code&gt; → identify, a goal button, code-owned &lt;code&gt;/qualify&lt;/code&gt;, &lt;code&gt;/human&lt;/code&gt; handoff, optional follow-up flow. Copy the folder for your framework and replace the handlers with yours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Using an AI coding agent?&lt;/strong&gt; Point it at the &lt;a href="https://github.com/FlowCastle/flowcastle-sdk/blob/main/docs/AGENT_GUIDE.md" rel="noopener noreferrer"&gt;agent setup guide&lt;/a&gt; — one file with the install order per framework, every option, a verification checklist and troubleshooting. Claude Code, Cursor and Codex wire it in without you reading the docs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The privacy and performance contract&lt;/strong&gt; in full: the &lt;a href="https://github.com/FlowCastle/flowcastle-sdk#privacy-is-configured-in-your-process" rel="noopener noreferrer"&gt;README&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Questions&lt;/strong&gt;: the &lt;a href="https://t.me/flowcastle_community" rel="noopener noreferrer"&gt;FlowCastle bot developers community&lt;/a&gt; on Telegram.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Start free at &lt;a href="https://dashboard.flowcastle.ai/register?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;dashboard.flowcastle.ai&lt;/a&gt; — no card — and the &lt;a href="https://github.com/FlowCastle/flowcastle-sdk" rel="noopener noreferrer"&gt;SDK on GitHub&lt;/a&gt; is MIT.&lt;/p&gt;

</description>
      <category>telegram</category>
      <category>sdk</category>
      <category>node</category>
      <category>python</category>
    </item>
    <item>
      <title>Build an AI Support Bot for Telegram</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Thu, 30 Jul 2026 20:31:46 +0000</pubDate>
      <link>https://dev.to/flowcastle/build-an-ai-support-bot-for-telegram-523p</link>
      <guid>https://dev.to/flowcastle/build-an-ai-support-bot-for-telegram-523p</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://flowcastle.ai/blog/ai-support-bot?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;FlowCastle blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;An AI support bot fails in two common ways. The first version is only a button tree with an AI label on top. It can route a few obvious questions, but it breaks as soon as a customer writes in their own words. The second version is worse: a raw language model connected to your inbox. It sounds confident, invents answers, and keeps talking when it should bring in a human.&lt;/p&gt;

&lt;p&gt;The practical version sits between those two extremes. It answers routine questions from your own knowledge base, recognizes the requests you already know how to handle, and passes the conversation to a person when confidence is low or the customer asks for help.&lt;/p&gt;

&lt;p&gt;In this walkthrough, you will build that version for Telegram in FlowCastle. The ready-made &lt;a href="https://flowcastle.ai/templates/support-ticket?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;AI FAQ + Human Handoff template&lt;/a&gt; is linked at the end, so you can start from the same structure instead of building from a blank canvas.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you will build
&lt;/h2&gt;

&lt;p&gt;The finished support flow has five parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a short welcome message&lt;/li&gt;
&lt;li&gt;an AI agent connected to your knowledge base&lt;/li&gt;
&lt;li&gt;three explicit intents for common requests&lt;/li&gt;
&lt;li&gt;a human handoff path for exceptions&lt;/li&gt;
&lt;li&gt;a weekly improvement loop based on real conversations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The example is for a small ecommerce support bot. It can answer questions about delivery, returns, warranty, and order status. It also knows when to move the customer to a human operator.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foewoilvs590buvfi08bn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foewoilvs590buvfi08bn.png" alt="FlowCastle editor showing an AI support bot flow with welcome, AI agent, intent routes, and human handoff" width="799" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Start with a clear support promise
&lt;/h2&gt;

&lt;p&gt;Begin with a welcome message before the AI agent. Do not open with a long explanation of what AI can do. Tell the customer what happens next.&lt;/p&gt;

&lt;p&gt;Use this copy:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hi. I can answer questions about orders, delivery, returns, and warranty. If I cannot help, I will connect you with a person.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That last sentence matters. It reduces the risk of a customer feeling trapped in automation. The bot is allowed to help, but it is not pretending to replace support.&lt;/p&gt;

&lt;p&gt;Connect this welcome message to the AI agent step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv6m5g8xfmincwxodmtcx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv6m5g8xfmincwxodmtcx.png" alt="FlowCastle message editor canvas close-up with the AI support bot welcome message" width="800" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Attach the knowledge base
&lt;/h2&gt;

&lt;p&gt;Create a knowledge base for the agent and upload the documents the bot is allowed to use. For this example, start with four short files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;shipping-policy.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;returns-and-refunds.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;warranty.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;order-status-faq.md&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keep the files boring and specific. A good support knowledge base says:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;how long delivery usually takes&lt;/li&gt;
&lt;li&gt;what information is needed to check an order&lt;/li&gt;
&lt;li&gt;which items can be returned&lt;/li&gt;
&lt;li&gt;how many days the customer has to request a refund&lt;/li&gt;
&lt;li&gt;when a person should review the case&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Avoid dumping a whole website into the bot on day one. If the source material is unclear, the AI answer will be unclear too. The knowledge base should contain the exact policies you are comfortable sending to customers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flqu5n0b144mzvjve0zjf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flqu5n0b144mzvjve0zjf.png" alt="FlowCastle knowledge base manager showing support FAQ documents ready for an AI support bot" width="799" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After uploading the files, attach the knowledge base to the AI agent. The agent should answer from those documents rather than from general model knowledge.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn7k3ttp3hsbcpvgeuc77.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn7k3ttp3hsbcpvgeuc77.png" alt="AI Support Agent settings in FlowCastle with the Support FAQ knowledge base attached" width="800" height="2164"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Add explicit intents for known requests
&lt;/h2&gt;

&lt;p&gt;Use intents for requests that should always follow a predictable path. In this example, add these intents:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Track order&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Return or refund&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Talk to a human&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For &lt;strong&gt;Track order&lt;/strong&gt;, route the customer to a message that asks for the order number:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Please send your order number. It usually starts with &lt;code&gt;FC-&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you already store order data in an external system, this is where you can later add an integration step. For the first version, it is enough to collect the order number and hand it to support.&lt;/p&gt;

&lt;p&gt;For &lt;strong&gt;Return or refund&lt;/strong&gt;, route the customer to a message that explains the policy and asks for the order number:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can request a return within 14 days after delivery. Send your order number and a short reason for the return, and we will check the case.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For &lt;strong&gt;Talk to a human&lt;/strong&gt;, route directly to the human handoff path.&lt;/p&gt;

&lt;p&gt;Everything outside those known intents can still be answered by the knowledge base. That is why the useful mode is not only intents and not only chat. Known requests get deterministic paths; long-tail questions get AI answers grounded in your documents.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjrkoby4bmcsald6jvcvl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjrkoby4bmcsald6jvcvl.png" alt="AI Support Agent intents tab with Track order, Return or refund, and Talk to a human intents" width="800" height="1626"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Define when the bot must hand off
&lt;/h2&gt;

&lt;p&gt;The handoff rule is the part that makes the bot safe to use in production. Add a human handoff path and use it in three cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the customer asks for a person&lt;/li&gt;
&lt;li&gt;the request involves a refund, complaint, or edge case&lt;/li&gt;
&lt;li&gt;the AI answer is not confident enough&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use this message before the handoff:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I will connect you with a teammate. They will see this conversation, so you do not need to repeat the details.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then route the conversation to Live Chat. The operator should receive the conversation history and the context collected by the bot. The customer should not have to start again.&lt;/p&gt;

&lt;p&gt;This is also where the support team can keep control of sensitive topics. The bot can explain standard policy, but a person should handle exceptions, angry customers, payment issues, and anything that affects trust.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy5ews7i5gk1jm4eqafof.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy5ews7i5gk1jm4eqafof.png" alt="AI Support Agent fallback settings showing handoff to another block for no-match conversations" width="800" height="2164"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Test with real customer wording
&lt;/h2&gt;

&lt;p&gt;Before publishing, test the bot with messy messages, not only perfect examples. Use phrases like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"where is my package"&lt;/li&gt;
&lt;li&gt;"i want my money back"&lt;/li&gt;
&lt;li&gt;"can someone help me"&lt;/li&gt;
&lt;li&gt;"do you ship to Spain"&lt;/li&gt;
&lt;li&gt;"my item arrived broken"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check what happens in each case. A good result is not always an AI answer. Sometimes the correct result is a handoff.&lt;/p&gt;

&lt;p&gt;For every test, verify three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The bot answers from your policy, not from invented assumptions.&lt;/li&gt;
&lt;li&gt;Known requests follow the intent path you configured.&lt;/li&gt;
&lt;li&gt;Sensitive or unclear requests reach a person.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the bot answers too broadly, tighten the source documents. If it misses a repeated request, add a new intent. If it refuses too often, improve the knowledge base with a clearer answer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8xzsrpcsf5v13lrub642.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8xzsrpcsf5v13lrub642.png" alt="FlowCastle Test bot chat tab showing a support conversation with order, refund, and human handoff messages" width="800" height="1712"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Improve it after launch
&lt;/h2&gt;

&lt;p&gt;The first version of a support bot is never the final version. After a week, review the conversations. Look for repeated questions, confusing answers, and places where customers asked for a person earlier than expected.&lt;/p&gt;

&lt;p&gt;In FlowCastle, use conversation analysis and suggestions to turn those patterns into concrete changes. A useful suggestion might be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;add a new "Change delivery address" intent&lt;/li&gt;
&lt;li&gt;add a missing paragraph to &lt;code&gt;shipping-policy.md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;rewrite the return answer so it names the 14-day window earlier&lt;/li&gt;
&lt;li&gt;route damaged-item reports directly to a human&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Approve the changes that match your support policy. Reject anything that would make the bot overconfident. The goal is not to automate every conversation. The goal is to answer the easy questions instantly and send the hard ones to the right person with context.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyi7nj5lkw1ti08k2ytk2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyi7nj5lkw1ti08k2ytk2.png" alt="FlowCastle AI agent suggestions tab recommending a damaged-item intent after conversation analysis" width="800" height="1461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Use the same flow on your website
&lt;/h2&gt;

&lt;p&gt;Once the Telegram bot works, you can run the same support flow in the website chat widget. That is useful because customers do not all start in the same channel. Some open Telegram, some land on your pricing page, and some come from a help article.&lt;/p&gt;

&lt;p&gt;Keep one support flow and adapt the entry point per channel. The policies, intents, and handoff logic should stay consistent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go next
&lt;/h2&gt;

&lt;p&gt;Clone the &lt;a href="https://flowcastle.ai/templates/support-ticket?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;AI FAQ + Human Handoff template&lt;/a&gt;, attach your own knowledge base, and replace the example intents with the requests your support team sees every week. Start with a small scope: order status, returns, delivery questions, and human handoff.&lt;/p&gt;

&lt;p&gt;After the first real conversations, review the transcripts and improve the knowledge base. A good AI support bot is not a one-time launch. It is a support process that gets clearer every week.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;New tutorials and product updates are announced in our &lt;a href="https://t.me/flowcastle" rel="noopener noreferrer"&gt;Telegram channel&lt;/a&gt; — fittingly, that's also where FlowCastle's own community lives.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>telegram</category>
      <category>ai</category>
      <category>support</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Telegram Marketing You Can Actually Measure</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Thu, 30 Jul 2026 20:29:48 +0000</pubDate>
      <link>https://dev.to/flowcastle/telegram-marketing-you-can-actually-measure-36kn</link>
      <guid>https://dev.to/flowcastle/telegram-marketing-you-can-actually-measure-36kn</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://flowcastle.ai/blog/telegram-marketing-automation?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;FlowCastle blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most Telegram marketing tools answer one question well: how many messages went out. Sent, delivered, sometimes clicked — and that is where the reporting ends. Whether any of those sends produced a signup, a payment, or a booked call is left to guesswork.&lt;/p&gt;

&lt;p&gt;That gap is why we built FlowCastle's marketing stack around &lt;strong&gt;goals&lt;/strong&gt; instead of counters. This article walks through the four pieces — broadcasts, drip sequences, conversion goals, and AI insights — and shows how they connect, with real screenshots from the product.&lt;/p&gt;

&lt;h2&gt;
  
  
  Broadcasts that report conversions, not just deliveries
&lt;/h2&gt;

&lt;p&gt;FlowCastle broadcasts do the expected things: one-off and scheduled sends, recurring campaigns, audience filters on any contact variable or past behavior, and A/B splits when you want to test copy.&lt;/p&gt;

&lt;p&gt;The difference shows up after the send. Every broadcast is scored against the goals you define, so next to "delivered" you see the number that matters: how many recipients went on to convert, and which goal they hit. Instead of comparing two campaigns by open-rate folklore, you compare them by attributed conversions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqw8b9j1vu3txrwnmu1tk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqw8b9j1vu3txrwnmu1tk.png" alt="Broadcast analytics in FlowCastle showing delivery stats and goal conversions attributed to the broadcast" width="799" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Drip sequences with per-step conversion
&lt;/h2&gt;

&lt;p&gt;Sequences are timed drips: a contact subscribes (after a lead form, a purchase, a /start — any trigger you choose), then receives a series of messages on the schedule you set. Nurture flows, onboarding, winbacks, and re-engagement all run on the same machinery.&lt;/p&gt;

&lt;p&gt;Each step reports its own conversion. A contact counts as converted when they hit the sequence's goal &lt;em&gt;after&lt;/em&gt; entering it — so you see exactly which step does the work and which step readers ignore. When step 3 converts and step 4 doesn't, you shorten the sequence instead of guessing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm8wqboim415ghlf5dp2n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm8wqboim415ghlf5dp2n.png" alt="A drip sequence in FlowCastle with timed steps and per-step conversion stats" width="800" height="576"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Goals: define what a conversion is
&lt;/h2&gt;

&lt;p&gt;A goal is any event you care about: a button click, a completed payment, a submitted form — or something that happens outside Telegram entirely. FlowCastle's website tracking connects a visitor on your site to the same person in the bot, so "signed up on the website" can be a goal that a Telegram broadcast gets credit for. Tracked links carry the attribution: when a contact clicks a button in a broadcast and converts on your site, the chain from send to conversion is recorded, UTM source included.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5dg4q5p0i1o79j70iir3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5dg4q5p0i1o79j70iir3.png" alt="The Goals view in FlowCastle listing conversion goals with event counts" width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Goals also show up on contacts themselves — you can filter your audience by who converted and who did not, and use that filter in the next broadcast.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI insights: the analysis you would do if you had time
&lt;/h2&gt;

&lt;p&gt;Counting is necessary; interpreting is where teams stall. FlowCastle's analytics include AI-generated insight cards that read your funnel data and surface the findings a growth analyst would: which traffic sources bring contacts that actually convert, which sequence steps carry the conversions, where a funnel leaks, what changed since last period.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgc33ghso7skwne2ks8f9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgc33ghso7skwne2ks8f9.png" alt="AI Insights cards in FlowCastle analytics highlighting which sources and sequences convert" width="800" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The point is not that AI writes a report. The point is that the underlying data model — every send tied to goals and sources — makes the analysis possible at all. Tools that only count sends have nothing to analyze.&lt;/p&gt;

&lt;h2&gt;
  
  
  How this compares to mailing-first tools
&lt;/h2&gt;

&lt;p&gt;Dedicated mailing platforms are genuinely good at volume, and some bundle a sales CRM — we compare honestly in &lt;a href="https://flowcastle.ai/compare/flowcastle-vs-bothelp?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;FlowCastle vs BotHelp&lt;/a&gt; and the broader &lt;a href="https://flowcastle.ai/blog/best-telegram-bot-builders?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;Telegram bot builder roundup&lt;/a&gt;. The trade-off to understand is measurement: mailing-focused tools report on mailings, while FlowCastle reports on outcomes. If your marketing decisions come down to "did this campaign make money," the goal layer is the feature to look for.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Can I track conversions that happen on my website, not in Telegram?&lt;/strong&gt;&lt;br&gt;
Yes. The website tracking script identifies the visitor as the same person who talks to your bot, so on-site events (signup, purchase) become goals attributable to Telegram broadcasts and sequences.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do sequences and broadcasts share the same goals?&lt;/strong&gt;&lt;br&gt;
Yes — goals are defined once and every broadcast, sequence, and flow reports against them, which is what makes cross-channel comparison possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does FlowCastle support A/B testing?&lt;/strong&gt;&lt;br&gt;
Yes — random-split branches let you test message variants, and goal attribution tells you which variant converted rather than which one got more clicks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it on your own funnel
&lt;/h2&gt;

&lt;p&gt;The fastest way to see the loop is to run it: define one goal, send one broadcast, and watch the attribution land. Start from a &lt;a href="https://flowcastle.ai/templates?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;ready-made template&lt;/a&gt; or explore the &lt;a href="https://flowcastle.ai/features/analytics?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;analytics feature page&lt;/a&gt; for a deeper look at the reporting.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;New tutorials and product updates are announced in our &lt;a href="https://t.me/flowcastle" rel="noopener noreferrer"&gt;Telegram channel&lt;/a&gt; — fittingly, that's also where FlowCastle's own community lives.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>telegram</category>
      <category>marketing</category>
      <category>analytics</category>
      <category>chatbot</category>
    </item>
    <item>
      <title>The 7 Best Telegram Bot Builders in 2026</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Thu, 30 Jul 2026 20:28:39 +0000</pubDate>
      <link>https://dev.to/flowcastle/the-7-best-telegram-bot-builders-in-2026-3dah</link>
      <guid>https://dev.to/flowcastle/the-7-best-telegram-bot-builders-in-2026-3dah</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://flowcastle.ai/blog/best-telegram-bot-builders?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;FlowCastle blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Full disclosure up front: we build &lt;a href="https://flowcastle.ai/?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;FlowCastle&lt;/a&gt;, one of the tools on this list. That is exactly why this comparison stays honest — for several of the platforms below there are real situations where they are the better choice, and we say so. Every claim here is based on the platforms' current public feature sets and pricing as of July 2026.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The short version:&lt;/strong&gt; if Telegram is your main channel and your bot needs real logic, use &lt;strong&gt;FlowCastle&lt;/strong&gt;. If your marketing lives on Instagram, use &lt;strong&gt;Manychat&lt;/strong&gt;. If you want one suite for email, SMS, and chat, use &lt;strong&gt;SendPulse&lt;/strong&gt;. If you have an engineering team that wants open-source control, use &lt;strong&gt;Botpress&lt;/strong&gt;. The rest of this article is the long version — who each tool is actually for.&lt;/p&gt;

&lt;h2&gt;
  
  
  At a glance
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Best for&lt;/th&gt;
&lt;th&gt;Custom logic&lt;/th&gt;
&lt;th&gt;Pricing model&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;FlowCastle&lt;/td&gt;
&lt;td&gt;Telegram-first bots with real logic&lt;/td&gt;
&lt;td&gt;TypeScript + HTTP in the flow&lt;/td&gt;
&lt;td&gt;Plan-based&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Manychat&lt;/td&gt;
&lt;td&gt;Instagram/Meta DM marketing&lt;/td&gt;
&lt;td&gt;External backend needed&lt;/td&gt;
&lt;td&gt;Per active contact&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SendPulse&lt;/td&gt;
&lt;td&gt;All-in-one marketing (email + SMS + chat)&lt;/td&gt;
&lt;td&gt;API calls only&lt;/td&gt;
&lt;td&gt;Free tier, scales with subscribers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chatfuel&lt;/td&gt;
&lt;td&gt;Meta-ecosystem commerce&lt;/td&gt;
&lt;td&gt;Templates + limited code&lt;/td&gt;
&lt;td&gt;Subscription&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Botpress&lt;/td&gt;
&lt;td&gt;Engineering teams, AI agents&lt;/td&gt;
&lt;td&gt;Full code, you own it&lt;/td&gt;
&lt;td&gt;Free tier + cloud/self-hosted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BotHelp&lt;/td&gt;
&lt;td&gt;Funnels and broadcasts (CIS market)&lt;/td&gt;
&lt;td&gt;Integration-based&lt;/td&gt;
&lt;td&gt;Subscription&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BotMother&lt;/td&gt;
&lt;td&gt;One bot on many channels (incl. Viber/VK)&lt;/td&gt;
&lt;td&gt;Plugins, limited&lt;/td&gt;
&lt;td&gt;Subscription&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  1. FlowCastle — Telegram-first, with a real code escape hatch
&lt;/h2&gt;

&lt;p&gt;FlowCastle is a visual flow builder designed around Telegram rather than porting a Meta-first product to it. That shows up in the details: native Telegram Payments with catalog and orders, inline keyboards, broadcasts that double as a scheduler, and deep-link entry points into any flow.&lt;/p&gt;

&lt;p&gt;The differentiator is the ceiling. Conditions, variables, and HTTP requests are visual; when no-code runs out, you write TypeScript actions inside the flow instead of standing up an external backend — and if you are not a developer, the built-in AI assistant writes the code from a plain-language description. The same AI can draft a whole flow from a prompt. FlowCastle also ships an MCP server, so AI agents like Claude and Cursor can build and edit your bots programmatically — as of mid-2026, no other tool on this list offers that.&lt;/p&gt;

&lt;p&gt;Marketing is a first-class citizen too, and a measurable one: broadcasts and drip sequences are tied to goals, so you see conversion attribution per broadcast, sequence step, and traffic source, with AI insights that analyze UTM sources and sequence performance rather than just counting sends.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where it is not the right pick:&lt;/strong&gt; FlowCastle is Telegram-first with web chat live and WhatsApp/Instagram still on the roadmap. If your audience is on Instagram or Viber today, look at Manychat or BotMother instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Manychat — the Instagram marketing standard
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://flowcastle.ai/compare/flowcastle-vs-manychat?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;Manychat&lt;/a&gt; is the biggest name in social-DM automation, and for Instagram funnels — comment-to-DM, story-reply triggers, ad integrations — it is best-in-class. Telegram is supported, but as one of seven channels rather than the product's center.&lt;/p&gt;

&lt;p&gt;Two things to know before committing: complex data work (parsing API responses, transformations) requires building your own external backend, and pricing is per active contact — a growing audience directly grows the bill, with AI features as a separate paid add-on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it when&lt;/strong&gt; your marketing lives on Instagram and Telegram is a side channel.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. SendPulse — the all-in-one marketing suite
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://flowcastle.ai/compare/flowcastle-vs-sendpulse?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;SendPulse&lt;/a&gt; is not primarily a bot builder — it is a marketing platform where chatbots sit alongside email, SMS, and web push with a shared contact base and CRM. Its Telegram flows are solid for marketing funnels, and the free tier is genuinely generous for small lists.&lt;/p&gt;

&lt;p&gt;The trade-off is depth: custom logic is limited to API calls, and the whole product is oriented toward campaigns rather than application-like bots.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it when&lt;/strong&gt; you want one tool for email + SMS + chat, and your bots are funnels rather than products.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Chatfuel — Meta-ecosystem commerce
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://flowcastle.ai/compare/flowcastle-vs-chatfuel?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;Chatfuel&lt;/a&gt; is a mature builder focused on Instagram, Messenger, and WhatsApp commerce — comment-to-DM, abandoned-cart flows, Shopify integrations. It is a safe, established choice inside the Meta ecosystem.&lt;/p&gt;

&lt;p&gt;For Telegram specifically it is a weaker fit: the channel is not the focus, and logic beyond templates is limited.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it when&lt;/strong&gt; you run e-commerce DM automation on Meta surfaces.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Botpress — for engineering teams
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://flowcastle.ai/compare/flowcastle-vs-botpress?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;Botpress&lt;/a&gt; is a developer-first, open-source platform for building AI agents, with cloud and self-hosted options. If you have engineers who want to own the architecture, choose LLMs freely, and self-host for compliance, it offers control no managed SaaS matches.&lt;/p&gt;

&lt;p&gt;That control is also the cost: without dedicated developers you will hit a wall, and self-hosting means you run the servers, scaling, and security patches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it when&lt;/strong&gt; you have an engineering team and the bot is a deep, custom AI agent.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. BotHelp — mass mailings and a sales CRM for the CIS market
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://flowcastle.ai/compare/flowcastle-vs-bothelp?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;BotHelp&lt;/a&gt; is built around mass mailings across Telegram and WhatsApp plus a built-in mini-CRM, and it is especially strong in the Russian-speaking market's info-business stack.&lt;/p&gt;

&lt;p&gt;Two limits to know: flow logic beyond funnels and integrations is not what it is for, and its analytics are mailing-focused counters — if you need to know which broadcast or sequence step actually converted, that measurement layer is where FlowCastle goes further.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it when&lt;/strong&gt; you need very-large-scale mailings with a built-in sales pipeline CRM.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. BotMother — one project, many channels
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://flowcastle.ai/compare/flowcastle-vs-botmother?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;BotMother&lt;/a&gt; takes a screen-based approach: you link "screens" and deploy the same project to Telegram, WhatsApp, Viber, VK, and more. For menu-and-form bots that must exist on many channels at once — including channels most builders skip, like Viber and VK — it covers unusual surface area.&lt;/p&gt;

&lt;p&gt;Logic-heavy bots are the wrong fit: the screen model plateaus where flow-graph builders keep going.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it when&lt;/strong&gt; you need the same simple bot on many channels, including Viber or VK.&lt;/p&gt;

&lt;h2&gt;
  
  
  What about writing code yourself?
&lt;/h2&gt;

&lt;p&gt;For completeness: if you are a developer building something truly custom, frameworks like grammY or aiogram plus the raw Bot API remain the maximum-control option. You trade every convenience above — visual editing, hosting, analytics, broadcasts — for total freedom. Most teams that start here eventually rebuild the undifferentiated parts (payments, broadcasts, contact management) that platforms give you out of the box.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is the best free Telegram bot builder?&lt;/strong&gt;&lt;br&gt;
SendPulse has the most generous free tier for marketing-style bots. Botpress is free if you self-host and have the engineering capacity. FlowCastle's plans include a free way to start building.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which builder handles payments in Telegram best?&lt;/strong&gt;&lt;br&gt;
FlowCastle has native Telegram Payments with catalog and order tracking inside the flow. On most other platforms payments are external integrations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I build a Telegram bot without coding at all?&lt;/strong&gt;&lt;br&gt;
Yes — every tool on this list except Botpress is usable without code. The difference is the ceiling: on most platforms complex logic eventually requires an external backend, while FlowCastle moves that ceiling by putting TypeScript and HTTP requests inside the flow, written by an AI assistant if you prefer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Which is best for AI-powered bots?&lt;/strong&gt;&lt;br&gt;
Botpress for custom-engineered agents; FlowCastle for AI agents with knowledge bases, intent routing, and human handoff without code. Manychat's AI is a paid add-on and comparatively basic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to go next
&lt;/h2&gt;

&lt;p&gt;The fastest way to evaluate any builder is to ship something small in it. FlowCastle's &lt;a href="https://flowcastle.ai/templates?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;template catalog&lt;/a&gt; has working bots — lead capture, AI support, digests — you can clone and have running in minutes, free.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;New tutorials and product updates are announced in our &lt;a href="https://t.me/flowcastle" rel="noopener noreferrer"&gt;Telegram channel&lt;/a&gt; — fittingly, that's also where FlowCastle's own community lives.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>telegram</category>
      <category>chatbot</category>
      <category>nocode</category>
      <category>comparison</category>
    </item>
    <item>
      <title>Build a Lead Bot in Telegram in 10 Minutes</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Fri, 17 Jul 2026 19:41:42 +0000</pubDate>
      <link>https://dev.to/flowcastle/build-a-lead-bot-in-telegram-in-10-minutes-25hf</link>
      <guid>https://dev.to/flowcastle/build-a-lead-bot-in-telegram-in-10-minutes-25hf</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://flowcastle.ai/blog/lead-bot-in-telegram?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;FlowCastle blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A lead bot earns its keep when it does two things well: it replies instantly, and it asks the right questions before a human gets involved. If it only says "leave your phone number," it is a slower contact form. If it collects the reason for the request, the budget range, and the expected timing, your team can decide who should answer first and what to say when they do.&lt;/p&gt;

&lt;p&gt;In this walkthrough, you will build the simple version: one Telegram flow that welcomes a new contact, asks three button-based questions, stores the answers on the contact, and sends a qualified lead summary to your team. No code, no AI support branch, no complex routing. The point is to get a useful lead bot live in about 10 minutes, then improve the questions after real conversations start coming in.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you'll build
&lt;/h2&gt;

&lt;p&gt;The finished flow has one straight path: a welcome message, three qualifying questions, a team notification, and a final confirmation for the contact. Each question stores the last clicked button directly into a contact variable, so the context follows the person later for personalization, filters, and broadcasts. If you'd rather skip the build entirely, a &lt;a href="https://flowcastle.ai/templates/lead-qualification?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;ready-made template&lt;/a&gt; covering this exact flow is linked at the end of the article.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foinya5j7igtrokel6fct.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Foinya5j7igtrokel6fct.png" alt="Finished Telegram lead bot flow on the FlowCastle canvas with welcome, questions, saved answers, team notification, and confirmation." width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The complete lead-qualification flow before publishing it to Telegram.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Create the flow and the welcome message
&lt;/h2&gt;

&lt;p&gt;Start with a new flow in the editor. Add a message block near the beginning of the canvas and write the first thing the bot will say when someone opens the chat. Keep this message short. It should explain who is answering and why the bot is asking questions.&lt;/p&gt;

&lt;p&gt;Use this opener:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hi, thanks for reaching out. I will ask 3 quick questions so our team can understand what you need and reply with the right context.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That copy does three jobs. It confirms the conversation started, tells the person the bot will not waste their time, and makes the qualification step feel normal. Avoid a long sales pitch here. The user has already opened Telegram; the next best action is to start the questions.&lt;/p&gt;

&lt;p&gt;Place the welcome message before the first question. Connect it forward so the conversation continues automatically after the opener.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fta9hygpokvr2tqcjlaf5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fta9hygpokvr2tqcjlaf5.png" alt="FlowCastle editor showing the welcome message block for a Telegram lead bot." width="748" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The welcome message sets expectations before the qualification questions begin.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Ask qualifying questions with buttons
&lt;/h2&gt;

&lt;p&gt;Now add the three questions, one at a time, each as a message with buttons. Buttons beat free text here: answers stay clean, consistent, and easy to reuse, while the person can still reply in one tap.&lt;/p&gt;

&lt;p&gt;Question 1:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What do you need help with?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Buttons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website lead bot&lt;/li&gt;
&lt;li&gt;Telegram automation&lt;/li&gt;
&lt;li&gt;Support bot&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Question 2:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What budget range fits this project?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Buttons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Under $500&lt;/li&gt;
&lt;li&gt;$500–$2k&lt;/li&gt;
&lt;li&gt;$2k+&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Question 3:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When do you want to launch?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Buttons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This week&lt;/li&gt;
&lt;li&gt;This month&lt;/li&gt;
&lt;li&gt;Just researching&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Connect the welcome message to Question 1, then connect each answer path to Question 2, then Question 3. For a first version, all answers can continue to the same next question. You are not trying to build a complex decision tree yet. You are collecting three fields that make the lead useful.&lt;/p&gt;

&lt;p&gt;If your business needs different labels, change the wording, but keep the shape. Three questions is enough to qualify without making the chat feel like paperwork.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvs0fus8qbzqykk7wf61h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvs0fus8qbzqykk7wf61h.png" alt="Message editor drawer for the first qualifying question, showing the message text, the media section, and the list of answer buttons." width="800" height="1923"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Each question is one message block: text, optional media, and its own button list.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2rxr99k0i4xbx90om564.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2rxr99k0i4xbx90om564.png" alt="Three button-based qualification questions on the FlowCastle canvas: need, budget, and launch timeline." width="800" height="233"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Button answers keep lead data clean and branchable.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Save answers to the contact
&lt;/h2&gt;

&lt;p&gt;For each question message, use the button section's &lt;strong&gt;Store last clicked button in&lt;/strong&gt; setting and choose a contact variable. No separate action block is needed. Use clear variable names so the values make sense outside the flow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;lead_need&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;lead_budget&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;lead_timeline&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These variables are the difference between a chat and a reusable contact profile: when someone from your team opens the contact later, the key details are already attached, ready for follow-up broadcasts, filters, or personalization.&lt;/p&gt;

&lt;p&gt;For example, a contact who chose "Support bot," "$500–$2k," and "This month" should carry those values after the conversation ends. The team should not have to scroll through the chat transcript to understand why the person reached out.&lt;/p&gt;

&lt;p&gt;Configure this on all three question messages before the team notification fires. The important rule is simple: every selected button should end up on the contact before the handoff.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4rgd3e1p4896l14js81.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4rgd3e1p4896l14js81.png" alt="Button settings panel showing the " width="800" height="737"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The button settings panel is where a question's answer gets pointed at a contact variable — here, &lt;code&gt;lead_need&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Notify the team with the answers attached
&lt;/h2&gt;

&lt;p&gt;Once the three answers are saved, add the team notification. This is the handoff point: the lead has finished the short qualification path, and a human can now reply with enough context to be useful.&lt;/p&gt;

&lt;p&gt;Write a compact notification message, then insert the saved answers with the variable picker. You do not need to type technical placeholders by hand: click the variable button in the message field and choose &lt;code&gt;lead_need&lt;/code&gt;, &lt;code&gt;lead_budget&lt;/code&gt;, and &lt;code&gt;lead_timeline&lt;/code&gt; from the contact variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;New qualified lead from Telegram

Need: {{lead_need}}
Budget: {{lead_budget}}
Timeline: {{lead_timeline}}

Open the Telegram chat and reply while the context is fresh.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the editor those fields appear as variable chips, not as raw code — the &lt;code&gt;{{...}}&lt;/code&gt; above is simply how the placeholder reads; you insert it by clicking the variable button, never by typing the braces. Send this notification to the Telegram chat or channel your team already uses for incoming leads, and keep it compact: the goal is context for the next human, not a full CRM record.&lt;/p&gt;

&lt;p&gt;A message to your team's chat is the simplest handoff. In higher-volume setups, you might instead open a live conversation for an operator inside FlowCastle — covered in the &lt;a href="https://flowcastle.ai/blog/ai-support-bot?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;AI support walkthrough&lt;/a&gt; — or push the lead into Google Sheets or a CRM, which we'll cover in an upcoming article.&lt;/p&gt;

&lt;p&gt;After the notification, add a short confirmation back to the contact:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Thanks. I sent your answers to the team, and someone will reply here soon.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That final message closes the loop. The person knows the bot did something with their answers instead of dropping them into a silent form.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl6dz41h1ojq3af7yny48.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fl6dz41h1ojq3af7yny48.png" alt="FlowCastle notification editor with a variable picker inserting lead_need, lead_budget, and lead_timeline into the team message." width="800" height="1231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Use the variable picker to add contact fields as chips in the notification message.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Publish and test
&lt;/h2&gt;

&lt;p&gt;To run the flow in Telegram, connect your bot token from &lt;a class="mentioned-user" href="https://dev.to/botfather"&gt;@botfather&lt;/a&gt; — &lt;a href="https://core.telegram.org/bots/tutorial" rel="noopener noreferrer"&gt;Telegram's official bot tutorial&lt;/a&gt; walks through getting the token from &lt;a class="mentioned-user" href="https://dev.to/botfather"&gt;@botfather&lt;/a&gt;. FlowCastle asks for the token once when you connect the bot.&lt;/p&gt;

&lt;p&gt;After the bot is connected, publish the flow and use FlowCastle's Test panel before sending real traffic. Send &lt;code&gt;/start&lt;/code&gt;, read the welcome message, tap one button for each question, and open the Chat tab to confirm it shows the same answers you selected.&lt;/p&gt;

&lt;p&gt;Test the boring path first: one complete conversation from start to finish. Then test one or two different answer combinations. You are looking for three things: every question appears in the right order, every selected answer is saved to the contact, and the team notification is readable without opening the whole chat history.&lt;/p&gt;

&lt;p&gt;If any of those fail, fix the flow before sending traffic to the bot. A lead bot is only useful when the handoff is trustworthy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0cqkdx5cdny5nanvsmpr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0cqkdx5cdny5nanvsmpr.png" alt="Test panel Chat tab showing the full test conversation: the welcome message, three answered questions, and the final confirmation." width="800" height="1634"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Chat tab shows the entire test conversation end to end, including the confirmation message.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it on your own site next
&lt;/h2&gt;

&lt;p&gt;When the Telegram version works, run the same flow in the website chat widget without rebuilding it — it's a JavaScript snippet embed, and the bubble on flowcastle.ai is itself a FlowCastle bot, so the same logic can greet visitors on your site and in Telegram.&lt;/p&gt;

&lt;h2&gt;
  
  
  When you outgrow this flow
&lt;/h2&gt;

&lt;p&gt;The next version is not "more questions." It is a broader lead-capture template with AI answers from a knowledge base, live-agent takeover, and, coming soon, tracking the same person from your website to Telegram. If you need the support use case today, read the &lt;a href="https://flowcastle.ai/blog/ai-support-bot?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;AI support walkthrough&lt;/a&gt;; keep this tutorial focused on the fast qualification flow.&lt;/p&gt;

&lt;p&gt;Clone the &lt;a href="https://flowcastle.ai/templates/lead-qualification?utm_source=devto&amp;amp;utm_medium=syndication" rel="noopener noreferrer"&gt;Lead Qualification template&lt;/a&gt;, change the three questions to match your sales process, and publish it to your Telegram bot. The first version should stay simple: greet, qualify, save, notify, and let a human take over with context.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;New tutorials and product updates are announced in our &lt;a href="https://t.me/flowcastle" rel="noopener noreferrer"&gt;Telegram channel&lt;/a&gt; — fittingly, that's also where FlowCastle's own community lives.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>telegram</category>
      <category>chatbot</category>
      <category>nocode</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
