# ReTrace: Distilling Tool-Using Agents into Planner-Free Workflows

> Source: <https://huggingface.co/papers/2611.14492>
> Published: 2026-11-12 17:33:46+00:00

[Papers](https://huggingface.co/papers)

# ReTrace: Distilling Tool-Using Agents into Planner-Free Workflows

## Abstract

ReTrace converts natural-language SOPs and logged LLM agent runs into reusable code-driven workflows that cut cost and latency while maintaining competitive task success.

[deepseek-ai/DeepSeek-V4.1-Flash](https://huggingface.co/deepseek-ai/DeepSeek-V4.1-Flash)

Business process automation runs the same Standard Operating Procedure (SOP) again and again on new inputs. [Large Language Model (LLM)](</papers?q=Large%20Language%20Model%20(LLM)>) agents can follow an SOP written in natural language, but they call an LLM to choose every step of every run, which adds latency and cost at scale. We present ReTrace, which turns an SOP and a few logged agent runs into a reusable workflow in which code, not an LLM, selects the next step. The agent's reasoning, the explanation it writes with each tool call, often states why it took an action; the [tool calls](https://huggingface.co/papers?q=tool%20calls) alone do not. ReTrace extracts the condition behind each step, merges these conditions across runs into a compact rule document, and generates an executable workflow from it. Only this last stage depends on the platform, so rule documents can be compiled for different orchestration platforms. On 79 procedures from our production platform, ReTrace workflows reach 93.8% completion, against 96.8% for the agent, at 24% lower cost per task. On τ^2-Bench, they reach 75.8% task success (agent: 80.6%) and run in 1.3s instead of 170s; three rounds of repair on training failures lift k{=}2 workflows from 66.7% to 81.2%. On eight SOP-Bench procedures, ReTrace without repair trails [few-shot generation](https://huggingface.co/papers?q=few-shot%20generation) (80.6% vs. 83.6%), but repair from labeled training failures lifts it to 87.8% at 0.40s per task, compared to 85.5% in 46.6s for the agent.

## Models citing this paper 0

No model linking this paper

## Datasets citing this paper 0

No dataset linking this paper

### Spaces citing this paper 0

No Space linking this paper

## Collections including this paper 0

No Collection including this paper

[collection](https://huggingface.co/new-collection)to link it from this page.
