Guide Telegram chats through a clear path from onboarding to human handoff and then after sales follow up. It collects customer details in free text, switches to a human when needed, and returns context back to the bot for faster answers. Built for teams that want control and a safe human fallback.
Incoming messages from Telegram are checked in Redis to find the current state. A Switch routes each chat to one of three stages. The Onboarding Agent, powered by OpenAI and Redis memory, welcomes the user and gathers key details. An Information Extractor reads recent messages and pulls first name, last name, email, phone, and address without rigid forms. A Code and If check make sure nothing is missing. When ready, a subworkflow triggers a Telegram send and wait step to alert a human. The state changes to human and a canned reply protects the agent. When the human replies with a summary, memory updates, the state flips to bot, and the After Sales Agent continues. The agent can also call a Handoff Tool to transfer back to a person on request.
You need a Telegram bot token, an OpenAI API key, and a Redis instance. Add your human chat id, confirm Redis keys, then activate the workflow. Expect faster lead qualification, fewer data entry errors, and quicker follow ups. Useful for sales intake, support triage, and small teams that need human review on complex chats.