FloWright: It Takes Workflows to Evolve Better Workflows

1William & Mary    2NEC Corporation of America    3University of Illinois Urbana-Champaign    *Equal co-mentorship

Abstract

Tackling complex real-world tasks can exceed the capabilities of a single large language model (LLM), motivating the use of multi-agent workflows that coordinate specialized agents to work together on these tasks. Recent methods train LLMs to construct better workflows from execution outcomes, but they optimize only the workflow generator, while the other agents that build or execute each workflow remain fixed even though every outcome depends on all of them. However, extending training beyond the generator is challenging: the agents are coupled, and a workflow's outcome is a single sparse score that cannot tell which agent causes a failure. We propose FloWright, which leverages the workflow as a harness to optimize workflows. By introducing a hierarchical, structure-aware reward paradigm, FloWright enables one role to self-evolve and two or more roles to co-evolve, with no additional models, labels, or executions. Considering the limitation that workflows are commonly trained and evaluated on data that a single agent can already handle, we further propose DataWright, an adaptive data hardening approach that converts existing datasets into workflow-level tasks with increased difficulty. Across document, slide, chart, code, math, and finance tasks, small open models trained with FloWright achieve improved performance by up to ↑7.41%, with co-evolving (↑5.03%) more roles gaining more than optimizing one of them alone (↑2.83%).

Upstream-downstream framework
Upstream-Downstream Framework. Upstream, workflow generation can take on different structures, from the Generator with its own Inventor skill to the Generator working with other agents, drawing on pools of different granularity. Downstream, workflows take different structures and topologies to better solve the task.
↑7.41%best gain over untrained workflows
↑5.03%multi-agent co-evolution, overall
↑2.83%single-role self-evolution, overall
44evaluation arms over 12 datasets

What Limits Workflow Optimization?

Recent work trains LLMs to construct better workflows from the outcomes of executing them. Yet these methods typically optimize a single workflow generator. Because the outcome of a workflow depends jointly on every agent that builds or executes it, training only the generator leaves the other agents shaping every outcome without ever learning from it.

Only the Generator Learns

The agents that execute a workflow, and any others that help build it, remain fixed, which limits how much the workflow as a whole can improve.

Agents Are Coupled

One agent's output becomes another's input. Training agents separately ignores how each agent's behavior shapes what the others learn.

The Outcome Is One Sparse Score

A single score for the whole workflow cannot tell which agent causes a failure, and existing attribution adds costly models, labels, or executions.

Preliminary: Existing Data Does Not Need a Workflow

DatasetMulti-agent workflow (%)Single agent (%)Δ (%)
MMLongBench-Doc (original)40.5048.00↓7.50
DocFinQA (original)33.0038.00↓5.00
MMLongBench-Doc (DataWright-hardened)51.6112.33↑39.28
A multi-agent workflow against a single agent on the Qwen3-VL-8B backbone, given the same compute budget.
Preliminary study on existing benchmarks
Preliminary Study. Among the 121 datasets that 20 workflow generation methods evaluate on, 85 are single-question math, short-answer QA, or function-level coding, each of which a single competent agent can answer in one pass. Workflows underperform the single agent on the original datasets, yet gain ↑39.28 on the DataWright-hardened dataset.

FloWright: Learning to Wright Workflows

A complex task x is solved by a workflow, a directed graph G = (V, E) whose nodes are agents, tools, or skills, and whose edges carry the data and control flow among them. Upstream, the Generator πg produces G. Downstream, the harness H executes and grades it:

x →πg G →H (y, h(G, x)),    h(G, x) ∈ [0, 1]

The signal h serves three purposes: the evaluation metric, the training signal, and the test-time objective.

FloWright for reinforcement learning via self-evolving harness
FloWright for Reinforcement Learning via Self-Evolving Harness. Workflow generation and execution form a coupled on-policy learning loop: upstream proposes workflows, downstream executes them, and the verifiable harness turns execution outcomes into learning signals for the policies being optimized.

Hierarchical Structure-Aware Reward Ladder

The harness does not reduce an execution to a single pass-or-fail outcome. It stages the signal into a ladder of auto-verified terms, so the policy sees a meaningful gradient even when the workflow falls short. Every optimizable role ρ instantiates its own reward from the same shared harness:

