Principal Monetary Group accelerates construct, check, and deployment of Amazon Lex V2 bots by way of automation
This visitor submit was written by Mulay Ahmed and Caroline Lima-Lane of Principal Monetary Group. The content material and opinions on this submit are these of the third-party authors and AWS will not be accountable for the content material or accuracy of this submit.
With US contact facilities that deal with hundreds of thousands of buyer calls yearly, Principal Financial Group® needed to modernize their buyer name expertise. Within the submit Principal Financial Group increases Voice Virtual Assistant performance using Genesys, Amazon Lex, and Amazon QuickSight, we mentioned the general Principal Digital Assistant answer utilizing Genesys Cloud, Amazon Lex V2, a number of AWS providers, and a customized reporting and analytics answer utilizing Amazon QuickSight.
This submit focuses on the acceleration of the Digital Assistant (VA) platform supply processes by way of automated construct, testing, and deployment of an Amazon Lex V2 bot (together with different database and analytics assets described later on this submit) utilizing a GitHub steady integration and supply (CI/CD) pipeline with automated execution of the Amazon Lex V2 Check Workbench for high quality assurance. This answer helps Principal® scale and keep VA implementations with confidence and pace utilizing infrastructure as code (IaC), configuration as code (CaC,) and an automatic CI/CD method as a substitute of testing and deploying the Amazon Lex V2 bot on the AWS Management Console.
Principal is a world monetary firm with almost 20,000 workers captivated with bettering the wealth and well-being of individuals and companies. In enterprise for 145 years, Principal helps roughly 70 million prospects (as of This fall 2024) plan, shield, make investments, and retire, whereas working to help the communities the place it does enterprise.The enterprise digital assistant engineering staff at Principal, in collaboration with AWS, used Amazon Lex V2 to implement a voice digital assistant to offer self-service and routing capabilities for contact heart prospects. The next engineering alternatives had been acknowledged and prioritized:
- Elimination of console-driven configuration, testing, and deployment of an Amazon Lex V2 bot
- Collaboration by way of structured model management and parallel growth workflows for a number of staff members
- Acceleration of growth cycles with automated construct, check, and deployment processes for Amazon Lex bot creation and optimization
- Enhanced high quality assurance controls by way of automated testing gates and coding commonplace validation for dependable releases
With the automation options described within the submit, as of September 2024, Principal has accelerated growth efforts by 50% throughout all environments (growth, pilot, and manufacturing) by way of streamlined implementation and deployment processes. This answer additionally enhances deployment reliability by way of automated workflows, offering constant updates whereas minimizing errors throughout growth, pilot, and manufacturing environments, and maximizes growth effectivity by integrating the Check Workbench with GitHub, enabling model management and automatic testing.With the automation of the Check Workbench and its integration with GitHub, the answer strengthens the CI/CD pipeline by sustaining alignment between check information and bot variations, making a extra agile and dependable growth course of.
Resolution overview
The answer makes use of the providers described in Principal Financial Group increases Voice Virtual Assistant performance using Genesys, Amazon Lex, and Amazon QuickSight. The next providers/APIs are additionally used as a part of this answer:
- AWS Step Functions to orchestrate the deployment workflow
- The Check Workbench APIs, that are invoked inside the Step Features state machine as a sequence of duties
- AWS Lambda to course of information to help among the Check Workbench APIs inputs
VA code group and administration
The Principal VA implementation makes use of Genesys Cloud because the contact heart software and the next AWS providers organized as completely different stacks:
- Bot stack:
- The Amazon Lex V2 CDK is used for outlining and deploying the bot infrastructure
- Lambda features deal with the bot logic and handle routing logic (for Amazon Lex and Genesys Cloud)
- AWS Secrets Manager shops secrets and techniques for calling downstream techniques endpoints
- Testing stack:
- Step Features orchestrates the testing workflow
- Lambda features are used within the testing course of
- Check information comprises check instances and eventualities in Check Workbench format
- Simulated information is used to simulate varied eventualities for testing with out connecting to downstream techniques or APIs
- Knowledge stack:
- Analytics stack:
- Amazon S3 shops logs and processed information
- Amazon Data Firehose streams logs to Amazon S3
- Lambda orchestrates extract, rework, and cargo (ETL) operations
- AWS Glue manages the Knowledge Catalog and ETL jobs
- Amazon Athena is used for querying and analyzing analytics information in Amazon S3
- Amazon QuickSight is used for information visualization and enterprise intelligence
- CI/CD pipeline:
- GitHub serves because the supply code repository
- A GitHub workflow automates the CI/CD pipeline
Amazon Lex V2 configuration as code and CI/CD workflow
The next diagram illustrates how a number of builders can work on adjustments to the bot stack and check in parallel by deploying adjustments regionally or utilizing a GitHub workflow.

