FlowAgent: Achieving Compliance and Flexibility for Workflow Agents

Yuchen Shi, Siqi Cai, Zihan Xu, Yuei Qin, Gang Li +5 more
2/20/2025
27 citations
cs.AI

Official code: Lightblues/FlowAgent (14 stars, Python, last commit 2025-05-23).

Abstract

The integration of workflows with large language models (LLMs) enables LLM-based agents to execute predefined procedures, enhancing automation in real-world applications. Traditional rule-based methods tend to limit the inherent flexibility of LLMs, as their predefined execution paths restrict the models' action space, particularly when the unexpected, out-of-workflow (OOW) queries are encountered.

Show full abstract

Conversely, prompt-based methods allow LLMs to fully control the flow, which can lead to diminished enforcement of procedural compliance. To address these challenges, we introduce FlowAgent, a novel agent framework designed to maintain both compliance and flexibility. We propose the Procedure Description Language (PDL), which combines the adaptability of natural language with the precision of code to formulate workflows. Building on PDL, we develop a comprehensive framework that empowers LLMs to manage OOW queries effectively, while keeping the execution path under the supervision of a set of controllers. Additionally, we present a new evaluation methodology to rigorously assess an LLM agent's ability to handle OOW scenarios, going beyond routine flow compliance tested in existing benchmarks. Experiments on three datasets demonstrate that FlowAgent not only adheres to workflows but also effectively manages OOW queries, highlighting its dual strengths in compliance and flexibility. The code is available at https://github.com/Lightblues/FlowAgent.

View on arXivView PDF

Code Implementations(1)

145Python, JinjaOct 1, 20241 years ago

Similar Papers

Cite this paper

@article{shi2025flowagent,
  title  = {FlowAgent: Achieving Compliance and Flexibility for Workflow Agents},
  author = {Yuchen Shi and Siqi Cai and Zihan Xu and Yuei Qin and Gang Li and Hang Shao and Jiawei Chen and Deqing Yang and Ke Li and Xing Sun},
  year   = {2025},
  eprint = {2502.14345},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.14345v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.14345.svg)](https://codeofpaper.com/paper/2502.14345)

Discussion