TL;DR
Cloudflare uses AST parsing and Rust WebAssembly to automatically generate workflow diagrams from dynamic JavaScript code, handling minification and complex execution patterns.
Key Points
- Parses minified JavaScript using oxc-parser (OXC) to extract Abstract Syntax Trees
- Tracks Promise/await relationships to determine parallel vs. sequential execution without explicit declarations
- Handles complex patterns: loops, branches, nested functions, Promise.all(), and multiple bundler formats (esbuild, rspack, vite)
- Implements starts/resolves indexing to map execution order and timing relationships in the UI
Why It Matters
Developers can now visualize agent-generated and complex asynchronous workflows without manual configuration, making debugging and understanding long-running processes significantly easier. This is critical as AI agents increasingly write code that humans need to inspect and reason about.
Source: blog.cloudflare.com