Understanding Flows
A flow is the complete journey your bot takes when responding to a user. It's a series of connected steps that run one after another.
What is a Flow?
Think of a flow like a conversation:
- Something triggers it → The user sends a command
- Your bot processes it → Maybe checks some conditions
- Something happens → The bot sends a response
Real-World Example
Let's say you want a bot that tells users if a store is open:
User asks: /hours
Bot checks: Is it between 9am and 5pm?
Bot responds: "We're open!" or "Sorry, we're closed"
This is a flow with:
- 1 trigger (the
/hourscommand) - 1 decision point (checking the time)
- 2 possible outcomes (open or closed)
How Flows Run
When a user interacts with your bot:
- Telegram sends the message to BotGami
- BotGami finds the right flow based on triggers
- The flow runs step by step following the wires
- Actions are executed (messages sent, data saved, etc.)
Most flows complete in under a second. Your users get instant responses.
Multiple Flows
Your bot can have many flows at once. Each one handles different situations:
| Flow | Trigger | What It Does |
|---|---|---|
| Welcome | /start | Greets new users |
| Help | /help | Shows commands |
| Profile | /profile | Shows user info |
| Support | any message | Handles questions |
BotGami automatically picks the right flow based on what the user sends.
Pausing and Resuming
Some flows need to wait for user input:
When a flow asks a question, it pauses and remembers where it was. When the user replies, the flow picks up right where it left off.
This is how you build multi-step conversations!
Key Concepts
| Term | What It Means |
|---|---|
| Trigger | What starts a flow (commands, messages, buttons) |
| Node | One step in a flow (send message, ask question, etc.) |
| Wire | Connection between nodes (shows the path) |
| Branch | When a flow splits into multiple paths |
Next Steps
- Nodes & Connections → — How nodes work
- The Visual Editor → — Tour of the interface