cs.AINov 26, 2026

Compiling Agent Traces into Typed Workflows for Cheaper and Faster Execution of Recurring Tasks

Authors: Jorge Garcia-Carrasco, Javier Sanchis, Sandra Garcia-Ponsoda, Alejandro Mate, Juan Trujillo

Organizations: Department of Software and Computing Systems, University of Alicante, Alicante, 03690, Spain

Abstract

LLM agents solve a wide range of digital tasks, and benchmarks now report high success on requests that span several applications and many steps. However, much of that work is repetitive: a user asks for the same kind of change again and again, such as moving an alarm or rescheduling a meeting, with different data but a familiar procedure. Running the full agent for every instance is therefore expensive. To this aim, we propose an intermediate representation for such workflows: a directed graph whose nodes fall into three categories by output space, EXECUTE for computation and tool calls, DECIDE for one bounded choice over candidates the graph declares, and GENERATE for the open-ended rest. The idea is that a compiler agent takes the successful traces and compiles them into such a representation. An engine then runs the graph, calling a model only where a node declares one, so a deployment keeps neither the agent loop nor its context. We evaluate on AppWorld, compiling from one agent's traces and running the result on held-out instances. We show that the compiled workflows solved all instances at 98 times lower cost and 76 times faster per run. Compiling a workflow took three to five minutes and paid for itself after 31 to 50 executions.

Figures & tables

Explore similar work

CardsList
  1. TraceCompiler: Skill-Guided Mining and Compilation of LLM Agent Traces into Mostly Deterministic Workflows

    Aug 3, 2026Salma El Yadouni, Guanyi LiAgentic WorkflowsLLM-Based Program Synthesis

  2. ReTrace: Distilling Tool-Using Agents into Planner-Free Workflows

    Nov 10, 2026Kaiyuan Hou, Yang Ping Kuo, Indranil Bhattacharya +6LLM Agent Workflow OptimizationWorkflow Automation

  3. From Static Templates to Dynamic Runtime Graphs: A Survey of Workflow Optimization for LLM Agents

    Mar 23, 2026Ling Yue, Kushal Raj Bhandari, Ching-Yun Ko +6LLM Agent Workflow OptimizationAgentic Workflows