← Latest papers
🤖 machine learning

WorkflowGen:an adaptive workflow generation mechanism driven by trajectory experience

WorkflowGen is an adaptive framework that leverages trajectory experience to dynamically generate and optimize workflows through a closed-loop mechanism and three-tier routing strategy, significantly reducing token consumption and improving success rates for complex LLM agent tasks without requiring large annotated datasets.

Original authors: Ruocan Wei, Shufeng Wang, Ziwei Shi

Published 2026-04-23
📖 4 min read☕ Coffee break read

Original authors: Ruocan Wei, Shufeng Wang, Ziwei Shi

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). ✨ This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a highly skilled but very expensive personal assistant (let's call him LLM-Andy) who helps you get things done, like booking a complex business trip, analyzing data, or automating a report.

The Problem: The "Forgetful & Over-Thinker" Assistant
Right now, every time you ask Andy to do a task, even if it's something he did yesterday, he acts like he's seeing it for the first time.

  • Wasting Money: He starts from scratch, re-reading your entire request, re-thinking every single step, and re-calculating the best tools to use. Since Andy charges by the word he thinks and speaks, this "re-thinking" burns through your budget (tokens) incredibly fast.
  • Making Mistakes: Because he's rushing to plan everything from zero, he often forgets a step, picks the wrong tool, or trips over a known error he made last week.
  • No Memory: Even if he successfully solved a problem last Tuesday, he treats that success as a secret. He doesn't write it down in a "cheat sheet" to use next time.

The Solution: WorkflowGen (The "Smart Cheat Sheet" System)
The paper introduces WorkflowGen, a system that turns Andy into a super-efficient, memory-keeping expert. Instead of re-inventing the wheel every time, it uses a "Trajectory Experience" approach.

Here is how it works, using a simple analogy: The Travel Agent.

1. The "Cheat Sheet" (Trajectory Extraction)

When Andy finishes a task, WorkflowGen doesn't just say "Done." It immediately writes a detailed Cheat Sheet (a structured record) of exactly what happened.

  • What worked: "To book a flight, we used Tool A, input the date like this, and it worked."
  • What failed: "If you try to book a flight on a Sunday without a visa, Tool B crashes. Don't do that!"
  • The Structure: It saves the shape of the plan (the steps) but highlights the variable parts (the specific dates, names, or numbers).

2. The "Three-Step Fallback" (Adaptive Routing)

When you give Andy a new request, WorkflowGen doesn't just let him think randomly. It acts like a smart traffic cop, checking how similar your new request is to the old ones on the Cheat Sheet. It has three modes:

  • Mode A: The "Copy-Paste" (Direct Reuse)

    • Scenario: You ask, "Book a flight to London for next Monday," and you asked the exact same thing yesterday.
    • Action: WorkflowGen says, "We did this yesterday! Here is the exact same plan."
    • Result: Andy executes it instantly. Zero extra thinking, zero extra cost.
  • Mode B: The "Edit Only" (Rewriting)

    • Scenario: You ask, "Book a flight to Paris for next Tuesday."
    • Action: The system sees the plan is 90% the same (London -> Paris, Monday -> Tuesday). It tells Andy: "Keep the whole plan, just change the city and the date."
    • Result: Andy only has to think about the two small changes, not the whole trip. Huge savings on cost and time.
  • Mode C: The "Start Over" (Full Initialization)

    • Scenario: You ask, "Design a new marketing strategy for a robot dog."
    • Action: This is totally new. The Cheat Sheet has nothing to help.
    • Result: WorkflowGen says, "Okay, this is new. Andy, plan this from scratch." But once he's done, the system immediately saves this new plan to the Cheat Sheet for next time.

3. The "Safety Net" (Error Avoidance)

Because the system remembers failures too, it acts like a guardrail.

  • If the Cheat Sheet says, "Tool X crashes if the user is in Europe," and you try to use Tool X for a European client, WorkflowGen stops Andy before he makes the mistake. It forces him to use a different tool. This prevents the "crash" and saves the money you would have wasted on a failed attempt.

Why This Matters (The Bottom Line)

  • Cheaper: By reusing old plans and only rewriting small parts, the paper claims they cut the cost (token usage) by over 40% compared to the old way.
  • More Reliable: It doesn't make the same mistakes twice because it remembers the "fingerprint" of errors.
  • Faster: It skips the long thinking process for routine tasks.

In a Nutshell:
WorkflowGen stops treating every task as a brand-new invention. Instead, it treats every task as a variation of something we've already done, saving money, time, and headaches by learning from both our successes and our failures. It turns a "forgetful genius" into a "reliable, efficient expert."

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →