Tutorial 4 - Explicit Human Handoff with User Intent
Learn how to implement explicit human handoff functionality using a Dialogflow intent in your Pingstreams integration.
Fork the Tutorial Code
Section titled “Fork the Tutorial Code”We’ll start from Tutorial 1 - Dialogflow as external chatbot, building on the foundation we established there.
You must use the code in Tutorial 1. The code is available on Github here.
Fork the tutorial code using the Fork button. Now you have a copy of the tutorial on your own repo.
Introduction
Section titled “Introduction”In the previous tutorial we learned how to automatically switch to a human agent based on the number of consecutive fallbacks during a conversation.
What if you want the user to explicitly choose to switch to a human during a conversation?
In this case the simplest thing that you need to do is start from any of the above tutorials, adding a specific intent to Dialogflow that will switch to a human agent.
Train the ‘Talk to Agent’ Intent
Section titled “Train the ‘Talk to Agent’ Intent”Open your Agent’s Dialogflow console. Add a new intent. Let’s call this intent ‘talk to agent’. We’ll train this intent with a single phrase (more phrases can be added as a convenience).

Now configure the intent to reply with:
I'm putting you in touch with an operator
\agent
As soon as this phrase reaches Pingstreams, it automatically removes the chatbot and adds a human operator - following the rules you already set up in the Routing section or in the specific department.
Add “Talk to Agent” Button
Section titled “Add “Talk to Agent” Button”To test the new talk-to-agent intent we also place a button under every Dialogflow reply (using microlanguage) to allow the user to ask for an agent after each reply. Let’s train for instance the defaultWelcome Intent to show this optional button (using microlanguage to add the buttons):

On every welcome intent reply the widget will show the “Talk to agent” button:

If we tap the button the “Talk to agent” intent will be invoked and the user will be routed to an agent on the current department (compatible with the routing rules, opening hours and agents availability).

Training Phrases
Section titled “Training Phrases”You can train your “talk to agent” intent with various phrases that users might use to request human assistance:
- “I want to talk to an agent”
- “Connect me to a human”
- “I need help from a person”
- “Can I speak to someone?”
- “Transfer to operator”
- “Human support please”
Best Practices
Section titled “Best Practices”Button Placement
Section titled “Button Placement”- Add “Talk to agent” buttons strategically, not on every response
- Consider adding them after complex questions or when offering multiple options
- Use them in FAQ-style responses where users might need more detailed help
Intent Design
Section titled “Intent Design”- Keep the handoff message friendly and informative
- Set user expectations about wait times if applicable
- Consider different responses based on business hours
User Experience
Section titled “User Experience”- Make the handoff seamless and natural
- Provide clear confirmation that the request has been processed
- Ensure the transition message is branded appropriately
Advanced Configurations
Section titled “Advanced Configurations”You can enhance this basic implementation by:
- Contextual handoff: Different handoff messages based on the conversation context
- Skill-based routing: Route to specific agent groups based on the conversation topic
- Priority handling: Mark certain handoff requests as high priority
- Analytics tracking: Track which topics most commonly lead to human handoff
Enjoy Pingstreams!