Actions

Empower conversations with Actions—send content or perform tasks

What's an Action?

Actions are the one-way cousins of Data requests. While Data requests can retrieve and send content from an external source and must have a defined response body, Actions only send content. They perform external tasks and merely inform NLX on whether or not the call was successful. Actions are useful for specific external tasks:

  • Sending an email or SMS

  • Triggering Robotic Process Automation

To access, click Resources in your workspace menu and choose Actions:

Requirements

Implementation

The Implementation tab defines how your Action behaves when triggered in a flow. When a conversation reaches an Action node, NLX sends a POST request to the specified URL or returns a static response, executing the required process.

Static mode

Choose to define a fixed JSON response. Ideal for prototypes or quick testing. Simply enter the response and click Save

External mode

Choose to integrate with an endpoint. Enter URL + optional custom headers. Use the CloudFormation template in the Instructions section and click Save

For external implementations, enabling the Dynamic toggle lets you edit header values directly from the Action node’s side panel when the Action is triggered in a flow.

If you’re working with sensitive data or reusing the same endpoint frequently, store it as a Secret in your workspace for added security and easier maintenance

API spec

HTTP payloads that are delivered to your Action's configured URL endpoint contain several headers, including:

Header
Value
Description

Content-Type

application/json

The only content type currently supported is JSON

nlx-webhook-version

v3

The version associated with the action configuration

x-nlx-botId

<uuid>

A unique identifier of an application

x-nlx-channelId

<uuid>

A unique identifier of the channel associated with the application

x-nlx-channelType

string

A human friendly label indicating the channel type in use such as API, AmazonChime or Genesys

x-nlx-conversationId

<uuid>

A unique identifier of the conversation that triggered this action

x-nlx-correlationId

<uuid>

A unique identifier that can be used for debugging

x-nlx-deploymentKey

<uuid>

A unique identifier of the deployment associated with the application

x-nlx-intentId

string

The intent ID from where the action has triggered

x-nlx-languageCode

string

The application's language code used in the current conversation

x-nlx-userId

string

A user identifier such as a E.164 format phone number, UUID or other formats depending on the channel type

The body of the request your webhook will receive may contain the conversation context (nlx_context) if the send context option is enabled in the action settings. It will always include the properties defined in the Action's Request model.

Name
Type
Description

nlx_context

object

The conversation context containing essential values such as the conversationId and any context variables that have been set up to this point in the conversation.

nlx_context.botId

string

A unique identifier of an application

nlx_context.channelType

string

A human friendly label indicating the channel type in use such as API, AmazonChime or Genesys

nlx_context.channelId

string

A unique identifier of the channel associated with the application

nlx_context.conversationId

string

A unique identifier of the conversation that triggered this action

nlx_context.languageCode

string

The application's language code used in the current conversation

nlx_context.<attributeName>

string, number or Boolean

A set value of a custom context attribute. The attribute name can be an alphanumeric string with dashes and underscores

<propertyName>

any

One or more set values corresponding to the schema defined in the action's request model

The response body of your Action can optionally include the following properties:

Name
Type
Description

context

object

A map of key value pairs that you would like to be set as context variables

context.<attributeName>

string, number, or Boolean

A set value of a context variable. The name can be an alphanumeric string with dashes and underscores

For example, the response body of an Action may look like this:

{
    "context": {
        "SmsSent": true
    }
}

Request model

The Request model defines the payload structure your Action sends when making an API call. Each field represents data that can be sent to your endpoint and can be populated dynamically during a conversation. For example, if a user provides their name, you can include it in the request body to personalize a welcome email or other message.

Auto-generate schema

Quickly define your request schema by selecting Auto-generate, pasting a sample JSON payload, and clicking Save. NLX automatically builds the schema based on your provided structure

Manual schema

Choose to define your request schema field by field. Use + Add field to create new properties and select their data types. Enter names, repeat as needed, and click Save

To prevent sensitive data from appearing in conversation logs, open the three-dots menu next to a field and turn on the Sensitive toggle.

Action settings

  • Send context: Provides the context set to the conversation at the time the webhook is called

  • Enable advanced data model: This is on by default as it allows the use of the schema auto-generation features and additional data structure improvements

Last updated