Choose & synthesize
Answer directly, call a tool, or write a JavaScript workflow.
Task-Specific Collaboration by Design.
Generate, execute, and refine multi-agent workflows as code.
Qwen3.5-27B throughout · six benchmarks · Explore the results ↓
Different tasks need different collaboration: some are best answered directly, others need parallel exploration or ordered reasoning and verification. DynaFlow lets the Main Agent design its own collaboration, deciding when a workflow is worth it and writing a task-specific program that defines roles, dependencies, information exchange, and checks.
The Main Agent writes, runs, and revises a program for each collaboration.
Answer directly, call a tool, or write a JavaScript workflow.
Run sub-agents in sequence or in parallel and pass outputs to the agents that need them.
Read the outputs and trace, then answer or launch a follow-up workflow.
Two-stage SFT trains only the Main Agent; sub-agents stay frozen.
Base and DynaFlow workflows on the same question, with the same frozen sub-agents.
Task. Count palindromes with nonzero digits whose digit sum is 13.
Tap the figure to enlarge.
Base returns 59 after an arithmetic error. DynaFlow’s three solvers and verifier all obtain the correct 62.
Task. Identify the products of reactions A and B and choose the matching answer option.
Tap the figure to enlarge.
Base runs two unconnected analyses. DynaFlow’s checks challenge the first candidates, and the decision agent weighs research and objections together.
Task. Identify the person associated with an investment description, then retrieve the year requested by the question.
Tap the figure to enlarge.
Base searches for firms and founding years. DynaFlow identifies candidate people first, then retrieves the year for each.
Task. Minimize the sum of distances to five pentagon vertices and recover m + n + p from the minimum m + n√p.
Tap the figure to enlarge.
One optimizer fails and is filtered out; both audits confirm the fitted answer, so the repair branch never runs.
Same Qwen3.5-27B backbone, frozen sub-agents, tools, and runtime throughout.
Swipe the table sideways to see all benchmarks.
| Method | AIME ’24 30 | AIME ’25 30 | AIME ’26 30 | PolyMATH 200 | GPQA-D 198 | HotpotQA 200 | Overall 688 |
|---|---|---|---|---|---|---|---|
| Single-agent baselines | |||||||
| CoT | 96.67 | 93.33 | 86.67 | 83.00 | 85.35 | 46.50 | 74.27 |
| CoT-SC | 90.00 | 93.33 | 96.67 | 84.50 | 85.86 | 50.50 | 76.16 |
| Self-Refine | 96.67 | 93.33 | 93.33 | 87.50 | 88.38 | 48.00 | 77.18 |
| Automated multi-agent baseline | |||||||
| AFlow | 93.33 | 96.67 | 100.00 | 86.00 | 87.37 | 47.00 | 76.45 |
| Untrained Main Agent | |||||||
| Base Direct | 93.33 | 93.33 | 93.33 | 74.00 | 83.33 | 47.50 | 71.51 |
| Base + Web search | 83.33 | 73.33 | 73.33 | 66.00 | 79.80 | 77.50 | 74.71 |
| Base Dynamic | 63.33 | 63.33 | 73.33 | 64.00 | 77.78 | 53.00 | 65.12 |
| Base Forced | 76.67 | 70.00 | 70.00 | 70.00 | 77.78 | 81.50 | 75.87 |
| Trained Main Agent (ours) | |||||||
| DynaFlow Direct | 93.33 | 90.00 | 90.00 | 87.00 | 86.87 | 51.50 | 77.18 |
| DynaFlow Dynamic | 93.33 | 100.00 | 96.67 | 91.50 | 83.84 | 84.50 | 87.94 |
| DynaFlow Forced | 100.00 | 100.00 | 100.00 | 90.50 | 84.85 | 83.50 | 88.08 |
Overall is micro-averaged over 688 questions. Only Base + Web search and the workflow settings have retrieval, so HotpotQA is not a like-for-like comparison with single-agent baselines.
First workflows under Forced execution, before and after training.
Use ← → keys or swipe to switch figures.
The Main Agent answers without invoking a workflow.
The Main Agent decides when a workflow will help.
Every task runs through a workflow.
python scripts/dynaflow.py demo --mode direct
python scripts/dynaflow.py demo --mode dynamic
python scripts/dynaflow.py demo --mode forcedSetup instructions are in the repository README.
If you find our work or this codebase helpful, please cite our paper:
@article{liu2026dynaflow,
title={DynaFlow: Learning Free-Form Multi-Agent Orchestration},
author={Liu, Ruhao and Li, Qi and Wang, Shizun and Wang, Xinchao},
journal={arXiv preprint arXiv:2610.34467},
year={2026}
}