How to hand a Telegram bot conversation to a human
The client clicks “Call operator” and continues the conversation in the same chat. The employee receives the request along with the subject, latest messages and data that the client has already provided. For such a transfer to work, determine in advance who is responsible for the dialogue at each stage and how the client finds out about the change of interlocutor.
Test the diagram on a question that cannot be closed with a button. For example, a client wants to transfer an appointment, but the proposed options do not suit him. The bot must convey the selected service and time so that the employee can immediately offer a solution.
1. Define when to hand over
Add a clear button to call an employee and leave it available in the main scenarios. In addition to an explicit request, the reason for transfer may be a repeated question, an order verification error, or a request that requires a decision from an employee. Fix rules for request types so that the team can explain why the conversation ended up in the queue.
If the client’s question is clear, do not force him to go through the questionnaire again. Ask only that without which the appeal cannot be sent to the address. For example, the order number is useful to the delivery department, but is not needed to ask about operating hours.
2. Preserve the conversation context
Create a contact card with the conversation ID, reason for transmission, subject and time of the last message. Attach an accessible story or a link to it. The employee should be able to see what steps the customer has already completed and what options the bot has suggested.
Limit the data set to what is required to resolve the issue. The order history can be opened using a link from the rights verification panel. You should not send documents or full client cards to an open work chat. The principles of transfer to the accounting system are discussed in the article about the combination of Telegram bot and CRM.
3. Organise the operator queue
Separate the case states. “Pending” means that the request has been saved and can be processed. “Operator” means that the dialogue has a person in charge. Store completed requests separately to see the history and distinguish between a new question and a continuation of an old one.
The employee should see pending requests and the waiting time. If two people press “Take” at the same time, the server should only assign one. Show the second one that the request has already been accepted and update the queue. For transfer between shifts, save the current and previous responsible.
A simple summary of the queue is useful for the manager: time to first response, requests without a responsible person, and dialogues that had to be reopened. First agree on what counts as an answer. Automatic confirmation does not show when the employee started working. To analyze a shift, separate requests outside of working hours from those received when operators are available. This will make it easier to understand where the distribution needs to be changed, and where it is enough to clarify the text for the client.
4. Explain the current status to the customer
Confirm that the enquiry has joined the queue after it is saved. Instead of promising an immediate reply, explain that the request has been received and show working hours if no operators are currently available. New customer messages should be added to the existing enquiry.
If the customer changes their mind, let them cancel the wait and return to the menu. If cancellation happens while an operator is being assigned, the employee should see the current status before replying. Confirmation messages and retry rules can be checked against the article on customer notifications.
5. Configure operator replies
The employee responds from the support panel or CRM. The server checks his right to dialogue, associates the response with the desired request and sends it to the client on behalf of the bot. The “Operator” signature helps distinguish a live response from a menu message.
After transmission, pause automatic replies for this conversation. The bot can continue to save incoming messages and show status, but should not continue the questionnaire in parallel. If the response fails, show this to the employee and save the text for review before retrying.
Check responses with attachments separately from plain text. It must be clear to the operator what kind of request the file relates to and whether the client can open it. If sending a document is interrupted, save the original message and the reason for the error. In the journal, record the assignment, closing, reopening and the result of sending so that the manager can restore the sequence of actions in the event of a controversial situation.
6. Handle retries and failures
If the webhook delivery fails, Telegram may repeat the request. The incoming update_id helps to recognize a repeat and not create a second request. Save the ID along with the processing result. The mechanism is described in Telegram Bot API documentation.
Check the employee notification failure separately. The request itself must remain in the queue, even if the notification has not gone away. After the system is restored, the operator should see the pending request and the client’s history. For attempts to send a response, enter a separate status so that the text is not considered delivered immediately after clicking the button.
7. Return the conversation to the bot
Provide explicit completion of the call. The operator clicks “Close”, the client receives a short confirmation, and then can use the menu again. If additional customer response is needed, use a pending state that retains the owner.
Agree on how to handle the message after closing. For example, using the “Continue Appeal” button, you can return the previous card to the queue, and using the “New Question” button, you can create a separate one. The team needs to see which rule worked so as not to merge different questions from the same client.
8. Test the complete journey
In a test chat, call the operator, send another message, accept the request from the employee and respond. Close the dialog and make sure the bot shows the menu again. Repeat the check without a free operator, if there is a dual assignment, and if the response fails.
Describe in the brief how your team receives requeststo agree on transmission rules, statuses, and review scenarios before development.