The leading finance team is rapidly building, testing, and deploying Amazon Lex V2 bots with automation

This guest post was written by Mulay Ahmed and Caroline Lima-Lane of the core finance team. The content and opinions in this post are those of the authors and third parties AWS is not responsible for the content or accuracy of this post.
Around US contact centers that handle millions of customer calls every year, are a major financial group® wanted to optimize their customer experience. In the leading finance team increasing the functionality of the Virtual Assistant using geneness, Amazon Lex, and Amazon Quicksight, we discussed the main virtual assistant solution using the Genesy Cloud solution, multiple AWS services, and the reporting and Analytics solution using Amazon Qualight.
This post focuses on the acceleration of the Virtual Assistant (VA) delivery process by automated building, testing of the Imazon lex v2 bot (including other GitABUS and Analytics data sources) by automated execution of the Amazon Lex V2 Test Workbench for quality assurance. This solution helps the principal® Scale and maintain VA execution with confidence and speed using infrastructure such as code (IAC), to move code (CD CD instead of Amazon Lex V2 BOT to AWS PANITANT COSLE.
Principal is a global financial company with nearly 20,000 employees who are passionate about improving the wealth and well-being of people and businesses. In business for 145 years, the principal serves nearly 70 million customers (as of Q4 2024) AWS group, together, while working to support voice automation capabilities to provide self-service customers and contact center customers. The following engineering opportunities are recognized and prioritized:
- Complete Console-Driven Configuration, Testing, and Deployment of Amazon Lex V2 Bot
- Collaborate through structured version control and collaborative development workflows for multiple team members
- Acceleration of development cycles by automating the build, test, and deployment processes of Amazon Lex Bot Donst and Optimization
- Advanced Quality Assurance Updates with automated inspection gates and standard coding validation for reliable releases
With the automated solutions described in the post, starting in September 2024, the principal has accelerated development efforts by 50% in all areas (development, pilot and production) through implementation processes and implementation processes. This solution also improves deployment reliability through automated workflows, providing constant updates while reducing Gitkuruc development and CD exercises, strengthening the CI / CD pipeline by maintaining alignment between test files and Bot Versions, creating a more efficient and reliable development process.
Overview
The solution uses the services defined in the leading finance team to increase the functionality of the virtual voice assistant using genesys, Amazon Lex, and Amazon Quicksight. The following services / APIs are also used as part of this solution:
- AWS Jobs is a step-by-step guide to deploying workflows
- A test Workbench APIS, which is invoked within a state machine's job step as a job sequence
- Aws Lambda data processing to support some of the testing apsenbench apis
VA Code Organization and management
VA's primary implementation of Genesys Cloud as a contact center application and the following AWS services organized as different stacks:
- Bot Stack:
- Amazon Lex V2 CDK is used to define and deploy the bot infrastructure
- LambDa functions manage bot logic and manage routing logic (for Amazon Lex and Genesy Cloud)
- AWS Secrets Managers store the secrets of calling downstream endpoints
- Test stack:
- Step functions organize the flow of the test work
- Lambda functions are used in the evaluation process
- The test files contain test cases and standard conditions for testing Workbench Formenc
- The generated data is used to simulate various test scenarios without connecting to Downstream applications or APIs
- Data Stack:
- Analytics Stack:
- Amazon S3 Stor Logs and data used
- Amazon Data Firehose Streams logs to Amazon S3
- Lambda Orchestrates extract, transform, and load (etl) functions
- AWS glue manages the data catalog and ETL operations
- Amazon Athena is used to query and analyze data for analytics in Amazon S3
- Amazon Quicksight is used for data visualization and business intelligence
- CI/CD Pipeline:
- GitHub serves as the source code
- GitHub Workflow for CI / CD Pipeline
Amazon Lex v2 configuration such as code compression and CI / CD Workflow
The following diagram shows how multiple developers can work with changes in the bot stack and then test them by either deploying changes locally or using a GitHub workflow.
The process consists of the following steps:
- Developers keep clones and create a new branch to receive changes.
- Developer A or B makes changes to the bot configuration or lambda functions that run the code.
- A developer creates a pull request.
- A developer installs the Amazon Lex V2 CDK Stack using one of the following methods:
- Create a pull request and ensure that all code checks and standards checks pass.
- Merge with the main branch.
- Install the Amazon Lex V2 CDK Stack from its locale.
- The developer runs the test Workbench as part of the CI / CD pipeline or in their local environment using automated scripts.
- Test results are displayed via GitHub actions and the terminal (if running in your environment).
- The pipeline is successful only if the specified checks are performed such as linting, unit testing, infrastructure testing and integration, and testing the test function.
- After all the tests and evaluations have passed, it can be rewritten before the pre-release to be sent to the refinery. After stable writing and testing (automated and UAT) are successful, a new release can be created for production deployment (after manual review).
Amazon Lex Test Workbench automation
The solution uses GitHub and AWS services, such as job steps, state machines and Lambda functions, to orchestrate the entire Amazon Lex V2 Bot process (instead of using the existing Amazon Lex testing process). The pipeline simulates the loading of test sets, lambda functions to communicate with Amazon Lex V2 Bot and test the test function, and then another lambda function reads the test results and returns the results to the pipeline.
In order to maintain consistent, repeatable testing of Amazon Lex V2 Bots, it is important to manage and organize your test datasets effectively. The following practices help keep the test up to date:
- Configuration files are version controlled files and are linked to each bot and its version
- Unique gold test sets are created for each objective and are regularly updated to include insights from production customers, increasing Objective recognition rates
- Changed test data is transferred as part of each bot's deployment to non-production environments
The following diagram shows the automated end-to-end process for testing Amazon Lex V2 bots after each deployment.
The Post-Deployment hasf workflow has the following steps:
- The developer checks the test file in the githib repository (or managed directly from the local). After each bot submission, GitHub executes a test script using the Github workflow.
- Test scripts upload test files to an S3 bucket.
- The Test Script defines a step-by-step machine for country jobs, using a bot name and a list of file keys as input.
- Amazon Lex Model API calls are broken down to get the BOT's ID (Listbots List) and Alias (Barybotalias).
- The key for each test file is placed inside the map state, where the following operations are performed:
- Call the Amazon Lex APIs to start importing jobs:
- Starting over – Creates a specified test ID and stores it under the S3 Bluket box in the specified location.
- Explain – Checks if the first condition is completed.
- Run the test suite:
- The beginning of the beginning – Creates a test execution ID and executes the test.
- List of books – Collect all test executions. The lambda function filters the current test ID and its state.
- Get test results.
- Call the Amazon Lex APIs to start importing jobs:
- When the test is completed:
- UhluTestenseCrecultultulsutultultitems API is destroyed collecting test results.
- The UShreteStexecutionResulsutultultultitems API is invoked to retrieve test failure details at the expression level if any.
- The lambda function organizes the final cleanup and reporting:
- Deleteretetset Cleats Up Set Test Set that is no longer needed in the S3 bucket.
- The pipeline outputs the results and if there are test failures, these are recorded in the GitHub commit or the task repository report.
- Developers run a documented process for reviewing files from the Test Workbench Console.
Lasting
In this post, we present how principals have accelerated the development, testing and deployment of Amazon Lex V2 bots and support AWS services using code. In addition to the reporting and analytics solution, this provides a robust solution for the continuous development and maintenance of the virtual assistant environment.
By automating Test Workbench workflows and integrating them with version control and CI/CD processes, Principal was able to reduce testing and deployment time, increase operational flexibility, and deliver a quality transformation experience to customers. For a deeper dive into other relevant services, see Lex V2 Bot Functionality Test with Work Workbench.
AWS and Amazon are not affiliated with any leading financial group company.
This communication is intended to be educational in nature and is not intended to be construed as a recommendation.
Insurance products issued by Pridal National Life Insurance CO (outside NY) is a major life insurance company. Organize the management services provided by the main life. Advanced Funding, Inc. are distributed by funds paid by funds, inc. securities offered through Crist Securities, Inc. Reference companies are members of principal financial group, des moines, ia 50392. © 2025 Principal Financial Services, Inc. 4373397-042025
About the writers
Mulay Ahmed Is the creation of solutions for the principal and expert in the creation of complex business solutions, including the implementation of the AWS cloud.
Caroline Lima-Lane Software engineer in principal with extensive background in AWS Cloud space.