Features
- Natural Language Understanding: Leverage Google’s AI for intent detection
- Automated Responses: Handle common queries without human intervention
- Multi-region Support: Deploy in multiple Google Cloud regions
- Custom Actions: Define custom actions for advanced workflows
- Seamless Handoff: Transfer to human agents when needed
- Rich Responses: Support for text and custom payload responses
- Inbox-Level Configuration: Configure different bots for different inboxes
Prerequisites
- Admin access to your Chatwoot account
- Google Cloud Platform account
- Dialogflow agent created and configured
- Service account credentials with Dialogflow API access
Setup Instructions
Step 1: Create a Dialogflow Agent
- Go to the Dialogflow Console
- Create a new agent or select an existing one
- Configure intents and responses for your use case
- Note your Project ID (found in agent settings)
Step 2: Generate Service Account Credentials
- Open Google Cloud Console
- Navigate to IAM & Admin > Service Accounts
- Create a new service account or select an existing one
- Grant the Dialogflow API Client role
- Create a JSON key for the service account
- Download and save the credentials JSON file
Step 3: Configure in Chatwoot
- Navigate to Settings > Integrations in Chatwoot
- Find Dialogflow in the integrations list
- Click Configure
- Fill in the required fields:
Required Fields
Dialogflow Project ID- Global - Default (global)
- AS-NE1 - Tokyo, Japan (asia-northeast1)
- AU-SE1 - Sydney, Australia (australia-southeast1)
- EU-W1 - St. Ghislain, Belgium (europe-west1)
- EU-W2 - London, England (europe-west2)
Step 4: Select Inbox
Choose which inbox should use the Dialogflow bot. You can create multiple Dialogflow integrations for different inboxes with different bot configurations.Step 5: Test the Integration
- Send a test message to the configured inbox
- Verify that the Dialogflow bot responds
- Test various intents to ensure proper configuration
How It Works
The Dialogflow integration processes messages through the following flow:- Message Received: Customer sends a message to the inbox
- Session Creation: A unique session ID is created for the conversation
- Intent Detection: Message is sent to Dialogflow for intent detection
- Response Processing: Dialogflow returns fulfillment messages
- Reply Creation: Responses are posted back to the conversation
- Action Handling: Custom actions are processed if defined
Session Management
The integration creates session paths based on the region: Global Region:Response Types
Dialogflow can return two types of responses: Text Responses: Simple text messages sent directly to the conversation. Payload Responses: Custom JSON payloads for advanced use cases:API Integration
The Dialogflow integration is managed through the hooks API:Create Integration
Update Settings
Delete Integration
Implementation Details
The Dialogflow integration uses:- Processor Service:
Integrations::Dialogflow::ProcessorService - Google Cloud Library:
google-cloud-dialogflowv2 - Hook Type: Inbox-level integration
- Timeout: 10 seconds for API calls
Configuration Schema
Endpoint Configuration
The integration automatically configures the correct Dialogflow endpoint based on region:- Global:
dialogflow.googleapis.com - Regional:
{region}-dialogflow.googleapis.com
Advanced Configuration
Custom Actions
You can define custom actions in your Dialogflow fulfillment responses:process_action method:
Updated Messages
The integration also processesmessage.updated events, which can be used for form submissions or interactive elements:
Troubleshooting
Permission Denied Error
Issue:Google::Cloud::PermissionDeniedError in logs.
Solution:
- Verify service account has Dialogflow API Client role
- Enable Dialogflow API in Google Cloud Console
- Check credentials JSON is valid and complete
- Ensure project ID matches the service account project
Bot Not Responding
Issue: Messages are sent but no bot response appears. Solution:- Check that the integration status is “enabled”
- Verify credentials are correctly configured
- Ensure Dialogflow agent has intents configured
- Check Dialogflow Console for detected intents
- Review Chatwoot logs for error messages
Invalid Credentials
Issue: Credentials validation fails during setup. Solution:- Ensure you’re pasting the complete JSON file
- Verify JSON is properly formatted (use a JSON validator)
- Check for extra whitespace or characters
- Re-download credentials from Google Cloud Console
Wrong Region Error
Issue: API calls fail with region-related errors. Solution:- Verify your Dialogflow agent’s region in the Dialogflow Console
- Update the region setting to match your agent’s location
- Use “global” if your agent is in the default location
Timeout Issues
Issue: Dialogflow API calls timeout. Solution:- Check network connectivity to Google Cloud
- Verify firewall rules allow HTTPS to Dialogflow endpoints
- Consider using a regional endpoint closer to your deployment
- Review Dialogflow agent complexity (may need optimization)
Security and Privacy
- Encrypted Credentials: Service account credentials are encrypted at rest
- API Timeout: 10-second timeout prevents hanging requests
- Error Handling: Failed authentications automatically disable the integration
- Session Isolation: Each conversation gets a unique session ID
- Data Privacy: Messages are sent to Google Cloud per Dialogflow terms
Multiple Integrations
You can configure multiple Dialogflow integrations:- Different inboxes can have different bots
- Each integration has its own credentials and settings
- Useful for multi-language support or different customer segments
- Configure separate Dialogflow agents for each use case
Disabling the Integration
The integration can be disabled:- Automatically: When authentication fails (permission denied)
- Manually: Through the Chatwoot dashboard or API
Next Steps
- Design and train your Dialogflow intents
- Configure fallback intents for unhandled queries
- Set up fulfillment webhooks for dynamic responses
- Monitor bot performance and conversation handoffs
- Explore other Chatwoot integrations to enhance functionality

