API-Aware Stepwise Prompting for LLM-based Workflow Code Generation
The automation of network operations is often hindered by a shortage of personnel possessing specialized knowledge, including domain expertise, API proficiency, and programming skills. Although large language models (LLMs) have demonstrated potential in generating code from natural language, current methodologies encounter difficulties in producing accurate workflow code, particularly when confronted with extended sequences and intricate control flows. To mitigate these challenges, we propose an API-aware stepwise prompting method for LLM-based workflow code generation. This approach systematically decomposes the generation process into four steps: API selection, dataflow analysis, sequence diagram design, and workflow code generation. By employing this stepwise prompting method, the model is better equipped to manage API dependencies and control structures. Experimental results indicate that the inclusion and precise sequencing of intermediate steps markedly enhance generation accuracy. The proposed method consistently surpasses simpler baseline approaches, underscoring the efficacy of a structured methodology.
Authors
- Kazuki Aiura
- R. Morimoto
- Michiaki Sekine
- Yu Miyoshi
- Yuji Soejima
Institutions
- NTT (Japan) (JP)
Publication Details
- Published
- 2025-09-22
- DOI
- https://doi.org/10.23919/apnoms67058.2025.11181303
- Primary Topic
- Scientific Computing and Data Management
- Type
- article
- Field-Weighted Citation Impact
- 0.00