Genesys Cloud - Main

 View Only

Sign Up

  • 1.  Retrieve Caller and Called Phone Numbers in a Bot Flow

    Posted 09-10-2026 03:00

    Hi everyone,

    I have a question regarding Genesys Cloud Architect Bot Flows and retrieving participant data.

    My use case is the following:

    • In my Inbound Call Flow, I use Set Participant Data to store:
      • Flow.CallerPhone
      • Flow.CalledPhone
    • Then, in my Bot Flow, I use Get Participant Data to retrieve these variables.
    • In most cases, this works correctly.
    • However, in some calls, the variables are not available in the Bot Flow, even though they were correctly set in the Inbound Flow.

    I would like to implement a fallback mechanism directly in the Bot Flow:

    1. Check whether Flow.CallerPhone or Flow.CalledPhone is not set or empty.
    2. If one of them is missing, retrieve the caller/called phone number directly from the interaction/participant information.
    3. Populate the corresponding variable in the Bot Flow.

    My question:
    Is there a way in a Genesys Cloud Architect Bot Flow to directly retrieve the caller's phone number (ANI) and the called phone number (DNIS), independently of Participant Data?

    If yes, which Architect variables/functions should be used?

    I am particularly looking for a reliable way to recover these values when Get Participant Data does not return the values previously set in the Inbound Flow.

    Thanks in advance for your help!


    #ArchitectandDesign
    #ConversationalAI(Bots,VirtualAgent,etc.)

    ------------------------------
    Ragheb
    Consultant IT
    ------------------------------


  • 2.  RE: Retrieve Caller and Called Phone Numbers in a Bot Flow
    Best Answer

    Posted 09-10-2026 04:12

    Hi Ragheb,

    My understanding is you could do this without relying on Participant Data by passing the values directly from the Inbound Call Flow into the Bot Flow as input variables.

    In the Inbound Call Flow you could pass:

    Call.Ani – caller/originating number
    Call.CalledAddressOriginal – original number dialled

    Create corresponding input variables in the Bot Flow, publish it, and then map these values when calling the Bot Flow.

    I would use Call.CalledAddressOriginal if you specifically need the original DNIS, as Call.CalledAddress can change following a transfer.

    Hope this helps!



    ------------------------------
    Phaneendra
    Technical Solutions Consultant
    ------------------------------



  • 3.  RE: Retrieve Caller and Called Phone Numbers in a Bot Flow

    Posted 09-10-2026 12:07

    You've got a great answer below, but what may have been tripping up your use of participant data is that participant data bulk writes after a flow exits.  So, if you are calling your bot flow from the inbound flow that is writing the participant data, you can easily encounter race conditions where the participant data has not actually written yet.

    This can be really frustrating, because when you look at the interaction later, the participant data is present, but because of the timing, it wasn't at the time of your bot flow.  For built in variables, what Phaneendra is recommending is perfect, but if you are dealing with non built in variables in a similar scenario, a better option is to use these as input variables in your bot flow, so when you call it in architect, you have a space to directly pass them into the bot.



    ------------------------------
    Aaron Lael
    State of Utah - comments on this forum reflect my own personal opinions\observations and are separate from any entity I am otherwise involved in.
    ------------------------------



  • 4.  RE: Retrieve Caller and Called Phone Numbers in a Bot Flow

    Posted 09-11-2026 02:29

    Hi Ragheb,

    I think Phaneedras answer, to pass the data directliy to the bot is the best solution. If you have to use participant data for some reason, you can use Data Actions.

    GET /api/v2/conversations/calls/${input.conversionID}

    with something like that in the response map:

    {
      "translationMap": {
        "startTimeB": "$.participants[0].startTime",
        "interactionIDB": "$.participants[0].id",
        "aniB": "$.participants[0].ani"
      },
      "translationMapDefaults": {
        "startTimeB": "\"error\"",
        "interactionIDB": "\"error\"",
        "aniB": "\"error\""
      },
      "successTemplate": "{\n    \"participantID\": ${interactionIDB}\n,   \"customerAddress\": ${aniB}\n,   \"conversationStartTime\": ${startTimeB}\n}"
    }

    But Aarons concerns about timing are valid. You can use Data Action for writing participant data, too:

    PATCH /api/v2/conversations/calls/${input.interactionID}/participants/${input.participantID}/attributes

    with a Request Body template like that:

    {
      "attributes": {
        "${input.Atrribut1Name}": "${input.Attribut1Wert}",
        "${input.Attribut2Name}": "${input.Attribut2Wert}",
        "${input.Attribut3Name}": "${input.Atribut3Wert}"
      }
    }


    ------------------------------
    Christoph
    Produktmanager Kunden-Dialog-Center
    ------------------------------



  • 5.  RE: Retrieve Caller and Called Phone Numbers in a Bot Flow

    Posted 09-11-2026 03:58

    Hi Ragheb,

    The simplest and safest way for this is the method used by Phaneendra. I was actually creating a flow yesterday to do just this. Here's a bit more information.

    On the Left hand menu select Data and add a string variable

    Once you've done that click it and select Input to Flow. For additional safety you can set a default value in case there is no data to pass.

    You can then use the variable in your bot flow. When finished Publish it.

    Go to your inbound call flow or wherever you are calling the bot from. You now have an Inputs with the variables you need that you can pass in.

    Continuing that same logic you can set variables in the bot to Output back to the original flow and retrieve them directly.



    ------------------------------
    Richard Chandler
    Connect
    ------------------------------