How to pass custom parameters to the DialogFlow CX from the Twilio flow

113 Views Asked by At

I have a Twilio channel as fallows. it is already connected with google DialogFlow CX virtual agent.

enter image description here

I'm using following python code to start outbound call and start conversation with dialog flow agent.

    execution = client.studio.v2.flows('flowId').executions.create(parameters={
                'name': 'John Doe',
                'date': '2023-07-15',
                'time': '7:00 PM',
                'numberOfGuests': 4,
                'contactDetails': '555-1234'
}, to= '+to number', from_= '+from number')

I want to know how to pass capture this vales from Twilio studio. and pass it to Virtual agent also how to capture that values from the DialogFlow CX?

1

There are 1 best solutions below

0
Daniel O. On

Twilio Support Engineer here. When you pass parameters to the executions.create method, they become available in Studio in the form of Flow Data and can be accessed using the standard Liquid syntax. So for example, 'name': 'John Doe' can be accessed in Studio by using {{flow.data.name}}. Then, in the Connect Virtual Agent widget, you can pass those values in the Parameters section:

Twilio Studio screenshot showing the Connect Virtual Agent widget