hρ = wf f + wv vρ + we e + wa a + wc cρ

Format (f)

Whether the role's own output parses. An output that cannot be read leaves nothing to execute.

Validity (vρ)

Whether the role's contribution is valid, such as a workflow that is a well-formed graph over the pool. Deterministic, never a learned judge.

Execution (e)

Whether the workflow executes to a final answer.

Answer (a)

How correct that answer is, shared by every role.

Credit (cρ)

The fraction of the role's own nodes that root-cause a failure, read from the execution trace the harness already records.

cρ = − |Fρ| / |Vρ| ∈ [−1, 0]
  • From the role's own output to the task outcome: the four staged terms measure how far a workflow reaches.
  • From local to global: the credit term charges each role only for the failures of the nodes it authors, with no additional execution and no new signal.
  • Only genuine root causes are charged: a cascaded failure propagates to its root along the workflow's edges, and infrastructure faults are excluded.

Wire the Workflow: Topology and Pools

Upstream construction turns on three choices: the topology of the workflow, and the granularity and dynamics of the pool it draws from. A single workflow can express sequential, parallel, branching, and iterative structure as the task demands.

Four Topologies, One Executable Graph

The four topologies differ only in where the control flow is written down. Each is converted into the same directed graph, so execution, credit, and evaluation never observe which topology produced it.

Schema: Steps With Dependencies

Steps declare their dependencies, and one control_flow block states the control flow.

{"steps": [{"step_id": "step_1", "agent": "Visual Analyst",
            "instruction": "Analyze the images for Question 1 [...] return only the letter",
            "inputs": {"image_1.jpg": [...]}, "outputs": ["Answer_Q1"], "depends_on": []},
           [...]],
 "control_flow": {"type": "sequential", "loop_steps": [], "max_iterations": null}}

Pool Granularity and Dynamics

Modular Pool

Agents, tools, and skills stay separate units, enabling flexible selection and composition.

Ω = Ωagent ∪ Ωtool ∪ Ωskill

Capsule Pool

Each agent is bundled with the tools and skills it needs into a self-contained capsule.

Ω = Ωcapsule

Dynamic Pool

When a task calls for a capability the pool does not contain, the Generator's Inventor skill expands the pool with the missing tool, skill, or agent. A grown pool also carries components distilled from past experiences.

One Harness, Four Evolution Modes

The reward paradigm serves every role from one shared harness, enabling one role to self-evolve or several to co-evolve. When several roles train inside one harness, each role's behavior shapes what the others encounter: the coupling is a mutual curriculum.

(a) Single-Role Self-Evolution

One role optimizes its role-specific reward inside the harness as it runs, so it evolves in the same flow that will use it.

(b) Agent-Skill Co-Evolution

An agent co-evolves with its own skill, such as the Generator with its Inventor skill.

(c) Upstream-Downstream Co-Evolution

An upstream agent that builds the workflow is coupled with a downstream agent that executes it.

(d) Multi-Agent Co-Evolution

Any two or more agents co-train, each learning against the latest evolved policies of the others.

Train-Time Reinforcement, Test-Time Distillation

Train Time: Maximizing the Signal

A role's policy is optimized to maximize its expected signal over tasks. FloWright contributes a training paradigm rather than an optimizer, so GRPO, DAPO, and CISPO all instantiate it.

J(πρ) = E [ hρ(G, x) ]

Test Time: Meta Distillation

With no weights changing, the harness distills a reusable prior, internally from its own experiences or externally from a stronger teacher, and distills successful experiences into few-shot cases.

P* = arg maxP E [ h(G, x | P) ]

DataWright: Workflow-Level Data Hardening

Datasets that a single agent can already handle can neither reveal nor optimize what a workflow adds beyond it. DataWright converts existing datasets into workflow-level tasks by rule, with no model in the loop. Hardening changes how hard a task is, not how its answers are graded: every sub-question keeps the metric of its own answer type, and a task's score is the mean over its sub-questions.

12datasets
7domains
3hardening strategies
44evaluation arms

Three Hardening Strategies

Shared: Decomposition

Bundles ℓ questions about the same input into one task, which splits into sub-questions that can be assigned and answered separately.

Paired: Routing

Bundles ℓ questions, each with its own distinct input, into one task. Each sub-question is matched to the input that answers it.

