StarFlow: Generating Structured Workflow Outputs From Sketch Images

Patrice Béchard, Chao Wang, Amirhossein Abaskohi, Juan A. Rodríguez, Christopher Pal, David Vázquez, Spandana Gella, Sai Rajeswar, Perouz Taslakian

TL;DR

StarFlow is a new framework that uses Vision-Language Models (VLMs) to automatically translate hand-drawn or digital workflow sketches directly into structured, executable JSON code. By curating a diverse dataset of workflow diagrams and fine-tuning open-weight VLMs, the authors demonstrate that domain-specific fine-tuning allows smaller models to drastically outperform massive proprietary models like GPT-4o and Claude 3.7 Sonnet on this complex task.

What Problem Does This Paper Address?

Enterprise workflow automation—orchestrating tasks, data processing, and system integrations—is foundational to modern business efficiency. However, creating these workflows typically requires manual configuration within low-code platforms or visual programming tools. While easier than writing raw code, it still demands a deep understanding of system logic, data dependencies, and execution rules.

When developers or business analysts brainstorm, they often sketch out processes as flowcharts or diagrams. Bridging the gap between a free-form visual sketch and an executable structured format (like JSON) is highly challenging. Sketches are inherently ambiguous, diagramming styles vary wildly, and inferring strict execution logic (such as triggers, conditional loops, and specific API scopes) from visual elements requires deep domain knowledge that general-purpose vision models lack.

Methods

The authors introduce StarFlow, an end-to-end framework that takes a workflow diagram image as input and directly generates a structured JSON representation detailing the execution logic, triggers, actions, and inputs.

Instead of relying on multi-stage pipelines (e.g., detecting shapes first, then generating code), StarFlow leverages the native multimodal capabilities of VLMs to map pixels directly to code. The authors fine-tuned several prominent open-weight VLMs, including Qwen2.5-VL, LLaMA 3.2 Vision, Phi-3.5/4, and Pixtral.

To rigorously evaluate the generated workflows, the paper introduces four metrics:

  • Flow Similarity (FlowSim): Decomposes workflows into tree structures and calculates a normalized tree edit distance, heavily weighting actions over minor inputs.
  • TreeBLEU: Measures structural hierarchy recall between the predicted and reference workflow trees.
  • Trigger Match (TM): Evaluates if the model correctly identifies the workflow's starting trigger.
  • Component Match (CM): An order-agnostic metric evaluating the intersection-over-union of predicted workflow components.

Datasets

Because no comprehensive dataset existed for this task, the authors curated a diverse dataset consisting of 18,881 training samples, split into five distinct visual styles:

  1. Synthetic: Programmatically generated graphs using Graphviz with randomized orientations and edge styles.
  2. User Interface: Automated renders using ServiceNow’s native visual workflow tool.
  3. Digital: Human-annotated diagrams drawn using digital sketching tools.
  4. Manual: Human-annotated diagrams hand-drawn on physical paper.
  5. Whiteboard: Human-annotated diagrams drawn on physical whiteboards or blackboards.

Additionally, they compiled an Out-of-Distribution (OOD) evaluation set of 300 real-world and human-generated diagrams from completely unseen workflow platforms to test generalization.

Key Insights and Ideas

  • Domain Knowledge Trumps Model Size: General proprietary models struggle with exact enterprise naming conventions. For instance, if a sketch implies creating a user in Azure, a proprietary model might guess create_user under a generic scope, whereas the system requires create_a_user under sn_ms_ad_spoke. Fine-tuning allows smaller models to memorize these crucial domain-specific APIs and schemas.
  • End-to-End Beats Decomposition: Counterintuitively, breaking the task down into subtasks (e.g., Sketch $\rightarrow$ Text Summary $\rightarrow$ Outline $\rightarrow$ Final Workflow) performed worse than a direct end-to-end approach. Multi-stage pipelines suffer from compounding errors, where a single missed detail in the summary ruins the subsequent code generation.
  • Handwriting is the Hardest Hurdle: Across all models, performance dropped significantly on Manual and Whiteboard samples compared to Synthetic or User Interface inputs, highlighting that parsing messy handwriting remains a primary bottleneck for VLMs.

Key Results

Fine-tuning yielded massive performance leaps across the board. As shown in the benchmarking experiments:

  • Qwen-2.5-VL-7B (Fine-tuned) achieved the highest overall FlowSim score of 0.957 (with inputs), vastly outperforming its base version (0.614) and top proprietary models like GPT-4o (0.786) and Gemini 2.0 Flash (0.780).
Performance comparison across different sample types
  • On out-of-distribution (OOD) real-world charts, the fine-tuned open-weight models generalized remarkably well, performing on par with or superior to frontier proprietary models, proving that the learned structural priors translate beyond the training set.

Limitations and Future Work

Despite strong results, the authors note several limitations:

  • Lack of Real-Time Grounding: The models cannot currently verify if a predicted table or component actually exists in a live enterprise environment, sometimes leading to the hallucination of invalid API components.
  • Syntactic vs. Semantic Evaluation: Current metrics evaluate structural similarity rather than functional runtime correctness. A workflow might look structurally similar but fail to execute due to a minor logical inversion.

Future Directions: The authors suggest moving toward agentic workflow generation (using ReAct-style frameworks) where the VLM can perform active tool calls, query documentation, and self-correct errors during the generation process.

Summary updated

BibTeX
@inproceedings{bechard2026starflow,
  author = {Patrice Béchard and Chao Wang and Amirhossein Abaskohi and Juan A. Rodríguez and Christopher Pal and David Vázquez and Spandana Gella and Sai Rajeswar and Perouz Taslakian},
  title = {{StarFlow: Generating Structured Workflow Outputs From Sketch Images}},
  booktitle = {EACL (Volume 1: Long Papers)},
  year = {2026},
  doi = {10.18653/v1/2026.eacl-long.76},
}
Figure