Is it possible to use SessionClient or FlowClient to start a session with an agent at the beginning of a specific flow? Dialogflow ES API allows for sending an event, like a Welcome Event. Is there a similar functionality for CX that would take in a flow ID?
Asked
Active
Viewed 2,072 times
1 Answers
3
If you have your own Custom Integration, you can send a detectIntent request to your agent to trigger a custom event. This lets your agent trigger a page with the custom event and send a response to the user without any user query or input.
Here’s a simple guide to create a custom event:
- Inside your flow, select the page you want to add a custom event to then click the "Event handlers". If the "Event handlers" is not visible, click the “Add route type” button to add the Event handlers.
- Click on the + sign beside “event handlers” field and select any event.
- Tick the check box beside “Use custom event”.
- Add the name of the custom event you want to use.
- Add the desired response under “Agent says”.
- Click save.
Here’s a sample detectIntent request that triggers the Default welcome intent using Node.js.
Here’s a sample detectIntent request that triggers a custom event using REST API:
Sample URL for detect intent API:
Make the following replacements for the URL:
- project-id: your GCP project ID
- agent-id: your agent ID
- session-id: your session ID
Sample JSON Request Body should look like this:
{
"queryInput": {
"event": {
"event": "custom-event" // custom event to be triggered
},
"languageCode": "en"
},
"queryParams": {
"timeZone": "America/Los_Angeles"
}
}
You can refer below for more information on:
You can use Dialogflow CX’s Client Libraries, Rest API, or RPC API to create your own implementation/integration.

Jessica Rodriguez
- 2,899
- 1
- 12
- 27

cypher
- 187
- 1