# Genesys

### Prerequisites

Assigning this channel to an application requires a one-time integration of Genesys in your NLX workspace.

<a href="../../../integrations/types/channels/genesys" class="button primary">Integrate Genesys</a>

### Add channel to app

1. Select *Configuration* tab of your application&#x20;
2. Choose *+ Add channel* under *Delivery* section > Choose Genesys
3. Choose your Genesys workspace integration from the *Integration* dropdown

> Optional:
>
> * *API key*: Matched against the HTTP headers from the application

4. Click *Create channel*
5. Click *Save*
6. Create an [application build and deploy](https://docs.nlx.ai/platform/nlx-platform-guide/setup#deployment)

### Set up in Genesys

{% hint style="info" %}
Any information to be shared from the NLX application with Genesys should be passed via a [Node payload](https://docs.nlx.ai/platform/nlx-platform-guide/flows-and-building-blocks/overview/nodes#node-payload). Node payload fields will be available as Genesys outputs named `nlx_payload_{FIELD_NAME)`
{% endhint %}

Once your application is deployed in NLX, log in to your Genesys instance.

* From your Genesys instance, go to *Admin* > *Architect*
* Select *Inbound Call Flow*
* Complete all necessary fields > Click *Create Flow*
* Once in the *Call Flow*, click *Reusable Tasks* in the left pane
* Select *Add action here > Click Toolbox* > *Call Lex V2 Bot*
* Choose your application's name from the dropdown. If deployed correctly, the *Bot Alias* dropdown should have *Genesys*
* For the *Initial Intent Name* field, select the flow you want to trigger initially (e.g., Welcome)
* Under *Input*, enter the following three inputs:
  * Enter `nlx_botUrl` in *Key Name* field > Retrieve URL from the [deployment details link](https://docs.nlx.ai/platform/nlx-platform-guide/setup#deployment) in your NLX workspace for Variable to Assign field
  * Enter `nlx_conversationID` in *Key Name* field > Add the `Call.ConversationID` Genesys variable to the *Variable to Assign* field
  * Enter `nlx_customerNumber` in *Key Nam*e field > Add the `Call.Ani` Genesys variable to the *Variable to Assign* field
* Under *Outputs*, enter `nlx_action` in *Key Name* field and `Flow.nlx_action` in *Variable to Assign* field
* You may act on the `Flow.nlx_action` to to escalate to a human agent. To achieve this, set the following parameters:
  * *Name*: `Decision`
  * *Expression:* `Flow.nlx_action=="ESCALATE"`

{% hint style="info" %}
[Any variables](https://docs.nlx.ai/platform/nlx-platform-guide/flows-and-building-blocks/overview/flows-and-variables) from the NLX session you would like passed must be mapped to Genesys flow variables in the Call Lex V2 Bot node.
{% endhint %}

<figure><img src="https://2737319166-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHCxYxhIU0Bqkjj942mGk%2Fuploads%2FRv1seYppgPSyyRLiU5rF%2Fimage%20(2).png?alt=media&#x26;token=2fd32c2e-affb-432c-a3cf-7f8fe803143d" alt=""><figcaption></figcaption></figure>

#### Sample template

The *Starting Task* in Genesys calls in to the NLX *Reusable Task*:

<figure><img src="https://2737319166-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHCxYxhIU0Bqkjj942mGk%2Fuploads%2Fa2YoPskHlz0n6301CQzb%2FGenesys_Starting_Task.png?alt=media&#x26;token=9fca08c0-39af-4074-b3d1-8c0fadb2e0c1" alt=""><figcaption></figcaption></figure>

Once the *Starting Task* calls into the *Reusable Task*, Genesys and NLX interaction enters an infinite loop state until the NLX application signals to TERMINATE or ESCALATE:

<figure><img src="https://2737319166-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHCxYxhIU0Bqkjj942mGk%2Fuploads%2Fxurr0keU4OMeKCAtAr5i%2FGenesys_Reusable_Task.png?alt=media&#x26;token=73b0c6b7-e3be-47c2-9039-745ddc0c6f57" alt=""><figcaption></figcaption></figure>

To simplify things, you may download this Genesys inbound flow as a template:

#### :arrow\_down\_small: [**NLX - Genesys Example.i3InboundFlow**](https://uploads.linear.app/a0fe55dc-a8e2-4bf2-8ddd-fa93cd5708bc/33e0c4ab-c219-494d-8513-f06608e418aa/77c1d75e-aa41-434f-ae80-630142a8f17d)

Locate the import functionality under the *Save* dropdown:

![](https://uploads.linear.app/a0fe55dc-a8e2-4bf2-8ddd-fa93cd5708bc/bd655f0f-f919-42cf-bdd2-d000f7ff70d1/877d760f-74cb-4932-a45f-f549ca2ec552)

{% hint style="danger" %}
When changing the Lex bot, note that the following `SessionVariable` configuration will be lost and will require updating.
{% endhint %}

```yaml
- callLexV2Bot:
  name: Call Lex V2 Bot
  outputSessionVariables:
    - outputSessionVariable:
        name:
          lit: nlx_action
        variable: Flow.nlx_action
  sessionVariables:
    - sessionVariable:
        name:
          lit: nlx_botUrl
        value:
          lit: "<<GET FROM DEPLOYMENT DETAILS POPUP>>"
    - sessionVariable:
        name:
          lit: nlx_conversationId
        value:
          exp: Call.ConversationId
    - sessionVariable:
        name:
          lit: nlx_customerNumber
        value:
          exp: ToPhoneNumber(Call.Ani).e164
    - sessionVariable:
        name:
          lit: "x-nlx:integrationVersion"
        value:
          lit: "2"
```

Need more context? See official [Genesys documentation](https://help.mypurecloud.com/articles/call-lex-v2-bot-action/).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nlx.ai/platform/nlx-platform-guide/ai-applications/deployment/managing-channels/genesys.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
