WorkflowGen:an adaptive workflow generation mechanism driven by trajectory experience
Organizations: China Telecom Cloud, Beijing, China
Abstract
Large language model (LLM) agents often suffer from high reasoning overhead, excessive token consumption, unstable execution, and inability to reuse past experiences in complex tasks like business queries, tool use, and workflow orchestration. Traditional methods generate workflows from scratch for every query, leading to high cost, slow response, and poor robustness. We propose WorkflowGen, an adaptive, trajectory experience-driven framework for automatic workflow generation that reduces token usage and improves efficiency and success rate. Early in execution, WorkflowGen captures full trajectories and extracts reusable knowledge at both node and workflow levels, including error fingerprints, optimal tool mappings, parameter schemas, execution paths, and exception-avoidance strategies. It then employs a closed-loop mechanism that performs lightweight generation only on variable nodes via trajectory rewriting, experience updating, and template induction. A three-tier adaptive routing strategy dynamically selects among direct reuse, rewriting-based generation, and full initialization based on semantic similarity to historical queries. Without large annotated datasets, we qualitatively compare WorkflowGen against real-time planning, static single trajectory, and basic in-context learning baselines. Our method reduces token consumption by over 40 percent compared to real-time planning, improves success rate by 20 percent on medium-similarity queries through proactive error avoidance and adaptive fallback, and enhances deployability via modular, traceable experiences and cross-scenario adaptability. WorkflowGen achieves a practical balance of efficiency, robustness, and interpretability, addressing key limitations of existing approaches.
Figures & tables
| Dimension | Real-time Planning | Static Single-trajectory | In-context Learning | WorkflowGen |
|---|---|---|---|---|
| Core logic | Fully re-generation | Fixed reuse, limited to high similarity | Partial reuse without fallback | Adaptive three-level switching |
| Token cost | High and fixed | High for medium/new intents | Medium with failure redundancy | Low: reuse, rewrite, initialization |
| Redundancy | Repeated reasoning | Redundant full generation | Error-triggered re-generation | Error avoidance and minimal rewriting |
| Dimension | Real-time Planning | Static Single-trajectory | In-context Learning | WorkflowGen |
|---|---|---|---|---|
| Adaptability | General but unstable | Limited to high similarity | Medium without fallback | Full coverage with three levels |
| Error avoidance | No prior guidance | Failure unaware | Only successful experience | Prevention-fallback dual safeguards |
| Stability | Volatile | Unstable | Medium | Stable and controllable |
| Dimension | Real-time Planning | Static Single-trajectory | In-context Learning | WorkflowGen |
|---|---|---|---|---|
| Efficiency | Low | Fluctuating | Medium | High with lightweight reasoning |
| Interpretability | Black-box | Limited | Partial | Fully transparent and traceable |
| Deployment | High cost | Limited scope | No fallback, rigid | Adaptive routing with modular reuse |
Agentic Workflows
Agentic workflows coordinate AI agents, tools, and humans across multi-step tasks, emphasizing reliable execution, efficiency, and oversight.
See all 218 papers