Skip to main content

Example AWS Lambda function with a data action

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: .

    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 in the AWS documentation.

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

      For more information, see .

    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 

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

      For more information, see .

    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 .

    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 .

For more information, see .