<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-we-use-abstract-syntax-trees-asts-to-turn-workflows-code-into-visual-diagrams-2krwcierj" -->

---
title: How we use Abstract Syntax Trees (ASTs) to turn...
description: Cloudflare Workflows now generates visual step diagrams in the dashboard. Since workflows are written as TypeScript code (not declarative YAML/JSON), the team...
canonical: https://daily.dev/posts/how-we-use-abstract-syntax-trees-asts-to-turn-workflows-code-into-visual-diagrams-2krwcierj
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How we use Abstract Syntax Trees (ASTs) to turn Workflows code into visual diagrams | daily.dev
og:description: Cloudflare Workflows now generates visual step diagrams in the dashboard. Since workflows are written as TypeScript code (not declarative YAML/JSON), the team...
og:url: https://daily.dev/posts/how-we-use-abstract-syntax-trees-asts-to-turn-workflows-code-into-visual-diagrams-2krwcierj
og:image: https://api.daily.dev/og/posts/2kRwcIErj.png
og:image:alt: How we use Abstract Syntax Trees (ASTs) to turn Workflows code into visual diagrams
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

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

**[Cloudflare](https://daily.dev/sources/cloudflare)** · 13 min read · 20 upvotes · 0 comments

## Summary

Cloudflare Workflows now generates visual step diagrams in the dashboard. Since workflows are written as TypeScript code (not declarative YAML/JSON), the team built an AST-based pipeline to statically derive the execution graph. After bundling and minification, the code is parsed using oxc-parser from the JavaScript Oxidation Compiler, running inside a Rust-based Cloudflare Worker via WebAssembly. The parser tracks Promise/await relationships to determine parallel vs. sequential execution, handles patterns like loops, branches, try/catch, and ternary operators, and maps everything to a set of predefined node types (StepDo, LoopNode, IfNode, ParallelNode, etc.). Each node carries starts/resolves indices to capture timing relationships for vertical positioning in the diagram. The goal is to evolve these diagrams into a full debugging tool with real-time execution tracing, error discovery, and local dev support.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.cloudflare.com/workflow-diagrams/>

## Similar posts on daily.dev

- [On the way to step functions: the two worlds](https://daily.dev/posts/on-the-way-to-step-functions-the-two-worlds-anlwzk3po) · RUBYLAND · 0 upvotes · 0 comments

---

Tags: [#typescript](https://daily.dev/tags/typescript), [#cloudflare](https://daily.dev/tags/cloudflare)

[View this post on daily.dev](https://daily.dev/posts/how-we-use-abstract-syntax-trees-asts-to-turn-workflows-code-into-visual-diagrams-2krwcierj)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How we use Abstract Syntax Trees (ASTs) to turn Workflows code into visual diagrams","url":"https://daily.dev/posts/how-we-use-abstract-syntax-trees-asts-to-turn-workflows-code-into-visual-diagrams-2krwcierj","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-we-use-abstract-syntax-trees-asts-to-turn-workflows-code-into-visual-diagrams-2krwcierj"},"datePublished":"2026-03-27T13:42:05.761Z","dateModified":"2026-03-27T13:42:32.680Z","description":"Cloudflare Workflows now generates visual step diagrams in the dashboard. Since workflows are written as TypeScript code (not declarative YAML/JSON), the team...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c24a904b6aaaa1bd41cede14be599951?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c24a904b6aaaa1bd41cede14be599951?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Cloudflare","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Cloudflare","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/38522e1d11354cd6b7af66f9d4316735","url":"https://daily.dev/sources/cloudflare"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-we-use-abstract-syntax-trees-asts-to-turn-workflows-code-into-visual-diagrams-2krwcierj","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":20},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"typescript,cloudflare","timeRequired":"PT13M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Cloudflare","item":"https://daily.dev/sources/cloudflare"},{"@type":"ListItem","position":3,"name":"How we use Abstract Syntax Trees (ASTs) to turn Workflows code into visual diagrams"}]}
```

