CSV workflow generator: turn an exported workflow definition into a diagram
Turn a workflow definition exported to CSV into a diagram with approval gates and rework loops. Three columns draw it: Shape, Box text and Line to. QueryChart documents the workflow; it does not execute it.
The CSV that produces this diagram
One row per step. The numbers in Line to are row numbers — that is what draws the connectors, and it is the column most files are missing.
| # | Shape | Box text | Line to | Line text | Horizontal lane | Vertical lane |
|---|---|---|---|---|---|---|
| 1 | Start | Receive a discount request from the customer | 2 | Quote | Sales rep | |
| 2 | Process | Enter line items, list price and requested discount | 3 | Quote | Sales rep | |
| 3 | Process | Calculate gross margin after discount | 4 | Quote | Sales rep | |
| 4 | Process | Write the reason the discount is being asked for | 5 | Quote | Sales rep | |
| 5 | Decision | Margin at or above 40%? | 6, 7 | 40% or above, Below 40% | Margin check | Sales rep |
| 6 | Approval | Approve at rep level and stamp the margin | 19 | Approval | Sales rep | |
| 7 | Decision | Margin at or above 30%? | 8, 10 | 30% to 40%, Below 30% | Margin check | Sales manager |
| 8 | Process | Sales manager checks the reason and the volume commitment | 9 | Approval | Sales manager | |
| 9 | Decision | Sales manager approves? | 19, 15, 22 | Approved, Send back to be revised, Refuse the discount | Approval | Sales manager |
| 10 | Decision | Margin at or above 20%? | 11, 13 | 20% to 30%, Below 20% | Margin check | Finance |
| 11 | Process | Finance checks the margin against the account history | 12 | Approval | Finance | |
| 12 | Decision | Finance approves? | 19, 15, 13 | Approved, Send back to be revised, Refer up to the director | Approval | Finance |
| 13 | Process | Prepare the deal summary for the commercial director | 14 | Approval | Commercial director | |
| 14 | Decision | Commercial director approves? | 19, 18, 22 | Approved, Approved with conditions, Refuse the discount | Approval | Commercial director |
| 15 | Process | Revise the discount, the price or the terms | 16 | Rework | Sales rep | |
| 16 | Decision | Second time back from the same approver? | 3, 17 | First revision, Second revision | Rework | Sales manager |
| 17 | Decision | Hold the discount or walk away? | 13, 23 | Hold and take it to the director, Walk away on margin grounds | Rework | Commercial director |
| 18 | Process | Record the director's conditions on the quote | 19 | Approval | Commercial director | |
| 19 | Process | Issue the approved quote to the customer | 20 | Issue | Sales rep | |
| 20 | Decision | Customer accepts before the quote expires? | 21, 15, 24 | Accepted, Asks for a bigger discount, No answer before expiry | Issue | Sales rep |
| 21 | Success | Order booked at the approved margin | Issue | Sales rep | ||
| 22 | Reject | Discount refused, quote closed | Issue | Sales manager | ||
| 23 | End | Deal dropped on margin grounds | Issue | Commercial director | ||
| 24 | End | Quote expired with no order | Issue | Sales rep |
#,Shape,Box text,Line to,Line text,Horizontal lane,Vertical lane
1,Start,Receive a discount request from the customer,2,,Quote,Sales rep
2,Process,"Enter line items, list price and requested discount",3,,Quote,Sales rep
3,Process,Calculate gross margin after discount,4,,Quote,Sales rep
4,Process,Write the reason the discount is being asked for,5,,Quote,Sales rep
5,Decision,Margin at or above 40%?,"6, 7","40% or above, Below 40%",Margin check,Sales rep
6,Approval,Approve at rep level and stamp the margin,19,,Approval,Sales rep
7,Decision,Margin at or above 30%?,"8, 10","30% to 40%, Below 30%",Margin check,Sales manager
8,Process,Sales manager checks the reason and the volume commitment,9,,Approval,Sales manager
9,Decision,Sales manager approves?,"19, 15, 22","Approved, Send back to be revised, Refuse the discount",Approval,Sales manager
10,Decision,Margin at or above 20%?,"11, 13","20% to 30%, Below 20%",Margin check,Finance
11,Process,Finance checks the margin against the account history,12,,Approval,Finance
12,Decision,Finance approves?,"19, 15, 13","Approved, Send back to be revised, Refer up to the director",Approval,Finance
13,Process,Prepare the deal summary for the commercial director,14,,Approval,Commercial director
14,Decision,Commercial director approves?,"19, 18, 22","Approved, Approved with conditions, Refuse the discount",Approval,Commercial director
15,Process,"Revise the discount, the price or the terms",16,,Rework,Sales rep
16,Decision,Second time back from the same approver?,"3, 17","First revision, Second revision",Rework,Sales manager
17,Decision,Hold the discount or walk away?,"13, 23","Hold and take it to the director, Walk away on margin grounds",Rework,Commercial director
18,Process,Record the director's conditions on the quote,19,,Approval,Commercial director
19,Process,Issue the approved quote to the customer,20,,Issue,Sales rep
20,Decision,Customer accepts before the quote expires?,"21, 15, 24","Accepted, Asks for a bigger discount, No answer before expiry",Issue,Sales rep
21,Success,Order booked at the approved margin,,,Issue,Sales rep
22,Reject,"Discount refused, quote closed",,,Issue,Sales manager
23,End,Deal dropped on margin grounds,,,Issue,Commercial director
24,End,Quote expired with no order,,,Issue,Sales repThe diagram those rows produce
Rendered from the rows above, unchanged. Edit a cell and the diagram follows; move a box and the rows follow.
The columns QueryChart reads
Header names are matched, not column positions — extra columns are carried along and ignored by the diagram.
| Column | Required? | What it does | Example |
|---|---|---|---|
# | Optional | The 1-based row number the editor prints, and the value every Line to refers to. | 16 |
Shape | Required | Chooses the box QueryChart draws: Start, Process, Decision, End, Success or Reject. | Decision |
Box text | Required | The text inside the box; on a Decision row, write it as the question the gate asks. | Sales manager approves? |
Line to | Required | The row number or numbers this step continues to, comma-separated inside one cell. | 19, 15, 22 |
Line text | Optional | Labels for those connectors, in the same order as Line to: one per branch of a gate. | Approved, Send back to be revised, Refuse the discount |
Horizontal lane | Optional | Groups steps into a column band, usually the stage of the workflow the step belongs to. | Approval |
Vertical lane | Optional | Groups steps into a row band, usually the role or queue that owns the step. | Commercial director |
How it works
Export the workflow as one row per step
Take the definition out of wherever it lives: a BPM tool, a ticketing system's status list, a runbook table. You want one row per step or state, not one row per transition; transitions go in a column. If your export is an edge list, fold it first, as described in /guides/how-to-structure-csv-for-flowcharts.
Rename the headers to QueryChart's
Import matches header names, not column positions: Shape, Box text, Line to, Line text, Horizontal lane, Vertical lane. Order the columns however you like, and leave your own columns (ticket IDs, SLA targets, system of record) in the file. Anything QueryChart does not recognise is carried through and ignored.
Write the transitions as row numbers
Line to holds the 1-based row numbers a step continues to, comma-separated. A gate lists all of its outcomes in one cell, and Line text labels them in matching order. A number smaller than the current row is a rework loop: nothing extra is needed to draw one. /guides/how-to-define-flowchart-connections-in-csv works through the syntax.
Paste or drop the file into the spreadsheet
Open a chart, click into the spreadsheet area, and paste the CSV text, or drag the .csv file onto it. There is no import wizard and no column mapper: the header row is the mapping. The diagram draws as soon as the rows land, and the spreadsheet stays editable next to it.
Check every gate and every loop has an exit
Each Decision needs at least two labelled branches, each rework loop needs a way out, and each ending needs a terminal shape: End, Success or Reject. Then submit the chart for approval if the documentation itself has to be signed off; see /templates/csv-approval-workflow for the worked example on this page.
What usually goes wrong
- Putting your workflow's step IDs in Line to — Exports key transitions by an internal identifier such as REQ_APPROVED or state_7. Line to does not resolve those: it takes the target's position in the file. Translate the IDs to row numbers once, then keep the ID column in the file for reference; it is carried and ignored.
- Exporting one row per transition — A from/to/label edge list produces four rows for a step with four outcomes, and QueryChart draws four boxes. Collapse them: one row for the step, all its targets in a single Line to cell, all its labels in Line text.
- Leaving the commas unquoted — Line to and Line text legitimately contain commas: "19, 15, 22" is one cell, not three. Wrap those cells in double quotes as CSV requires, or the file shifts every column to the right of the gate and the lane names land in the wrong place.
- Branch labels drifting out of order — Line text is matched to Line to by position, not by meaning. If you reorder one column and not the other, the branch that refuses the discount gets labelled Approved: the diagram is wrong, and it is wrong quietly.
- Expecting the chart to run the workflow — QueryChart draws the workflow and holds the documentation of it. It does not execute steps, move tickets, assign owners, or call your systems. Keep the executable definition in your workflow engine, and keep this chart as the picture people are asked to agree with.
Frequently asked questions
What does my CSV actually have to look like?
One row per step, and three columns: Shape, Box text and Line to. Shape picks the box, Box text goes inside it, Line to holds the row number or numbers the step continues to. Line text, Horizontal lane and Vertical lane refine the drawing; headers are matched by name, so column order does not matter.
Does QueryChart run the workflow it generates?
No. QueryChart documents and diagrams the workflow; it does not execute it, route tasks, escalate on a timer, or call your systems. The executable definition stays in your workflow engine. What you get here is the version people can read, argue with and sign off on, kept in step with the CSV it came from.
How do I show a rework loop or a send-back?
Point Line to at an earlier row number and label the branch in Line text. In the sample, row 9 sends "Send back to be revised" to row 15, and row 15 continues to row 16, which asks "Second time back from the same approver?": first revision returns to row 3, second revision goes forward. Nothing special marks a backward connector.
How do I stop a loop reading as infinite?
Give it an exit. A loop that only ever returns to the start tells a reader the work can circle forever, which is rarely what the real workflow does. Put a Decision at the top of the return path (a retry count, a second rejection, an escalation) with one branch back into the loop and one branch out of it.
How do I model an approval gate?
Use a Decision row and give it one labelled branch per outcome. The sample's manager gate lists "19, 15, 22" in Line to against "Approved, Send back to be revised, Refuse the discount" in Line text. Put the approver's name in Vertical lane so the diagram shows who holds each gate.
Can I import a CSV exported from a BPM or ticketing tool?
Yes, once you have done two edits by hand. Rename the headers to QueryChart's, and convert transition targets from internal step IDs to row numbers. There is no connector and no live sync: you export a file and paste it. Columns QueryChart does not recognise ride along untouched.
Is the diagram generated by AI?
No. The same rows produce the same diagram every time, because the columns are read, not interpreted. There is no model in the path to re-roll a different layout, invent a step you did not write, or quietly drop one. If the chart is going to a reviewer or an auditor, that reproducibility is the whole point.
How is this different from Visio's Data Visualizer?
Same starting idea, different footing. Microsoft announced in November 2025 that the Data Visualizer add-in for Excel is being retired; the Data Visualizer templates in the Visio desktop app remain available under Visio Plan 2. QueryChart runs in a browser with no Visio licence, and the spreadsheet stays a live editing surface beside the diagram rather than a one-way generator into a .vsdx file.