Tools & TutorialsLOW

Tools - Using ASTs to Visualize Workflows Code

CFCloudflare Blog
CloudflareAbstract Syntax TreesWorkflowsTypeScriptVisual Diagrams
🎯

Basically, we turn your code into easy-to-understand diagrams.

Quick Summary

Cloudflare has introduced visual diagrams for Workflows, making it easier to understand complex code structures. This update enhances workflow management and visualization. Developers can now see how their code connects and executes, improving overall efficiency.

What Happened

Cloudflare recently announced a significant update to its Workflows feature. Every workflow now includes a visual diagram in the dashboard. This enhancement aims to help developers visualize their applications better. With workflows being just code, understanding how steps connect and branch is crucial. The visualization process utilizes Abstract Syntax Trees (ASTs) to translate TypeScript code into these diagrams.

How It Works

Workflows can execute steps dynamically, meaning that steps can run in parallel or sequentially based on the code's logic. This dynamic execution model presents challenges when rendering diagrams. To tackle this, Cloudflare fetches the workflow script at deployment time, allowing for a comprehensive parsing of the code. The AST is created to represent the workflow, which is then used to generate a visual graph that illustrates the workflow's structure.

Challenges Faced

Rendering accurate diagrams involves tracking relationships between steps and functions. The workflow engine does not inherently know the execution order of steps, which is vital for creating a meaningful diagram. Additionally, minified JavaScript can complicate parsing. Cloudflare addressed this by implementing the oxc-parser, which processes various forms of minified code efficiently. This parser converts the minified JavaScript into AST node types, enabling the generation of the graphical representation.

Future Improvements

As the diagram feature is still in beta, Cloudflare plans to iterate and enhance the visual representations continually. The goal is to ensure that the diagrams accurately reflect the workflow's execution flow, making it easier for developers to understand their code. By improving this tool, Cloudflare aims to empower developers to manage their workflows more effectively and intuitively.

🔒 Pro insight: The integration of ASTs for visual representation can significantly enhance debugging and workflow optimization, especially in complex applications.

Original article from

Cloudflare Blog · André Venceslau

Read Full Article

Related Pings

MEDIUMTools & Tutorials

Windows 11 - Smart App Control Improvements Explained

Microsoft's KB5079391 update enhances Smart App Control in Windows 11, making it easier to manage. Users benefit from improved security and display reliability. This update is optional and can be installed through Windows Update.

BleepingComputer·
LOWTools & Tutorials

ISC Stormcast - Weekly Cybersecurity Insights

The ISC Stormcast for March 27, 2026, shares key cybersecurity insights. It's a must-listen for anyone interested in staying updated on the latest security trends. Tune in to enhance your knowledge and protect your systems.

SANS ISC Full Text·
MEDIUMTools & Tutorials

Tails 7.6 - New Automatic Tor Bridge Retrieval Added

Tails 7.6 is here with automatic Tor bridge retrieval and a new password manager. This update simplifies access on restricted networks and enhances credential management. Users can now connect to Tor more easily and securely.

Help Net Security·
LOWTools & Tutorials

Scanning the Internet - Exploring Linux Tools for Security

Discover powerful Linux tools for internet scanning. Learn how to identify vulnerabilities and exposed devices effectively. Enhance your network security with these insights.

SC Media·
MEDIUMTools & Tutorials

Passkeys - Ready for Prime Time in Modern Banking

OneSpan's Ashish Jain reveals why passkeys are essential for modern banking. They enhance security and user experience, making traditional methods obsolete. Banks must adopt quickly to stay competitive.

SC Media·
MEDIUMTools & Tutorials

Security Tools - Learn from Blunders to Improve Programs

Organizations often repeat security mistakes, but a recent RSAC session revealed how to avoid them. Learning from these blunders can enhance security programs significantly. By implementing proactive measures, companies can strengthen their defenses and build trust.

Dark Reading·