Decoy: Localization

Keeps one question and places its input among ℓ − 1 decoy inputs drawn from the same dataset.

  • In-distribution (4 arms): the four training datasets at the paired strategy and ℓ = 3.
  • Out-of-distribution (13 arms): the same four datasets under a strategy, a level, or both that training never sees.
  • Out-of-domain (27 arms): eight datasets FloWright never trains on.

Effectiveness: Evolving Roles at Train and Test Time

We train Qwen3.5-4B and Qwen3.5-9B on the paired strategy at ℓ = 3 of four datasets, and evaluate on held-out test sets across in-distribution, out-of-distribution, and out-of-domain arms.

Mean accuracy (%) over the hardening strategies and levels each dataset supports. 4B and 9B abbreviate Qwen3.5-4B and Qwen3.5-9B, and (a) to (d) denote the four evolution modes.

MethodIn-Dist.Out-of-DistributionOut-of-DomainOverall
ℓ=3ℓ=3ℓ=5Meanℓ=3ℓ=5Mean
Baseline: Single Agent (without tool or skill)
Qwen3.5-4B10.8711.396.128.157.895.126.567.42
Qwen3.5-9B16.1714.459.3511.3113.559.5311.6111.94
Baseline: Single Agent (with tools and skills)
Qwen3.5-4B21.1320.7515.1217.2825.0219.3522.2920.70
Qwen3.5-9B28.5331.1423.8726.6735.7930.0833.0430.75
Baseline: FloWright (untrained)
Qwen3.5-4B31.9134.9125.7029.2436.1730.5833.4832.09
Qwen3.5-9B50.1444.4740.4842.0252.4446.8449.7447.50
FloWright: Train-Time Optimization
+ (a) 4B35.1637.7829.1532.4738.3833.5836.0734.92
+ (a) 9B54.5148.2843.6645.4456.9950.3653.8051.39
+ (b) 4B39.3239.5030.9434.2339.2733.7436.6136.15
+ (c) 4B36.2338.7529.8833.2938.8932.6535.8935.15
+ (d) 4B39.2340.7131.9135.2940.4834.6737.6837.12
(Bold marks the best Qwen3.5-4B result in each column)
  • Workflows beat a single agent: untrained FloWright improves over the single-agent baselines by at least ↑11.39% overall.
  • Every evolution mode helps in every regime: at matched model size, each mode exceeds its untrained counterpart, by up to ↑7.41%.
  • Co-evolving more roles gains more: multi-agent co-evolution leads 7 of 8 columns and gains ↑5.03% overall, ahead of ↑4.06% (agent-skill), ↑3.06% (upstream-downstream), and ↑2.83% (single role).

Generalizability: Algorithms, Rewards, Topologies, and Pools

The gains hold across RL algorithms, reward terms, workflow topologies, pool granularities, and pool dynamics.

The signal generalizes across RL algorithms

Optimizing the Generator outperforms the untrained baseline under every algorithm: ↑2.83% for GRPO, ↑3.23% for CISPO, and ↑3.84% for DAPO overall.

DAPO leads in every regime, and its margin widens out-of-domain.

Generalizability across RL algorithms
Algorithm Generalizability. Each algorithm optimizes the Generator on Qwen3.5-4B.

Transferability: Across Roles and Backbones

What FloWright optimizes transfers across roles and to backbones it never trains alongside, at both train and test time.

Whichever role is optimized, it helps

Alone, the Generator gains ↑2.83%, the Inventor skill ↑0.90%, and the downstream agent ↑0.88%.

Co-evolution gains more: ↑4.06% for Generator and skill, ↑3.06% for upstream and downstream, and ↑5.03% for multi-agent.

Evolution of different roles
Evolution of Different Roles. Every role runs Qwen3.5-4B, with the only variable as which role the harness optimizes.

Resources

Citation

@article{guo2026flowright,
  title   = {FloWright: It Takes Workflows to Evolve Better Workflows},
  author  = {Guo, Xuehang and Wang, Haoyu and Chen, Haifeng and Chen, Yangyi and Wang, Zhenhailong and Wang, Qingyun},
  journal = {arXiv preprint arXiv:2610.01026},
  url     = {https://arxiv.org/abs/2610.01026},
  year    = {2026}
}