🌟 Mainframe to AWS: Building Agentic AI workflow to modernize legacy applications
This article explains concepts on how to build an Agentic workflow to reimagine and modernize your mainframe application to Cloud native architecture. It uses a combination of Agentic solutions like AWS Transform and Kiro to implement the workflow. If you are attending re:Invent 2025, do join us at workshop session MAM341 for a guided hands-on experience.
🌐 Background
Migrating mainframe applications to cloud helps organizations significantly reduce operational costs and address skill shortages, bring agility to business processes, and deliver faster innovation. However, migrating these critical mainframe applications is not easy, they are complex, have high migration costs and risks of failure.
Companies have been trying to move away from mainframes for a long time. According to the veterans in this field, the first successful migration was completed back in the early 1990s. The popular migration patterns used to be Replatform and Refactor, as they are tool based automated transformation, and comparatively easy to validate due to like-to-like functionality. However, existing functionalities may fail to meet the organization's business needs, requiring new features and manual application rewrites. These manual modernization efforts typically extend beyond planned timelines and projects can have a higher rate of failure. The failure rate is higher because extracting business logic from legacy applications is labor-intensive and complex.
🎯 Overview
The advent of Generative AI has changed the paradigm of ReImagine pattern. It has significantly reduced the effort and timeline. The AI agents can extract business logic from legacy COBOL and other mainframe languages, generate code, test cases and test data, even compile, fix bugs, test and deploy on your behalf. It's still early days; with time these agents will get even smarter and capable of migrating and modernizing the legacy applications with additional accuracy and autonomy.
AWS Transform for mainframe is a powerful service that uses specialized mainframe agents to extract business logic and program flows. In this article, I am going to discuss how you can build an end-to-end Agentic workflow to modernize your mainframe applications to a Cloud native architecture.
⚛ Agentic Workflow
AWS Transform documents the extracted business rules in a Gherkin format following Behavior-Driven Development (BDD) framework. Additionally, it generates details of current user interfaces and data sources. These rules can be easily formatted to user-stories and can be exported to tools like JIRA, Asana, OpenProject, etc. in an automated way using the AI agents.
Figure 1. BRE and documentations from AWS Transform are converted to EPICs and User-stories
Once the business rules are converted to user-stories, it becomes easy for the business analysts to review and modify the requirements on Agile boards. ReImagine pattern involves modifying or re-writing the legacy applications to restructure its architecture and business features. This is often done to break a monolithic application into microservices to gain long-term benefits like scalability and agility.
ℹ️ It is very important that different stakeholders are able to collaborate and define the new business requirements on top of the extracted rules.
Figure 2. Shows the End-to-end AI Agentic workflow for ReImagine pattern
The diagram has 3 swim-lanes. The top one is the human user layer, the middle one is the external tools and services layer and bottom one is the agent frameworks.
-
Developer uploads the mainframe codes as a zip file to Amazon S3 and submits the AWS Transform job to generate the business logic documentation.
-
AWS Transform extracts the details in HTML and JSON format that contains application level documentation, program flows, business rules, UI, and data source details. Those details are provided as inputs to the next set of Agentic workflows.
-
Agentic Workflow 1 & 2 creates the EPIC and User-stories and the target Software Specifications like data models, architecture, API contracts, etc. following a standard approach like Software Requirements Specification (SRS) or Domain-Driven Design (DDD) in an iterative fashion. Guiding files with best practices and organization's standards are provided to the Agent.
-
The documents are uploaded to project management tools like JIRA, Confluence, Asana, OpenProject, etc. 🔌 MCP tools are integrated with the agents to perform the automated actions.
-
In a ReImagine migration project the User-stories are updated to add, remove, and modify requirements by business analysts and other stakeholders.
-
Once the user-stories are refined in the backlog and ready for development, they are pulled into the Sprints. That's where the Agentic workflow 3 starts.
-
The Agent reads the stories from current Sprint and starts generating code in incremental fashion. Generates test cases and test data, then compiles the code to check for issues. Runs the test cases to verify the code is working correctly. In addition, the agent can create infrastructure as code and scripts for setting up the AWS resources.
-
Cross-checks with Definition-of-done of the user-stories to make sure that the functionalities are implemented correctly. Pushes the completed User-stories to In Review on Sprint board for review by users.
-
Once the user reviews and is satisfied with the results, the Agent commits the codes and scripts to Git repositories using the MCP integrations. Deploys the code in the Dev/Test environment as applicable.
ℹ️ It is very important to introduce Human-In-The-Loop (HITL) at different stages of the workflow to control the quality and provide real-time guidance to the Agents as needed.
🔀 Reverse Engineering
The Agentic Workflow converts the AWS Transform outputs into actionable User-stories. This article is written based on 👻 Kiro, the Specbased Agentic IDE and JIRA/Confluence as project management tool. But other Agentic frameworks like Amazon Q CLI or others can also be used.
Figure 3. Components of reverse engineering workflow
-
Different MCP servers can be integrated as needed to enhance the functionality of Kiro, e.g. in this workflow use MCP to connect to JIRA and Confluence to upload the EPIC/User-Stories and design documents. Example of other MCP tools could be access to the organization's existing documentations, access to the mainframe code, MCP tools developed by customers to handle organization-specific standards, etc.
-
Kiro provides the option to add Steering documents that can help to guide the Agent. These Steering documents should be revised with user feedback as and when needed to improve the quality of the Agents.
🧩 Forward Engineering
This workflow contains multiple sub-tasks that can become excessively complex if not properly handled. It should be carefully orchestrated to avoid undue complications.
Figure 4. Components of forward engineering workflow
-
The technical specifications and refined User-stories are used as input for this workflow.
-
Generate code, test cases, and test data. Use the Steering documents to guide the agent in every step.
-
Automate the interaction with JIRA/Confluence, Git repositories and AWS using MCP tools.
-
Create AWS infrastructure resources, deploy, and test the modernized application for an end-to-end Agentic experience.
🏁 Conclusion
The mainframe systems are still one of the greatest machines ever built to date, and process billions of transactions daily. The higher cost, limited agility, and skill shortage are compelling the organizations to migrate away from mainframe.
Cloud is the new frontier 🏆. We often hear skepticism around the security and performance of cloud. But consider this: applications like Netflix, Epic Games and Amazon itself have been operating on AWS for years now. 🙌
🚀 "Mainframe helped humans reach Moon, Cloud will take us to Mars !!"
As agentic AI technology continues to mature, we can expect even greater automation and intelligence in modernization workflows, making mainframe transformation accessible to a broader range of organizations and dramatically reducing the barriers to Cloud adoption.
✨ Join us at re:Invent 2025 workshop session MAM341 for a hands-on experience on most of the Agentic workflow features explained here.
📚 References
[1] AWS Transform
[2] Kiro
[3] Extracting Business Rules of mainframe COBOL applications
[4] Understanding Business logic outputs from AWS Transform
[5] Create JIRA user-stories and Confluence documentation using BRE outputs
- Language
- English
