I have an issue where the variable of the webhook result does not update for some reason.
First Scenario:
Enters valid customer ID > call webhook > save result on a variable > route to extract pin ----- working as intended.
Logs as follows:
"Step 3": {
"FunctionExecution": {
"SessionParameters(Updated)": {
"customer_id_response": 566099108
},
"Webhook": {
"Unauthorized FulfillmentResponse": false,
"URL": "https://redacteddomain.com/routing-service/customer/566099108",
"DisplayName": "verify customer id",
"Status": "OK",
"Tag": "check customer",
"ID": "50f24f9a-4837-4c09-9f34-5a74d6e02831",
"Latency": "654 ms"
}
},
"Type": "STATE_MACHINE",
"StateMachine": {
"FlowState": {
"Version": 0,
"Name": "Customer Status",
"FlowId": "3231670c-709f-4953-bc57-373d9b214ad3",
"PageState": {
"Status": "ENTERING_PAGE",
"PageId": "39599d86-a748-41dd-8d57-35f231f39a70",
"Name": "verify customer id"
}
}
}
}
Second Scenario: (not working as designed)
Enters wrong customer ID > call webhook > null response > Ask to try again > Yes > Enter right customer ID > call webhook > OK (based on the logs) > Not updating the response variable for some reason? (based on the logs) > Fails to route
Logs as follows:
"Execution Sequence": [
{
"Step 1": {
"Type": "INITIAL_STATE",
"InitialState": {
"SessionParameters": {
"tryagain": "yes",
"customer_id_response": null,
"customer_id": null,
"number-sequence": "566099108"
},
"FlowState": {
"PageState": {
"PageId": "74f79a67-e610-470f-b85e-2dad6a43bc75",
"Status": "TRANSITION_ROUTING",
"FormFilled": true,
"Name": "ask customer id again"
},
"Name": "Customer Status",
"FlowId": "3231670c-709f-4953-bc57-373d9b214ad3",
"Version": 0
},
"MatchedIntent": {
"Id": "8ead0eb6-0861-4731-a349-218386e5ba1a",
"Parameters": {
"number-sequence": {
"type": "@sys.number-sequence",
"original": "566099108",
"resolved": "566099108"
}
},
"Score": 1,
"DisplayName": "Customer ID",
"Active": true,
"Type": "NLU"
}
}
}
},
{
"Step 2": {
"StateMachine": {
"TriggeredIntent": "Customer ID",
"TriggeredTransitionRouteId": "e68f6676-4b09-4384-bc8b-137d3255c337",
"TargetPage": "39599d86-a748-41dd-8d57-35f231f39a70",
"FlowState": {
"PageState": {
"PageId": "74f79a67-e610-470f-b85e-2dad6a43bc75",
"Status": "TRANSITION_ROUTING",
"Name": "ask customer id again",
"FormFilled": true
},
"FlowId": "3231670c-709f-4953-bc57-373d9b214ad3",
"Name": "Customer Status",
"Version": 0
}
},
"FunctionExecution": {
"SystemFunctionResults": {
"$sys.func.TO_NUMBER": [
566099108
]
},
"SessionParameters(Updated)": {
"customer_id": 566099108
}
},
"Type": "STATE_MACHINE"
}
},
{
"Step 3": {
"StateMachine": {
"FlowState": {
"Name": "Customer Status",
"PageState": {
"PageId": "39599d86-a748-41dd-8d57-35f231f39a70",
"Status": "ENTERING_PAGE",
"Name": "verify customer id"
},
"FlowId": "3231670c-709f-4953-bc57-373d9b214ad3",
"Version": 0
}
},
"Type": "STATE_MACHINE",
"FunctionExecution": {
"Webhook": {
"Status": "OK",
"URL": "https://redacteddomain.com/routing-service/customer/566099108",
"ID": "50f24f9a-4837-4c09-9f34-5a74d6e02831",
"DisplayName": "verify customer id",
"Unauthorized FulfillmentResponse": false,
"Latency": "682 ms",
"Tag": "check customer"
}
}
}
},
{
"Step 4": {
"Type": "STATE_MACHINE",
"StateMachine": {
"FlowState": {
"FlowId": "3231670c-709f-4953-bc57-373d9b214ad3",
"Version": 0,
"PageState": {
"Name": "verify customer id",
"PageId": "39599d86-a748-41dd-8d57-35f231f39a70",
"Status": "TRANSITION_ROUTING",
"FormFilled": true
},
"Name": "Customer Status"
},
"TriggeredCondition": "$session.params.customer_id_response = null",
"TriggeredTransitionRouteId": "a08898ff-5b8b-476c-9dbf-a8156c211104",
"TargetPage": "5551c61c-6167-4331-9243-5abf17dfcdf6"
},
"FunctionExecution": {
"SessionParameters(Updated)": {
"customer_id": null,
"number-sequence": null
},
"Responses": [
{
"responseType": "HANDLER_PROMPT",
"text": {
"text": [
"We can't verify the account."
]
},
"source": "VIRTUAL_AGENT"
}
]
}
}
},
{
"Step 5": {
"Type": "STATE_MACHINE",
"FunctionExecution": {
"Responses": [
{
"text": {
"text": [
"Do you want to try again?"
]
},
"responseType": "ENTRY_PROMPT",
"source": "VIRTUAL_AGENT"
}
]
},
"StateMachine": {
"FlowState": {
"Name": "Customer Status",
"Version": 0,
"FlowId": "3231670c-709f-4953-bc57-373d9b214ad3",
"PageState": {
"Status": "ENTERING_PAGE",
"Name": "try again for customer id",
"PageId": "5551c61c-6167-4331-9243-5abf17dfcdf6"
}
}
}
}
},
{
"Step 6": {
"StateMachine": {
"FlowState": {
"Version": 0,
"FlowId": "3231670c-709f-4953-bc57-373d9b214ad3",
"Name": "Customer Status",
"PageState": {
"FormFilled": true,
"Name": "try again for customer id",
"PageId": "5551c61c-6167-4331-9243-5abf17dfcdf6",
"Status": "TRANSITION_ROUTING"
}
}
},
"Type": "STATE_MACHINE"
}
}
],
As you can see on the secondary log. It does not have value for customer_id_response which set after the API call.
Ref#
"FunctionExecution": {
"SessionParameters(Updated)": {
"customer_id_response": 566099108
},
the variable $session.params.customer_id_response is the variable set for webhook response configuration
I have checked everything and it seems like a bug at this point.
Any insight for this issue would be much appreciated.
anyone was able to solve this?
Tagging top contributor @a_aleinikov for visibility