Note: This article applies to the AWS Lambda data actions integration.

The following content includes an example AWS Lambda function and a data action that executes the function. 

  1. Download this .zip file: Example Lambda Project.

    The .zip file contains the following items:

    • Sample code (.js) to use in your Node.js 12.x Lambda in AWS.
    • A sample data action (.json).
  2. In your AWS account, follow these steps:
    1. Create an AWS Lambda function with sample code (.js).

      For more information, see Create a Lambda Function with the Console in the AWS documentation.

    2. Create a role that invokes the new Lambda function.

      For more information, see Create IAM resources to invoke an AWS Lambda function.

    3. Make a note of the AWS Lambda ARN.

      You will use this information in step 3c to update the Request URL Template for the data action, which calls the function. For more information, see Add configuration to custom actions for integrations

  3. In Genesys Cloud, follow these steps:
    1. Create an AWS Lambda data actions integration.

      For more information, see Add a data actions integration.

    2. Import the data action (.json) into your AWS Lambda data actions integration.

      This data action uses two inputs. One input is sent inside the body of the Lambda invocation. The other is sent as a header, which appears in the Lambda context. For more information, see Import or export a data action for integrations.

    3. Update requestUrlTemplate >with the ARN of your AWS Lambda function.
    4. Test your action using test mode.

      If everything is configured correctly, a hello message echoing back your inputs appears. For more information, see Test data actions for integrations.

For more information, see About the AWS Lambda data actions integration.