How to create a flowchart from CSV

How to create a flowchart from a CSV file: the header names the editor reads, what belongs in Line to, and the order to fill the columns in: Box text, then Shape, then the arrows, then lanes.

A CSV becomes a flowchart when its rows are steps rather than records: one row per step, a Shape column, a Box text column, and a Line to column holding the position of the row each step leads to.

The short version

  • One row per step. A row's position in the file is its identity.
  • Header names are the mapping (Shape, Box text, Line to, Line text) and column order does not matter.
  • Box text alone draws unconnected boxes. Line to is the column that draws the arrows.
  • Line text pairs with Line to by position: "6,4" beside "Yes,No" puts Yes on the arrow to row 6.
  • Horizontal lane and Vertical lane are the last two columns to fill, and they turn the flowchart into a swimlane diagram.

What to type in each column, and in what order

A CSV is an export. Something else produced it (a helpdesk, an ERP, a form tool, a queue report), and what came out is plain text: a header row, then one line per record, fields separated by commas, double quotes around any field that contains a comma or a line break. There are no formulas in it, no second sheet, no colours and no comments, because the format has nowhere to put them. That plainness is why a CSV travels between two systems that agree on nothing else, and it is also why the file means nothing on its own. Whatever a column is for lives in its header name.

QueryChart's editor is a spreadsheet with fixed column names: #, Shape, Box text, Line to, Line text, Line style, Horizontal lane, Vertical lane, Notes and Link. A CSV is matched to those by header name rather than by column position, so the order your columns happen to be in does not matter and any column the editor does not recognise is carried along and ignored. You import by dropping the .csv file onto the spreadsheet area, or by pasting the CSV text into it. There is no wizard and nothing to map by hand: the header row is the mapping, which is why the header row is the part worth getting right.

That leaves the actual question, which is what to type. Fill the columns in this order and you can watch each one do its job. Box text on its own gives you a column of unconnected boxes, which is what a CSV of records renders as too. Shape turns the questions into diamonds and the first and last rows into terminators. Line to is where the diagram appears: it holds the position of the row this row leads to, counting the first data row as 1, comma-separated where a row leads to more than one place, with Line text carrying the branch labels in the same order. Horizontal lane and Vertical lane come last and turn the chain into a grid.

The example below is a support ticket triage (eighteen rows) built in exactly that order. Open the spreadsheet panel and read which column each stage fills in. Before you import a file of your own, open it once in a plain text editor rather than a spreadsheet: a semicolon delimiter, two lines of preamble above the header row, or an encoding that turns accented names into replacement characters will each break the import, and a spreadsheet hides all three by rendering the file instead of showing it. /guides/how-to-structure-csv-for-flowcharts covers that side of it in full.

One CSV, filled in one column at a time

Support ticket triage, eighteen rows. Each stage adds one more column to the same file: open the spreadsheet panel to see which one.

  1. Box text on its own

    Six labels and nothing else: "Submit a ticket", "Record the ticket in the helpdesk queue", "Enough detail to work the ticket?", down to "Set the priority from impact and urgency". They stack up as boxes with nothing between them, which is also what a helpdesk export renders as, because a file of records has nowhere to put a relationship. Nothing here says that the detail check has two outcomes.

  2. Add the Shape column

    Row 1 becomes a Start, and the four questions ("Enough detail to work the ticket?", "Reply received before the chase window closes?", "Can first line resolve it?" and "Did the fix work?") become diamonds. Everything else stays a Process, which is the value you get by leaving the cell blank. An unrecognised value normalises to Process silently, so a row written as Diamond or Choice draws as a rectangle with its question still sitting inside it.

  3. Fill in Line to, then Line text

    Now the arrows. "Enough detail to work the ticket?" carries 6,4 in Line to and Yes,No in Line text, so Yes skips ahead to the priority step and No runs to "Ask the requester for the missing detail". "Can first line resolve it?" carries 8,11 with the labels Yes and "No, escalate". The numbers are row positions, not ticket ids: renumber the rows and you rewire the diagram.

  4. Add the two lane columns

    The last four rows arrive with them: "Tell the requester what changed", the confirmation decision, and the two endings: "Ticket closed" and "Closed, no reply from the requester". Horizontal lane holds the stage, Raise through Triage, First line, Escalation and Close; Vertical lane holds the role: Requester, Service desk, Specialist team. Both are ordinary text in the CSV, and a lane appears the moment a row names it, so a typo in one row produces a fourth lane with one box in it.

