Penstock

Guide / Share and move

Import a diagram

Turn a draw.io, Visio, Signavio or Bizagi diagram into a BPMN 2.0 file, and get a list of everything that could not be carried over.

Free

What can be imported

FromFiles
draw.io (diagrams.net).drawio, .xml, compressed or not
Visio.vsdx
Signavio.bpmn exported by Signavio
Bizagi.bpmn exported by Bizagi, and a package that holds a BPMN file

These are mapped: tasks and their kinds, events and their triggers, boundary events, gateways, sub-processes, pools, lanes, sequence flows, message flows and default flows, text annotations and data objects. The positions and the bends of connectors are kept.

These cannot be read: a Bizagi .bpm package, the old binary Visio .vsd, and XPDL. The message says what to do instead: from Bizagi, export BPMN 2.0 (a .bpmn file). From Visio, use File > Save As and choose Visio Drawing (.vsdx). From a tool that wrote XPDL, export BPMN 2.0.

Steps in the editor

  1. Open any diagram in the editor. Open More and choose Import diagram….
  2. A file chooser called Import diagram opens. Pick the file.
  3. A second dialog, Save the imported diagram, asks where to put the new BPMN file. It suggests a name: order-process.bpmn from order-process.drawio.
  4. The new diagram opens. A report dialog called Diagram imported lists what was and was not carried over.
The command palette with import typed in the field. One action is listed, Import diagram, in the section File, with a pin at its right
Import diagram found by typing import in the palette.

Read the report

Nothing is dropped silently. The heading leads with the count, for example 3 not imported, and the report has three groups. What could not be mapped is in the warning colour; the red is kept for a file that could not be read at all.

GroupWhat it says
Not importedThese have no BPMN meaning and are not in the new diagram. For example a cloud shape, or a line not attached to two shapes.
GuessedThese were read by what they look like. Check that they are what you meant. For example, elements outside every pool went into the nearest pool.
Not carried overBPMN 2.0 has no place for these, so they are not in the new diagram.

If nothing was left out, the report says Everything in the file was mapped. Connectors keep the route they were drawn with. Auto layout (Pro) can tidy the result.

In a terminal

penstock import diagram.drawio -o process.bpmn
A terminal running penstock import drawio-sample.drawio. It wrote drawio-sample.bpmn, says Imported from draw.io: 4 elements, 3 flows, lists two guesses where a circle became a start event and an end event, and ends with a line about the routes of the connectors
The report of an import: what was written, what was counted and what was guessed.

Nothing is written if the file already exists, unless you pass --force or name another output with -o. A file that could not be read writes nothing at all. import is free, so it can run in a pipeline: convert a draw.io file kept in the repository before the check runs.

Import from your tool

JetBrains

Only from the editor, with More | Import diagram… as described above. To import files without opening an editor, use the command line.

VS Code

Only from the editor, with More | Import diagram… as described above, or Penstock: Import diagram… in the Command Palette. To import files without opening an editor, use the command line.

Command line

$ penstock import order-process.drawio
wrote order-process.bpmn

Imported from draw.io: 9 elements, 7 flows, 2 pools, 2 lanes.

Not imported (2):
  - "Legacy system" (cloud) has no BPMN meaning, so it was not imported.
  - "to be decided" is not attached to two shapes, so it was left out.

Guessed (1):
  - 2 elements outside every pool went into the nearest pool: "Call the customer if it takes longer", "Order".
  • -o <file.bpmn>: the file to write. Default: next to the source, with the extension .bpmn. For a source that is already a .bpmn the default is name.penstock.bpmn.
  • --force: replace a file that is already there. Without it, an existing file stops the command.
  • --format json: print the result as JSON for a tool.

See Every command.

What you see

Common problems

"This file could not be imported".
The dialog says why. Common reasons: an unsupported format (.vsd, a Bizagi .bpm package), a draw.io page larger than 32 MB when unpacked, or a file that is not a diagram.
A shape I drew is missing.
Read the Not imported group. It names each one and says why.
The imported diagram looks untidy.
Connectors keep the route they were drawn with. Press Auto layout (Pro).
Elements ended up in the wrong pool.
See Guessed. Elements outside every pool go into the nearest one. Drag them where they belong.