Telegram AI agent: how to set one up inside a flow
A Telegram AI agent is a bot that holds a free-text conversation guided by your instructions, instead of relying only on buttons. Most setups stop at the prompt and skip the next question: what happens after the conversation ends? This guide covers the prompt, the goal and the time limit, with a real example, how billing works and when you shouldn’t use AI at all.
A quick note: this blog belongs to Flow4You and the example uses our editor, whose interface is in Portuguese today. The logic of writing a verifiable goal works in any tool.
What a Telegram AI agent is
Many people search for this as “AI chatbot” or “AI bot”. In Flow4You, it’s the AI Agent: a conversation flow block that you add inside Send Message (“Enviar Mensagem”), alongside text, images or buttons.
That changes the design. It isn’t a loose brain answering everything your bot receives. It has one job at one point in the conversation, and when it finishes, the flow moves down a defined path.
A rule-based bot handles what’s predictable: a button, a wait, a tag. The AI Agent handles the part where a lead types anything and someone has to understand it. The two work together, and our Telegram bot builder guide shows where each one fits.
Telegram’s rule still applies: bots can’t start conversations. The agent only talks to people who already talked to the bot.
The three settings
The block has three fields.
Prompt: who the agent is and how it talks
This is the background instruction. It says who the agent is, what it knows, how it talks and what it can’t do. The lead never sees this text, only the messages the agent writes from it.
A good prompt covers four things:
- Identity and tone. Who it is and how it sounds. “Direct and friendly” already helps.
- What it knows. Product, price, timelines and what’s included. What you don’t write, it doesn’t know, and it may guess.
- Pace. “One question at a time” prevents an interrogation.
- What not to do. Promising results, offering discounts, making up deadlines.
Goal: what it has to achieve
This separates an agent from an endless chat. The goal (“Objetivo”) says when the job is done.
Write an observable condition, something you can check by reading the conversation.
| Goal | Works? | Why |
|---|---|---|
| ”The lead gave their email and preferred time” | Yes | You can check it in the chat |
| ”The lead said whether they sell on Telegram and what” | Yes | Two objective facts |
| ”The lead got interested” | No | It’s interpretation, so every chat becomes a guess |
| ”Convince the lead to buy” | No | You can’t verify it, and that’s not the chat’s job |
With a vague goal, leads land on one exit or the other with no real criterion, and the rest of your flow inherits that error.
Time limit: how long the agent waits
This is the deadline for the goal to happen, in hours and minutes. The default is 24 hours. If time runs out without the goal being met, the lead takes the “not reached” exit.
Set it by context. With an offer that expires soon, shorten it. For relaxed qualification, 24 hours is usually enough. Nobody answers instantly all the time, and a very short limit drops people who were only busy.
The two exits
The block ends in two paths:
- Goal reached (“Objetivo atingido”): the flow continues with people who met the condition.
- Not reached (“Não atingido”): the flow continues with everyone else, including people who went quiet until the time limit.
The value is in what you connect to each exit. On either one you can apply tags with an Action block or continue with messages. The agent doesn’t call an operator by itself: for that, apply a tag your operators filter by in live chat. The agent’s latest reply is stored in {{resposta_ia}}, a variable you can use in later blocks.
Leaving the “not reached” exit empty is the classic mistake. That lead needs a next step more than anyone.
A real prompt and goal
Picture a course about selling on Telegram, with a free class as the lead magnet. After the class, the job is to find out who’s ready to hear the offer.
Prompt:
You are Bia, from the Selling on Telegram course team. Be direct and friendly, in short sentences, one question at a time. Your job is to understand where the lead is: whether they already sell on Telegram and what they sell. The course costs $97, has 6 modules and includes 1 year of access. If asked anything else, say you’ll pass it to the team. Never promise results, revenue or payback time. Never offer a discount. If asked whether you’re an AI, say yes.
Goal:
The lead said whether they already sell on Telegram and stated what their product is.
The course details are made up for the example, so replace them with yours. Notice what the goal leaves out: buying. The agent qualifies, and the offer comes in the next block, which you control word for word.
A testing tip: use the flow’s link in your own Telegram and try to break the agent. Ask something off-script, push for a discount, reply with just “ok”. The failures show what your prompt is missing.
Example flow with the AI Agent
Here’s the full path for the example above:
“See the offer” is a button with a link to your checkout page. Payment happens on your own platform, not in the flow.
The needs-human tag shows up in live chat. An operator filters conversations by that tag, clicks the join button (“Entrar na Conversa”) and continues from where the agent stopped. See how in the Telegram bot live chat guide. While an operator is in the conversation, automation stops replying.
When not to use AI
AI isn’t the default. It’s a tool for one kind of problem: understanding free text. Elsewhere it tends to get in the way.
- When buttons do the job. “I already sell / Not yet” is faster, cheaper and never wrong. Each agent message uses billable AI; a button doesn’t.
- In your welcome message. People who just arrived want what you promised. A direct welcome message usually beats an open conversation.
- When information changes constantly. Prices, seats, today’s coupon. If the prompt goes stale, the agent repeats old data with total confidence.
- On sensitive topics. Refunds, billing, serious complaints, anything with legal or financial risk for the lead. Those go to a person.
- When you can’t say what you want. If you can’t write the goal as one checkable sentence, the problem isn’t AI yet. It’s your design.
Start without AI. Build the flow with buttons, see where people get stuck or ask loose questions, and put the agent only there.
How billing works
The AI Agent is billed separately, by usage: AI consumption is added to your Flow4You subscription. The more conversations it handles, the more it consumes. That’s one more reason to place it where it earns its keep, not on every message.
What breaks in practice
- Empty prompt or goal. The editor warns you: without both, the agent doesn’t run and the lead always takes the “not reached” exit.
- Expecting it to read audio or images. The agent only reads text. If a lead sends anything else, they get an automatic request to type instead.
- A goal that’s an opinion. “Got interested” produces verdicts with no criterion. Use something that appears in writing in the chat.
- A prompt with no data. Without price and timing, it improvises or stalls. Write down what it’s allowed to say.
- Expecting formatting in agent replies. The agent’s messages go out as plain text. If you need a button, bold text or media, put it in the next Send Message block.
- Adding the agent to a broadcast. The block isn’t available in broadcasts, or in a flow opened from a broadcast by the Start flow block. Use a link button with the address of the flow that has the agent:
t.me/yourbot?start=ref_…. - Nothing on the “not reached” exit. The lead stalls and you never find out.
Wrapping up
A good Telegram AI agent isn’t the one that chats nicely. It’s the one with a clear job, that knows when it’s done and hands the lead to the next step with the right tag. Write the goal first, then the prompt.
Flow4You has the AI Agent as an editor block, next to messages, tags and live chat. AI is billed separately by usage, and the app and pricing are in Portuguese and Brazilian reais.
Frequently asked questions
Does the AI Agent replace an operator?
No. It clears the conversations that text can solve and hands off the rest with a tag. Hard cases, complaints and exceptions still go to a person on your team, in live chat.
Will leads know they're talking to AI?
That depends on your prompt and the conversation. Our advice is not to pretend it's a person. If a lead asks, an honest answer protects their trust, so put that instruction in the prompt.
Can the AI Agent message people who never talked to the bot?
No. Telegram's rule applies here too: bots can't start conversations. The AI Agent runs inside a flow, after the lead has already talked to the bot.
Can one flow have more than one AI Agent?
Yes, at different points in the path, one per Send Message block, each with its own prompt and goal. In practice, start with one. A well-written goal gets you further than two vague agents.

CEO - Flow4You & Track4you
Digital business strategist specialized in automation and paid traffic across many niches. Leads Flow4You (Telegram bots and flows) and Track4you (conversion tracking). Works behind the scenes of several of Brazil's largest iGaming, binary options and infoproduct operations.