GraphFlow: Graph-Based Workflow Management for LLM-Agent Serving
Paper: arXiv:2605.22566 (2026-05-21) Authors: Ao Li et al.
Overview
GraphFlow proposes a new workflow management paradigm for LLM-based agent serving systems. Instead of relying on predefined templates and shallow pattern matching, it represents workflows using a unified directed graph called wGraph, where each node corresponds to an atomic operation. wGraph serves as a shared substrate from which task-specific workflows are dynamically instantiated.
Core Concepts
1. wGraph — Unified Graph Representation
- A directed graph where nodes represent atomic operations (tool calls, reasoning steps, API invocations, etc.)
- Edges represent dependencies and data flow between operations
- wGraph serves as a shared substrate — a reusable library of primitives that multiple tasks can compose from
- Supports hierarchical composition: subgraphs can be nested within nodes for modularity
- Contrast with existing systems: rather than matching tasks against rigid templates, wGraph enables dynamic composition
2. Adaptive Workflow Generation
GraphFlow dynamically constructs task-specific workflows from wGraph based on:
- Task semantics: Natural language task descriptions are parsed and mapped to relevant wGraph nodes
- Constraint requirements: User-specified or inferred constraints (e.g., latency bounds, cost limits, tool availability) guide which subgraph is selected
- Runtime context: Current state of the serving system (cache state, tool availability) influences workflow construction
- The generation process produces a task-specific workflow instance — a subgraph of wGraph that satisfies the task's requirements
3. Workflow State Management for KV-Cache Optimization
GraphFlow exploits wGraph structure to reduce redundant computation during agent serving:
- Structural KV-cache reuse: Identifies shared prefixes in wGraph subpaths — if two workflows share a common sequence of atomic operations, the KV cache from the first can be reused by the second
- Cache-aware scheduling: When selecting which workflow instance to run, considers cached states to minimize recomputation
- Incremental execution: Workflow steps that depend only on cached outputs skip re-execution
- Achieves approximately 4x memory reduction in KV-cache storage
Methodology
wGraph Construction
- Identify all atomic operations available in the agent serving system (tools, models, APIs, logic steps)
- Define dependency edges between operations based on input/output compatibility
- Optionally compose subgraphs for common multi-step patterns
- Store as a versioned wGraph that can be updated as new operations are added
Adaptive Workflow Generation Process
- Task parsing: Analyze user request to extract semantic intent and required capabilities
- Node selection: Query wGraph to identify candidate nodes matching required capabilities
- Constraint filtering: Apply constraints (latency, cost, availability) to prune candidate nodes
- Path construction: Build a directed path/subgraph satisfying the task requirements
- Instance instantiation: Materialize the workflow instance with concrete parameters
KV-Cache State Management
- Maintain a state registry mapping wGraph node sequences to cached KV states
- On workflow generation, query the registry for existing cached prefixes
- Schedule execution to maximize cache hits
- Evict stale caches based on recency and frequency of access
- Update registry after each execution
Results
- ~4.95 percentage points average improvement in task completion success rate
- ~4x reduction in KV-cache memory consumption
- More robust handling of diverse, unseen task types compared to template-based baselines
Use Cases
- LLM agent serving platforms: Serving systems hosting multi-agent applications with diverse tasks
- Workflow orchestration: Systems that need to dynamically compose tool calls and LLM reasoning steps
- Agent serving optimization: Systems seeking to reduce computational overhead through intelligent caching
- Multi-tenant agent infrastructure: Platforms where different tenants submit different task types sharing common primitives
Key Advantages
- Dynamic composition — no reliance on rigid templates
- Shared substrate — atomic operations are reusable across tasks
- Cache efficiency — structural KV-cache reuse from shared subgraph prefixes
- Constraint-aware — workflow generation respects latency, cost, and availability constraints
- Extensible — new operations simply add nodes to wGraph without modifying existing workflows
Architecture Diagram (Conceptual)
┌─────────────────────────────┐
│ wGraph Repository │
│ (Unified Graph of Atomic │
│ Operations & Dependencies) │
└──────────┬──────────────────┘
│
┌──────────────────┼──────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Adaptive │ │ Task │ │ KV-Cache │
│ Workflow │──│ Semantics │ │ State │
│ Generator │ │ Parser │ │ Manager │
└──────┬───────┘ └──────────────┘ └──────┬───────┘
│ │
▼ ▼
┌──────────────────────────────────────────────┐
│ Task-Specific Workflow Instance │
│ (Instantiated Subgraph of wGraph) │
└──────────────────────────────────────────────┘
References
- arXiv:2605.22566 — GraphFlow: A Graph-Based Workflow Management for Efficient LLM-Agent Serving
- Related work in LLM agent serving, workflow management systems, and KV-cache optimization techniques