The method consists of the next steps:
- A developer clones the repository and creates a brand new department for adjustments.
- Developer A or B makes adjustments to the bot configuration or Lambda features utilizing code.
- The developer creates a pull request.
- The developer deploys the Amazon Lex V2 CDK stack by way of one of many following strategies:
- Create a pull request and guarantee all code high quality and requirements checks are passing.
- Merge it with the principle department.
- Deploy the Amazon Lex V2 CDK stack from their native surroundings.
- The developer runs the Check Workbench as a part of the CI/CD pipeline or from their native surroundings utilizing the automation scripts.
- Assessments outcomes are displayed in GitHub Actions and the terminal (if run regionally).
- The pipeline succeeds provided that outlined checks comparable to linting, unit testing, infrastructure testing and integration, and Check Workbench purposeful testing go.
- In spite of everything assessments and checks go, a brand new pre-release will be drafted to deploy to the staging surroundings. After staging deployment and testing (automated and UAT) is profitable, a brand new launch will be created for manufacturing deployment (after handbook evaluation and approval).
Amazon Lex Check Workbench automation
The answer makes use of GitHub and AWS providers, comparable to Step Features state machines and Lambda features, to orchestrate your complete Amazon Lex V2 Bot testing course of (as a substitute of utilizing the existing manual testing process for Amazon Lex). The pipeline triggers the add of check units, Lambda features to work together with the Amazon Lex V2 bot and Check Workbench, then one other Lambda perform to learn the assessments outcomes and supply ends in the pipeline.
To keep up constant, repeatable evaluations of your Amazon Lex V2 bots, it’s important to handle and manage your check datasets successfully. The next key practices assist maintain check units up-to-date:
- Check set information are version-controlled and linked to every bot and its model
- Separate golden check units are created for every intent and up to date frequently to incorporate manufacturing buyer utterances, growing intent recognition charges
- The versioned check information is deployed as a part of every bot deployment in non-production environments
The next diagram illustrates the end-to-end automated course of for testing Amazon Lex V2 bots after every deployment.

The post-deployment workflow consists of the next steps:
- The developer checks the check file into the GitHub repository (or deploys instantly from native). After every bot deployment, GitHub triggers the check script utilizing the GitHub workflow.
- The check scripts add the check information to an S3 bucket.
- The check script invokes a Step Features state machine, utilizing a bot title and checklist of file keys as inputs.
- Amazon Lex Mannequin API calls are invoked to get the bot ID (ListBots) and alias (ListBotAliases).
- Every check file key’s iterated inside a Map state, the place the next duties are executed:
- Name Amazon Lex APIs to start out import jobs:
- StartImport – Creates a check set ID and shops it underneath an S3 bucket specified location.
- DescribeImport – Checks if the standing of StartImport is full.
- Run the check set:
- StartTestExecution – Creates a check execution ID and executes the check.
- ListTestExecutions – Gathers all check executions. A Lambda perform filters out the present check execution id and its standing.
- Get check outcomes.
- Name Amazon Lex APIs to start out import jobs:
- When the check is full:
- The ListTestExecutionResultItems API is invoked to assemble total check outcomes.
- The ListTestExecutionResultItems API is invoked to fetch check failure particulars on the utterance stage if current.
- A Lambda perform orchestrates the ultimate cleanup and reporting:
- DeleteTestSet cleans up check units which might be now not wanted from an S3 bucket.
- The pipeline outputs the outcomes and if there are check failures, these are listed within the GitHub motion or native terminal job report.
- Builders conduct the handbook technique of reviewing the check end result information from the Check Workbench console.
Conclusion
On this submit, we introduced how Principal accelerated the event, testing, and deployment of Amazon Lex V2 bots and supporting AWS providers utilizing code. Along with the reporting and analytics answer, this supplies a sturdy answer for the continued enhancement and upkeep of the Digital Assistant ecosystem.
By automating Check Workbench processes and integrating them with model management and CI/CD processes, Principal was capable of lower testing and deployment time, enhance check protection, streamline their growth workflows, and ship high quality conversational expertise to prospects. For a deeper dive into different related providers, confer with Evaluating Lex V2 bot performance with the Test Workbench.
AWS and Amazon aren’t associates of any firm of the Principal Monetary Group.
This communication is meant to be instructional in nature and isn’t meant to be taken as a suggestion.
Insurance coverage merchandise issued by Principal Nationwide Life Insurance coverage Co (besides in NY) and Principal Life Insurance coverage Firm. Plan administrative providers supplied by Principal Life. Principal Funds, Inc. is distributed by Principal Funds Distributor, Inc. Securities supplied by way of Principal Securities, Inc., member SIPC and/or impartial dealer/sellers. Referenced corporations are members of the Principal Monetary Group, Des Moines, IA 50392. ©2025 Principal Monetary Companies, Inc. 4373397-042025
In regards to the authors
Mulay Ahmed is a Options Architect at Principal with experience in architecting advanced enterprise-grade options, together with AWS Cloud implementations.
Caroline Lima-Lane is a Software program Engineer at Principal with an enormous background within the AWS Cloud house.