How it works

  1. Start a new file rather than converting the export

    The CSV you already have has one row per ticket, order line or record. The file you are about to write has one row per step, and there are usually fewer than twenty of them for a process that produced ten thousand records. Keep the export open beside you, because its queue names, status codes and assignment groups are the real vocabulary of the process, but write the chart into a fresh file.

  2. Put the header row on line one

    Type the names the editor uses, spelled the way it spells them: Shape, Box text, Line to, Line text, and later Horizontal lane and Vertical lane. Nothing may sit above that line (no title, no export timestamp, no blank row) because matching is done on the first line of the file. Columns you keep for your own reference, like the original record id, can stay where they are and will be carried through untouched.

  3. Write Box text, one action per row

    One row is one thing somebody does. Split any row whose text contains "and", and delete rows that name a phase rather than an action: "Triage" is a heading, "Set the priority from impact and urgency" is a step. Import at this point if you want to see it: you will get a column of boxes with no arrows, which is the honest picture of a file that has labels and no relationships in it.

  4. Fill in Shape

    Start on the first row, Decision on every row that asks a question, and Success, Reject or End on each ending. Process is the default, so those cells can be left blank. Use the spellings the editor uses: a value it does not recognise becomes a Process without complaint, and a decision drawn as a rectangle keeps its branch labels, which makes the mistake easy to miss.

  5. Fill in Line to, then Line text

    Line to takes the position of the target row, counting the first data row as 1, comma-separated where a row leads to more than one place. Line text takes the branch labels in the same order, so the first label belongs to the first number. Write every row out before you number anything: Line to is positional, so inserting a step later shifts every row beneath it and invalidates every reference past the insertion point. If a step has to be added afterwards, append it at the end and point at it from where it belongs.

  6. Add the lanes, save as UTF-8, and drop the file in

    Put the stage in Horizontal lane and the role in Vertical lane, then save the file as UTF-8 with comma delimiters and open it in a text editor to confirm that is what you got. Drop the .csv onto the editor's spreadsheet area, or paste the text into it. The chart renders as it lands and the edges route themselves, so there is no layout step: what you check afterwards is whether any box has no arrow leaving it.

Mistakes to avoid

  • Importing the export instead of writing a new file

    A file with one row per record has no column that could hold an edge, so it imports as a field of unconnected boxes, one per record, which for a real export means hundreds. The export is a source of vocabulary, not a source of structure.

  • Line to holding an id rather than a row position

    Ticket numbers, step codes and the labels of other steps are all dropped silently: no error, no warning, just a box with no arrow leaving it. It is the target row's position in the file, counting the first data row as 1. /guides/how-to-define-flowchart-connections-in-csv works through the addressing in detail.

  • An unquoted comma inside a label

    Line text is split on commas, and that split happens AFTER the CSV quotes have been removed, so wrapping the field does not save you. A label written "No, escalate" becomes two labels, the pairing with Line to shifts by one, and the damage surfaces as a connector pointing somewhere unexpected rather than as a wrong caption. Write it "No, escalate" instead. This is the one place where a comma cannot be escaped, which is why it is worth knowing before you export.

  • Inserting a row after the numbers are written

    Every reference below the insertion point now points one row too high, and the chart still renders, wrongly. Finish the list of steps first, number second, and append rather than insert once the numbers exist.

Create a flowchart from your CSV

Open the triage example as your own chart to see every column filled in, then drop your own .csv onto the spreadsheet area.

Create a flowchart from your CSV

Related guides

Drawing quantities instead of steps?

A CSV of steps becomes a flowchart. A CSV of source, target and value becomes a Sankey diagram, drawn with the same paste-and-edit workflow.

Frequently asked questions

What is the smallest CSV that will draw a flowchart?

Two columns. A header line reading Box text,Line to, then one line per step with the label and the position of the row it leads to: a four-step process is four lines under a header, with 2, 3, 4 and an empty cell in the second column. That draws a chain of rectangles with arrows between them. Shape is the third column worth adding, because without it every box is a rectangle and a question renders the same as an instruction, and Line text is the fourth, because a decision with unlabelled exits tells the reader a judgement happens but not which way to go afterwards.

Does Line to take the row number or an id?

The position of the target row in the file, counting the first data row as 1, the same number the editor prints in its # column. It is not the record id from the system the CSV came out of, and it is not a step code you invented, even if you have kept that column in the file. Anything that does not resolve to an existing row position is dropped with no error at all, so a file that is consistently off by one because the header row was counted as row 1 renders as boxes with no arrows and nothing anywhere says why.

How do I write a decision with two branches?

Set Shape to Decision, put both target positions in Line to separated by a comma, and put both labels in Line text in the same order. "6,4" beside "Yes,No" sends Yes to row 6 and No to row 4; reversing one list and not the other produces a chart that is wrong in the most convincing possible way, because it still looks complete. If a label itself contains a comma, wrap that field in double quotes. A branching process built entirely out of this pattern is at /templates/csv-decision-tree.

What values can the Shape column take?

Start, Process, Decision, End, Success and Reject cover almost every process chart, and there are more for specific cases: File, Input, Output and Preparation among them. Process is what you get for an empty cell, and it is also what you get for a value the editor does not recognise, which is the part to watch: there is no import error, so a column of shapes written in another tool's vocabulary imports cleanly and draws every decision as a rectangle. Check the diamonds after the first import rather than assuming.

Do I keep the CSV once the chart exists?

Keep it as the record of what you imported, not as the thing you edit. After the import the chart is the master: editing the rows in the editor is editing the diagram, because they are the same object, and maintaining the file in parallel recreates exactly the drift the conversion was meant to remove. Where a CSV keeps earning its place is at the start of the next chart: /templates/csv holds a file per chart type, and copying one of those is faster than writing a header row from memory.

The template behind this guide

CSV to flowchart template (support ticket triage) — Turn a helpdesk CSV export into a flowchart. Support ticket triage from submitted to closed, drawn from three columns (Shape, Box text and Line to) with a chase window, an escalation gate and a capped reopen.

Browse all Excel, CSV, Visio & Data-Driven Diagram Guides