Home InternationalHow we use Abstract Syntax Trees (ASTs) to turn Wo...
International⭐ Featured

How we use Abstract Syntax Trees (ASTs) to turn Workflows code into visual diagrams

Workflows are now visualized via step diagrams in the dashboard. Here’s how we translate your TypeScript code into a visual representation of the workflow.

7 April 2026 at 08:56 am
1 views
How we use Abstract Syntax Trees (ASTs) to turn Workflows code into visual diagrams

Cloudflare Workflows, a robust execution engine designed to enable developers to chain steps, retry on failure, and persist state across long-running processes, has recently introduced a significant enhancement. Last month, the company announced that every workflow deployed to Cloudflare now comes with a complete visual diagram in the dashboard. This development is a response to the growing importance of visualizing applications, especially as coding agents are increasingly responsible for building complex systems that may not always be easily readable by humans.

The ability to visualize workflows is crucial, as it provides insights into how steps connect, where they branch, and the overall flow of execution. Unlike traditional visual workflow builders that rely on declarative configurations such as JSON or YAML, Cloudflare Workflows are based on code, which can include Promises, Promise.all, loops, conditionals, and nested functions or classes. This dynamic execution model poses a challenge when it comes to rendering a visual diagram.

To address this challenge, Cloudflare has implemented Abstract Syntax Trees (ASTs) to statically derive the graph that represents the workflow. ASTs provide a structured representation of the code, making it possible to track Promise and await relationships and understand which steps run in parallel, which block execution, and how the pieces connect.

The process of translating TypeScript code into a visual representation involves parsing the code and constructing an AST. This tree-like structure allows developers to traverse the code and identify key execution points, such as steps that are executed in parallel or those that are dependent on the completion of others. By analyzing these relationships, Cloudflare can generate an accurate and informative visual diagram that reflects the actual execution flow of the workflow.

The visual diagram in the dashboard offers several benefits. Firstly, it provides a high-level overview of the workflow, making it easier for developers to understand the structure and flow of their code. This is particularly useful when dealing with complex workflows that involve multiple steps and conditional logic. Secondly, the diagram serves as a valuable tool for debugging and troubleshooting, as it allows developers to identify potential issues or bottlenecks in the execution flow.

In addition to these benefits, the visual diagram also enhances collaboration among team members. By providing a shared visual representation of the workflow, developers can more effectively communicate the intended flow and functionality of their code. This can lead to improved code quality and reduced time spent on understanding the workflow's structure.

To see the diagram for yourself, simply deploy your first workflow on Cloudflare and navigate to the dashboard. The visual representation will provide a dynamic and informative overview of your workflow's execution flow, making it easier to manage and maintain your code.

In conclusion, Cloudflare's integration of Abstract Syntax Trees (ASTs) to translate Workflows code into visual diagrams represents a significant advancement in the field of workflow management. By leveraging ASTs, the company has created a powerful tool that enables developers to better understand, debug, and collaborate on their workflows. As the importance of visualizing applications continues to grow, Cloudflare's innovation serves as a valuable example of how code can be transformed into a more accessible and intuitive format.

📰 Related News
Ollama 0.2.6 Released with Native Gemma 4 Support and Enhanced Performance
Ollama 0.2.6 Released with Native Gemma 4 Support and Enhanced Performance
Ollama 0.2.6 is now live, featuring native support for Google's Gemma 4 models and improved local inference performance for Windows, macOS, and Linux.
14 Apr
Weekly news roundup: Shortages spread to MLCCs; SK Hynix reportedly in talks with Microsoft and Google
Weekly news roundup: Shortages spread to MLCCs; SK Hynix reportedly in talks with Microsoft and Google
Below are the most-read DIGITIMES Asia stories from the week of April 6-April 13, 2026:
14 Apr
cutile-stencil 0.2.0
cutile-stencil 0.2.0
An xDSL-based stencil compiler that generates optimized GPU kernels via NVIDIA cuTile
14 Apr
merlin-llm added to PyPI
merlin-llm added to PyPI
Merlin — a fast local LLM for agentic coding on Apple Silicon
14 Apr
Fluent Cut - Craft and compose videos programmatically in PHP with an elegant fluent API
Fluent Cut - Craft and compose videos programmatically in PHP with an elegant fluent API
Craft and compose videos programmatically in PHP with an elegant fluent API - b7s/fluentcut
14 Apr
Crypto Investor at Center of Trump Corruption Allegations Now Sees Himself as ‘Victim’
Crypto Investor at Center of Trump Corruption Allegations Now Sees Himself as ‘Victim’
Justin Sun has accused Trump-affiliated World Liberty Financial of misconduct and a general lack of transparency.
14 Apr
nvidia-nat-weave 1.7.0a20260413
nvidia-nat-weave 1.7.0a20260413
Subpackage for Weave integration in NeMo Agent Toolkit
14 Apr
nvidia-nat-s3 1.7.0a20260413
nvidia-nat-s3 1.7.0a20260413
Subpackage for S3-compatible integration in NeMo Agent Toolkit
14 Apr
Social Security Trust Fund to Run Dry in 2032: Just 6 Years From Now
Social Security Trust Fund to Run Dry in 2032: Just 6 Years From Now
Six years. That is how much time separates retirees from a Social Security system that, by its own projections, runs out of money. If you are 56 years old...
14 Apr
cane-gpu-perf added to PyPI
cane-gpu-perf added to PyPI
GPU inference benchmarking with opinionated diagnostics
13 Apr