I started using a flexible webhook in Dialogflow CX to manage some smaller backend tasks. Given the simplicity of my backend tasks, I prefer the flexible webhook which is less overhead especially when responding to the request.
Now I have two similar, but not exactly identical scenarios on different dialogflow pages in which I'd like to re-use the same Dialogflow webhook definition. For this purpose, I assigned a tag to the webhook at each page that allows the backend service to differentiate between scenarios.
For my flexible webhook, I need to specify the payload of the webhook request in the webhook definition. While I noticed that the webhook tag is part of the standard webhook request, I wonder how I could reference the webhook tag in my custom payload. Unfortunately, the documentation does not clearly tell how the correct reference looks like.
This is how my flexible webhook payload looks like currently:
{
"my_param_1": "$session.params.param_1,
"my_param_2": "$session.params.param_2",
...
"webhook_tag": "?"
}
I already tried:
"$webhook.params.tag"
, "$session.fulfillmentInfo.tag"
and ""$fulfillmentInfo.tag"
. All of them resulted in the webhook not being called with following error:
...
"FunctionExecution": {
"Webhook": {
"Status": {
"ErrorCode": "INTERNAL"
}
}
},
...
"webhookStatuses": [
{
"code": 13
}
]
I noticed in the standard webhook request I can find the tag like follows:
{
...
"fulfillmentInfo": {
"tag": "my_tag"
}
...
}
So I expect I can also reference the tag in the flexible webhook request.