Manuscript Offprint

arXiv:2608.30250

Generating Workflow DAGs from Natural Language with Non-Reasoning LLMs

Anand Iyer, Bhanu Khetharpal, Srinivas Upadhya, Ramkumar Rajagopal

Abstract

This paper addresses the problem of translating natural-language routing rules written by business administrators into executable workflow graphs for enterprise contact centers. Each target is an executable workflow graph, a directed acyclic graph (DAG) of conditional actions with parallel branches, hit-first fallback chains, and per-branch boolean predicates—encoded in the JSON dialect of a commercial routing platform. We present a system for this translation and show that, with the right neuro-symbolic decomposition, lower-cost non-reasoning LLMs can generate complex workflow DAGs at production-relevant quality without expensive extended-reasoning models. Our central diagnostic is an emission-density bottleneck: on a 635-rule benchmark (manufactured synthetic data), models select the right graph nodes almost perfectly but drop their content—mis-wiring attributes and boolean grouping—as the number of interdependent nodes they must emit in a single pass grows. Acting on this diagnostic, we move combinatorial graph construction out of the model into a deterministic compiler driven by a compact intermediate representation (IR), with a learned registry-selection front-end that keeps generation focused as the vocabulary grows. Across four generation models, the full system reaches up to ~89% LLM-judge validity and ~90% exact-match condition accuracy with 99–100% guaranteed-valid JSON, at roughly half the per-rule prompt tokens of a monolithic prompt. Our sharpest result, tested paired, is a gap-bridging effect: structural externalization delivers a large, significant lift where monolithic prompting leaves the most headroom (+24 points judge validity on GPT-5.3-chat), lifting a non-reasoning model to statistically match (by an equivalence test) a reasoning model's out-of-the-box quality, while an ~8-point frontier gap persists. We close with a deployment path and transferable lessons for structured-generation applications.

1 Introduction

Problem and significance. A commercial contact-center platform routes inbound chat, voice, and SMS conversations through queues governed by routing rules. Each rule must compile to a workflow definition: a JSON DAG whose nodes are actions (raise priority, transfer queue, notify supervisor, offer callback) and whose edges encode conditional and hit-first execution order. Authoring this JSON by hand demands platform expertise and is error-prone. The platform’s current authoring capability generates these workflows with a single large (“monolithic”) LLM prompt over a structured, templatized rule representation; extending it to accept natural-language rules would substantially widen adoption, and is the problem this paper studies.

Representative prompt and DAG. Consider the prompt: “For customers in region US, while they wait in queue, raise priority by 10 every 10 seconds for 3 minutes; if still unresolved at 3 minutes, end the conversation.” Its target DAG contains a queue-wait trigger; a region = US predicate gating the branch; raise-priority, timer, and end-conversation action nodes; and dependency edges under which priority repeats during the timer and the timer gates the terminal action. The target is therefore not a flat action list but a graph specifying which predicate gates each action and how the actions depend on one another.

The task is a constrained graph-generation problem, hard for three reasons: density (production rules combine up to 15 conditional branches across customer segments—and more actions still, since one branch can fire several—producing large branch grids), exactness (one wrong value or dropped branch changes the workflow's behavior; generated workflows are reviewed and validated by a human before deployment, so higher first-pass accuracy reduces correction and regeneration iterations), and cost at scale (the converter runs inside an interactive authoring experience, so per-rule token budget rules out simply deploying the most powerful reasoning model).

Motivation. Iterating on the monolithic prompt surfaced a clear insight: few-shot exemplars are the primary driver of accuracy. But as the platform grows, each new scenario adds actions, conditions, and scenario-specific exemplars, and a single prompt that inlines all of them on every request grows in cost and dilutes attention over largely irrelevant context. Our architecture preserves the few-shot signal while paying only for the vocabulary and exemplars each rule actually needs.

Thesis. These constraints need not force a quality compromise. A non-reasoning model handed a large monolithic prompt degrades on dense rules, but the reason is specific and fixable: the model is excellent at reading a rule and comparatively poor at emitting it as dense interdependent structure in one pass. We name this the emission-density bottleneck: the model almost always selects the correct graph nodes (node-set accuracy near-saturated) yet increasingly mis-emits their attributes and boolean structure as node density rises, so accuracy falls with branch-grid density, not with the difficulty of reading. The remedy is therefore architectural rather than model-scale—move the combinatorial, drop-prone parts of graph construction into a deterministic compiler and keep the LLM on interpretation—letting commodity non-reasoning models produce production-relevant DAGs and reach judge validity that is statistically equivalent, at a pre-specified ±5\pm5-point margin, to a strong reasoning model's out-of-the-box quality.

Contributions.

  1. The emission-density bottleneck—a diagnostic that localizes structured-generation failure to emission, not interpretation: models select the right graph nodes almost perfectly (node-set accuracy 98–100% for stronger models) yet increasingly mis-emit node attributes and boolean structure as node density rises (Figure 1), so the fix is architectural rather than model-scale. This generalizes as a diagnostic lens for NL→graph tasks.

  2. A gap-bridging result, stated precisely and tested paired: acting on the diagnostic lets a non-reasoning generator statistically match (equivalence-tested at a ±5\pm5-point margin) a reasoning model's monolithic-prompt quality on the semantic metric where monolithic prompting leaves the most headroom (+24 points, p<10−3p < 10^{-3}), while gains for models that already emit dense structure well are small and an ∼8\sim8-point frontier gap persists—a quantified account of when structural externalization helps and when it does not.

  3. An emerging-application study that instantiates the LLM-as-compiler paradigm for natural-language → workflow-DAG generation on a real enterprise routing platform. The diagnostic drives a concrete architecture—a compact IR compiled deterministically to valid JSON, and a learned registry selector that keeps generation focused as the vocabulary grows—yielding validity by construction (99–100% valid JSON; 0% uncompilable IR across all four models) at roughly half the per-rule prompt tokens of a monolithic prompt.

  4. A deployment path—registry-selection as the scaling mechanism, a planned similarity-based candidate pre-filter, and a target-agnostic compiler—plus transferable evaluation lessons for structured-generation applications.