💫 StarFlow: Generating Structured Workflow Outputs From Sketch Images

Patrice Bechard, Chao Wang, Amirhossein Abaskohi, Juan Rodriguez, Christopher Pal, David Vazquez, Spandana Gella, Sai Rajeswar, Perouz Taslakian
ServiceNow Research
StarFlow converts sketches and diagrams into structured workflows using fine-tuned vision–language models and a purpose-built dataset.

Abstract

Workflows are a fundamental component of automation in enterprise platforms. Building them can be complex and often requires manual configuration through low-code or visual tools. We explore using vision–language models (VLMs) to automatically generate structured workflows from visual inputs—hand-drawn sketches and computer-generated diagrams. We introduce StarFlow, a framework for this task, curate a diverse dataset of workflow diagrams (synthetic, manually annotated, and real-world), and fine-tune multiple VLMs. Our results show that fine-tuning significantly enhances structured workflow generation, outperforming larger general-purpose models on this task.

Dataset

We build a diverse dataset of workflow diagrams, spanning synthetic, human-annotated, and real-world samples, to enhance training and evaluation. Below, we show the distribution of the dataset across splits and how the dataset was constructed.

Source Train Valid Test
Synthetic12,3761,0001,000
Manual3,035333865
Digital2,613241701
Whiteboard4844046
User Interface37311687
Total 18,881 1,730 2,699

Dataset distribution across splits. Samples are collected from synthetic, manual, digital, whiteboard, and UI sources.

Dataset creation
To generate our dataset, we start from preexisting workflows and convert them to diagrams automatically. We then ask human labelers to convert the diagrams into manual or digital sketches.

Results

We benchmark a range of off-the-shelf and fine-tuned vision–language models on the BigDocs-Sketch2Flow dataset, evaluating their ability to generate structured workflows from sketches and diagrams. Below we summarize the results across different model sizes and categories.

Model FlowSim
w/ inputs
FlowSim
no inputs
TreeBLEU
w/ inputs
TreeBLEU
no inputs
Trigger
match
Component
match
Open-weights Models
Qwen-2.5-VL-3B-Instruct <4B0.4100.3840.3600.3290.0270.201
Phi-3.5-Vision-4B-Instruct 4–12B0.3640.3460.3370.2950.0790.193
Phi-4-Multimodal-6B-Instruct 4–12B0.4650.4040.3940.2980.0540.244
Qwen-2.5-VL-7B-Instruct 4–12B0.6140.5380.5620.5080.0360.280
LLaMA-3.2-11B-Vision-Instruct 4–12B0.4660.4350.4160.3820.0750.239
Pixtral-12B 4–12B0.6320.5820.6170.5410.0880.261
Qwen-2.5-VL-72B-Instruct >12B 0.7100.6430.7030.6550.3250.305
LLaMA-3.2-90B-Vision-Instruct >12B 0.6870.6030.6810.6270.3280.286
Proprietary Models
GPT-4o-Mini proprietary0.6420.6170.6500.6230.2540.305
GPT-4o proprietary0.7860.7070.7940.7180.2820.317
Claude-3.7-Sonnet proprietary0.7630.6790.7690.7010.3180.305
Gemini Flash 2.0 proprietary 0.7800.7130.7980.7430.4660.329
Finetuned Models
Qwen-2.5-VL-3B-Instruct (ft) <4B0.9410.9110.9410.9020.7750.909
Phi-3.5-Vision-4B-Instruct (ft) 4–12B0.9170.8820.9170.8690.7030.874
Phi-4-Multimodal-6B-Instruct (ft) 4–12B0.9390.9080.9400.9020.7700.907
Qwen-2.5-VL-7B-Instruct (ft) 4–12B 0.9570.9270.9560.9200.8190.934
LLaMA-3.2-11B-Vision-Instruct (ft) 4–12B 0.9550.9240.9540.9150.8050.934
Pixtral-12B (ft) 4–12B0.9520.9190.9500.9080.7530.930

Flow quality metrics comparison across different models. Best per category is bold; runner-up is underlined. Size badges: <4B, 4–12B, >12B, proprietary.

Get Started

Running inference with StarFlow is simple. Load one of the released fine-tuned vision–language models, pass in your workflow sketch, and get structured JSON back:

from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration
from PIL import Image

# Load processor and model
processor = AutoProcessor.from_pretrained("ServiceNow/Qwen2.5-VL-7B-Instruct-StarFlow")
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
    "ServiceNow/Qwen2.5-VL-7B-Instruct-StarFlow"
)

# Load your sketch or diagram
image = Image.open("workflow_sketch.png")

# Prepare input with an instruction
inputs = processor(images=image, text="Generate workflow JSON", return_tensors="pt")

# Generate structured workflow
outputs = model.generate(**inputs, max_length=4096)
workflow_json = processor.decode(outputs[0], skip_special_tokens=True)

print(workflow_json)

This will output a workflow_json string containing nodes, edges, and triggers extracted from your sketch—ready to run inside workflow automation platforms. Swap in other StarFlow fine-tuned models (e.g., LLaMA or Pixtral variants) by just changing the model name.

Video Presentation

BibTeX

@article{Bechard2025StarFlow,
  title   = {StarFlow: Generating Structured Workflow Outputs From Sketch Images},
  author  = {Bechard, Patrice and Wang, Chao and Abaskohi, Amirhossein and Rodriguez, Juan and Pal, Christopher and Vazquez, David and Gella, Spandana and Rajeswar, Sai and Taslakian, Perouz},
  journal = {arXiv preprint arXiv:2503.21889},
  year    = {2025},
  doi     = {10.48550/arXiv.2503.21889},
  url     = {https://arxiv.org/abs/2503.21889}
}