Technology Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
vikas_d_kulkarni
Product and Topic Expert
Product and Topic Expert
975

How LLM helped deliver a Step Orchestrator in Days, not weeks

The Business Challenge

Letters of Credit (LC) are critical financial instruments in international trade, providing payment guarantees from banks that protect both exporters and importers by shifting payment risk from the buyer to the bank.

The existing LC processing system operated as a monolithic, synchronous flow. While functional, it had a limitation: when any step failed, the entire process had to restart from the beginning. This created data inconsistency risks, especially with scheduled jobs running every minute, and made debugging and error recovery complex.

The Technical Solution: Step Orchestrator Framework

The system was designed using a State Transition Architecture with a Step Orchestrator that breaks the LC processing into discrete, manageable steps. This includes:

Intelligent Checkpointing & Resume Capability

Each step executes in its own transaction and commits immediately upon success. When a failure occurs, the system can resume from the exact failure point rather than restarting, preserving all previously completed work.

State Persistence & Cache Management

The orchestrator maintains processing state in dedicated tables, caching intermediate results from each step. This ensures that when Step 5 fails (e.g., DMS system is down), the retry can skip Steps 1-4 and proceed directly with the correct cached data from Step 4.

Extensible Architecture

An abstract class provides a consistent framework for all steps, making it easy to add new steps or modify existing ones without impacting the overall flow.

The LLM Advantage: 4 Weeks Compressed to less than 2 weeks

Here's where the story becomes interesting. What would traditionally have taken 4 weeks of development time was completed in less than 2 weeks using LLM assistance, mainly using Claude models.

Architecture Design & Code Generation

  • The orchestrator pattern with transaction management
  • Step configuration system
  • State persistence models

componentDiagram.png

Refactoring existing logic

The most challenging part: restructuring existing synchronous code into discrete steps while maintaining the cache management system.

The LLM:

  • Identified logical boundaries between steps
  • Designed the cache key strategy for inter-step data flow
  • Refactored code into the new pattern with minimal manual intervention

Comprehensive Testing

  • Test generation: Created unit tests covering numerous scenarios in half a day
  • Error simulation: Generated test cases to validate resume-from-failure with cache
  • Edge cases: Identified and tested scenarios that might have missed

The result: A pull request containing 60 files, fully tested and ready for code review, all in less than two weeks.

Fixing the Review Comments by AI bot

An AI code review bot flagged issues, but rather than hours of back-and-forth:

  • LLM resolved review comments, understanding context and implementing fixes
  • Issues discovered and fixed pre-merge, preventing post-deployment problems
  • Confidence level increased through comprehensive scenario testing

The Unexpected Win: Real-Time Monitoring UI

Backend API changes are difficult to observe and debug. Multiple integration points (AI Service, Adobe Forms, DMS, HANA DB) made it challenging to understand the processing flow.

Solution: A real-time monitoring UI showing step-by-step progress.

Traditional timeline: 5-7 days

With Claude: Close to 3 days

Impact: Instant visibility into processing state, improving debugging and operations

Key Technical Challenges LLM Solved

The challenging parts without LLM assistance would have been:

  • State Table Design: Structuring data to maintain processing state across steps
  • Cache Management: Ensuring correct cache storage and retrieval
  • Data Consistency: Preventing from picking up wrong records
  • Error Scenarios: Simulating diverse failure modes to validate resume behavior

Business Impact

  • 40-50% reduction in development time
  • Large-scale refactoring completed in 5 days (excluding validation and deployment)
  • UI development acceleration
  • Quality & Reliability: Comprehensive test coverage generated in hours
  • Real-time monitoring for better observability
  • Graceful handling of downstream system outages (DMS, AI services)
  • Extensible architecture for future enhancements
  • Clear separation of concerns with step-based design
  • Faster debugging with cached intermediate results

Prompt Template Used

Context
- Tech Stack: [CAP, SAPUI5, Node.js]
Existing Patterns
- [Add to the Context]
Requirements
- [Add Functional Spec to the context with specific area of enhancement]
Sequence Flow
- [Add Sequence Diagram Texts to the context]
Acceptance Criteria
- [Add to the context]
Constraints
- Follow existing naming conventions: [examples]
- Reuse these existing utilities: [list]
- Avoid: [anti-patterns]
Expected Output
- Main code with brief comments
- Unit tests for: [list scenarios]
- No duplicate logic with: [existing files]
- No need of detailed MD file generation. Will explicitly ask for this
Architecture Guidelines
- Pattern: [multi-tier, REST, MVC etc]
- Error handling: [Approach with example]
- Logging: [Approach with example]

Phases of using the LLM

llmphases.png     

Lessons Learned

  • LLM as a Support Architect: Beyond code generation, LLMs excel at designing patterns
  • LLM as a Senior Developer: Generating quality code and integrating with existing system
  • LLM as a Test Generator: Automating comprehensive test creation and execution
  • LLM as a Quality Manager: Thorough testing and review still happened, just much faster
  • LLM as a Technical Writer: Comes up with meaningful code comments, updates the obsolete comments, generates meaningful help and support documents
  • LLM as an Energy Booster: The Monitoring UI idea wouldn't have been feasible

Conclusion

LLM technology isn't just about writing code faster, it's about solving architectural challenges, ensuring quality through comprehensive testing, and enabling innovations that traditional timelines wouldn't allow.

By leveraging LLM assistance strategically across design, implementation, testing, and tooling, a production-ready, enterprise-grade framework was available in less than two weeks that would have taken more than a month using traditional approaches. This represents not just efficiency gains, but a fundamental shift in how complex development challenges can be approached.

This is about empowering developers to tackle bigger problems, deliver with high quality, and innovate faster than ever before in much lesser time.

Please refer to the demo to understand how LLM prompt was provided, corrected and eventually the output is accepted:

https://video.sap.com/media/t/1_mn79c4f1

Thank You