Current active BotFlow in a conversation

Hi,

Context: We developing a chatbot connector based on web messaging API.
This is my infrastructure for testing purpose:

Question: During the conversation I get only a message id as unique identifier for the message. How can I figure out the bot flow id, which belongs to the current message, so in other word the active bot flow in the current conversation? (Weather bot-flow-01 or bot-flow-02 is the active bot flow based on the message id)

FYI: I have an oauth credentials as well, so I can use your API programmatically.

Thanks

If you use this endpoint, you will see the botflow participant, and it will expose the associated flow:

GET /api/v2/analytics/conversations/5e2bf9e3-dc92-4a73-a504-a2a56d8e277e/details

"participantId": "95834e35-9325-4d03-b01c-3222b4c00de5",
"purpose": "botflow",
"sessions": [
{
"direction": "inbound",
"mediaType": "message",
"messageType": "webmessaging",
"peerId": "f40bed21-2bd0-46f8-9650-52b8d8845128",
"provider": "PureCloud BotFlow",
"remote": "Guest",
"sessionId": "b3e30aa5-174e-4631-b0d7-b4b6761d3a89",
"flow": {
"endingLanguage": "en-US",
"entryReason": "PureCloud BotFlow",
"entryType": "direct",
"exitReason": "FLOW_EXIT",
"flowId": "12aeeeff-c0af-4f8b-b647-7a350630419f",
"flowName": "**",
"flowType": "BOT",
"flowVersion": "27.0",
"startingLanguage": "en-US"

I found the same endpoint, but unfortunately the flow object is not shown in the session object for the botflow. (I observed, that the flow object appears only if the flow is already closed.)

GET /api/v2/analytics/conversations/7ef22753-d281-4950-8c01-cc84b6c68cfb/details :

{
"conversationId": "7ef22753-d281-4950-8c01-cc84b6c68cfb",
"conversationInitiator": "customer",
"conversationStart": "2023-04-11T11:56:46.645Z",
"customerParticipation": true,
"divisionIds": [
    "a85d0cf7-0afb-4561-adfd-9289c07cd51f"
],
"originatingDirection": "inbound",
"participants": [
    {
        "participantId": "488ec02c-2491-44ca-87d8-8c0e48a423ea",
        "purpose": "customer",
        "sessions": [
            {
                "addressFrom": "52b1a92d-581a-4949-b4fe-d6e436735341",
                "addressTo": "e500b8df-c0fc-4e7b-a752-40ab8c0764db",
                "direction": "inbound",
                "mediaType": "message",
                "messageType": "webmessaging",
                "peerId": "a3ff2a18-c41c-45f8-a411-606b14f45774",
                "provider": "PureCloud Messaging",
                "sessionId": "b88151ca-7288-425f-8379-9faa1d3b805a",
                "metrics": [
                    {
                        "emitDate": "2023-04-11T11:56:46.645Z",
                        "name": "nConnected",
                        "value": 1
                    }
                ],
                "segments": [
                    {
                        "conference": false,
                        "segmentStart": "2023-04-11T11:56:46.645Z",
                        "segmentType": "interact"
                    }
                ]
            }
        ]
    },
    {
        "participantId": "5ca3d70f-fa03-4d6c-ae61-b27d78d5de17",
        "purpose": "workflow",
        "sessions": [
            {
                "addressFrom": "e500b8df-c0fc-4e7b-a752-40ab8c0764db",
                "addressTo": "52b1a92d-581a-4949-b4fe-d6e436735341",
                "direction": "inbound",
                "mediaType": "message",
                "messageType": "webmessaging",
                "peerId": "b88151ca-7288-425f-8379-9faa1d3b805a",
                "provider": "PureCloud Messaging",
                "remote": "Guest",
                "sessionId": "a3ff2a18-c41c-45f8-a411-606b14f45774",
                "metrics": [
                    {
                        "emitDate": "2023-04-11T11:56:46.649Z",
                        "name": "nFlow",
                        "value": 1
                    }
                ],
                "segments": [
                    {
                        "conference": false,
                        "segmentStart": "2023-04-11T11:56:46.649Z",
                        "segmentType": "interact"
                    }
                ]
            }
        ]
    },
    {
        "participantId": "a552f0b6-3131-4c0a-82ab-0a8b87519786",
        "purpose": "botflow",
        "sessions": [
            {
                "direction": "inbound",
                "mediaType": "message",
                "messageType": "webmessaging",
                "peerId": "b88151ca-7288-425f-8379-9faa1d3b805a",
                "provider": "PureCloud BotFlow",
                "remote": "Guest",
                "sessionId": "492980d8-a634-4a01-a648-a6feebd08ea7",
                "metrics": [
                    {
                        "emitDate": "2023-04-11T11:56:47.015Z",
                        "name": "nFlow",
                        "value": 1
                    }
                ],
                "segments": [
                    {
                        "conference": false,
                        "segmentStart": "2023-04-11T11:56:47.015Z",
                        "segmentType": "interact"
                    }
                ]
            }
        ]
    }
]

}

Could you please suggest here something?

Ah, good catch.

Well, the other thought I have is (not knowing your configuration), you might be able to set the bot flow ID as participant data in the inbound messaging flow. If you are transferring to the sameBot flow every time, then, you already know that id and can set it as participant data. It will then be accessible once the conversation is in the bot flow, and you can grab it with the standard get/conversation/{id} query.

Would that work for you?

Just to have the high level context: We develop a connector between Genesys Cloud and Cyara Botium bot testing platform. Our customers will be able to test their chatbot through out testing platfrom. So the configuration will be in the customer hand, and they will use most probably more than one bot flow in an inbound message flow.

How can I set the bot flow ID as participant data in my inbound message flow?

Darn. That is trickier than I thought.

Kind of odd that there's no reference to the bot flow unless it's complete. Can't find it anywhere in the conversation records.

That would lead me to the only solution I could think of, which is to reference each bot 2 times. The first time you immediately exit. Then the bot flow that you are calling will be available in the conversation structure. Then you immediately call the bot flow again. You use a variable to track what iteration you are on.

Sorry I couldn't be of more help, but hopefully that gets you what you need.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.