AFlow: Automating Agentic Workflow Generation

Jiayi Zhang, Jinyu Xiang, Zhaoyang Yu, Fengwei Teng, Xionghui Chen +9 more
2/12/2026

No official code found. Best implementation: FoundationAgents/MetaGPT (69,007 stars, MIT, last commit 2026-01-21). 2 more below.

Abstract

Large language models (LLMs) have demonstrated remarkable potential in solving complex tasks across diverse domains, typically by employing agentic workflows that follow detailed instructions and operational sequences. However, constructing these workflows requires significant human effort, limiting scalability and generalizability. Recent research has sought to automate the generation and optimization of these workflows, but existing methods still rely on initial manual setup and fall short of achieving fully automated and effective workflow generation. To address this challenge, we reformulate workflow optimization as a search problem over code-represented workflows, where LLM-invoking nodes are connected by edges. We introduce AFlow, an automated framework that efficiently explores this space using Monte Carlo Tree Search, iteratively refining workflows through code modification, tree-structured experience, and execution feedback. Empirical evaluations across six benchmark datasets demonstrate AFlow's efficacy, yielding a 5.7% average improvement over state-of-the-art baselines. Furthermore, AFlow enables smaller models to outperform GPT-4o on specific tasks at 4.55% of its inference cost in dollars. The code is available at https://github.com/FoundationAgents/AFlow.

View on arXivView PDF

Code Implementations(3)

MIT

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

69,0078,809Shell, PythonJun 30, 20239 months agoMIT
agentgptllmmetagptmulti-agent
MIT

πŸ”₯πŸ”₯πŸ”₯ ICLR 2025 Oral. Automating Agentic Workflow Generation.

54289PythonMar 12, 202510 months agoMIT
agentic-workflowagentsmultiagent-systemsoptimization

An implementation of the Aflow paper (https://arxiv.org/pdf/2410.10762) from scratch

10Jupyter NotebookOct 20, 20241 years ago

Cite this paper

@article{zhang2026aflow,
  title  = {AFlow: Automating Agentic Workflow Generation},
  author = {Jiayi Zhang and Jinyu Xiang and Zhaoyang Yu and Fengwei Teng and Xionghui Chen and Jiaqi Chen and Mingchen Zhuge and Xin Cheng and Sirui Hong and Jinlin Wang and Bingnan Zheng and Bangbang Liu and Yuyu Luo and Chenglin Wu},
  year   = {2026},
  eprint = {2410.10762},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2410.10762},
  journal = {ICLR 2024 2024}
}

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/2410.10762.svg)](https://codeofpaper.com/paper/2410.10762)

Discussion