# Why bpmn-io project doesn't provide an auto layouting feature?

**URL:** <https://forum.bpmn.io/t/why-bpmn-io-project-doesnt-provide-an-auto-layouting-feature/7318>\
**Category:** Misc\
**Created:** [March 10, 2022, 10:17am UTC](https://forum.bpmn.io/t/why-bpmn-io-project-doesnt-provide-an-auto-layouting-feature/7318 "2022-03-10T10:17:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raylen52](https://forum.bpmn.io/user_avatar/forum.bpmn.io/raylen52/32/3487_2.png) [@Raylen52](https://forum.bpmn.io/u/Raylen52)\
**Post date:** [March 10, 2022, 10:17am UTC](https://forum.bpmn.io/t/why-bpmn-io-project-doesnt-provide-an-auto-layouting-feature/7318/1 "2022-03-10T10:17:24Z")

</div>

I’m not trying to be rude. I want to get the developers point of view on why bpmn-js doesn’t implement any auto layouting feature (as far as I know) and why [bpmn-auto-layout](https://github.com/bpmn-io/bpmn-auto-layout) library is not maintained anymore. It feels like it should be a core feature to be able to implement a button that reorders your diagram.  
Below I have attached a result of using [bpmn-auto-layout](https://github.com/bpmn-io/bpmn-auto-layout) library which unfortunately needs [altering of one line in the source file](https://github.com/bpmn-io/bpmn-auto-layout/issues/18#issuecomment-669782202) to get it working.  
 ![obraz](https://forum.bpmn.io/uploads/default/original/2X/9/9ef08d8cdb2e01c6f9b38e7f50aa3df7e7e2822f.png)

---

<div class="post-metadata">

**Author:** ![nikku](https://forum.bpmn.io/user_avatar/forum.bpmn.io/nikku/32/5130_2.png) [@nikku](https://forum.bpmn.io/u/nikku)\
**Post date:** [March 10, 2022, 1:56pm UTC](https://forum.bpmn.io/t/why-bpmn-io-project-doesnt-provide-an-auto-layouting-feature/7318/2 "2022-03-10T13:56:02Z")

</div>

You have a fair point regarding why we don’t [fix a single line of code](https://github.com/bpmn-io/bpmn-auto-layout/issues/18#issuecomment-669782202) to get bpmn-auto-layout working. Did you consider filing a PR + updating the library to work with the latest version of bpmn-js? We’ll very likely merge that one and you + some others will be very happy.

Generally speaking automatic layout won’t be part of the core (bpmn-js) for may different reasons, specially though because we do not believe in auto-layout as a generally applicable solution to build _readable diagrams_.

It has its place in an extension though; I dig that.

* * *

To understand your need for auto-layout: How do you end up with diagrams like the first one you’ve shown? Automatic generation? Export from non-bpmn-compliant tool? That context helps us to better understand how we could help.

---

<div class="post-metadata">

**Author:** ![Raylen52](https://forum.bpmn.io/user_avatar/forum.bpmn.io/raylen52/32/3487_2.png) [@Raylen52](https://forum.bpmn.io/u/Raylen52)\
**Post date:** [March 10, 2022, 2:15pm UTC](https://forum.bpmn.io/t/why-bpmn-io-project-doesnt-provide-an-auto-layouting-feature/7318/3 "2022-03-10T14:15:47Z")

</div>

> [@nikku](#):
>
> Did you consider filing a PR

Yes, but I never did something like this. I might read about contributing on github and actually do it.

> [@nikku](#):
>
> To understand your need for auto-layout: How do you end up with diagrams like the first one you’ve shown?

We have data structure representing a tree. It has info about nodes and connections. No info about relative positions. We want to render those trees using bpmn-js. We want to be able to modify them so we use modeler and not viewer. For now we consider two options:

- Generating xml string based on the structure of exported example bpmn diagram. In this approach we would not generate `<bpmndi:BPMNDiagram id="BPMNDiagram_1">` tag which contains shape positions. Haven’t tried that yet. As far as I know the bpmn-auto-layout would generate this tag along with shapes positions for us.
- Using bpmn-js modeling API to create this diagram for example: ` modeling.createShape(startEvent, { x: 400, y: 100 }, process);`. In this approach we create all shapes at exact same position `(400, 100)`.

Both approaches need reordering after creating the tree.

---

<div class="post-metadata">

**Author:** ![philippfromme](https://forum.bpmn.io/user_avatar/forum.bpmn.io/philippfromme/32/2803_2.png) [@philippfromme](https://forum.bpmn.io/u/philippfromme)\
**Post date:** [March 10, 2022, 2:18pm UTC](https://forum.bpmn.io/t/why-bpmn-io-project-doesnt-provide-an-auto-layouting-feature/7318/4 "2022-03-10T14:18:19Z")

</div>

> [@Raylen52](#):
>
> We have data structure representing a tree

Is the data structure related to BPMN?

---

<div class="post-metadata">

**Author:** ![Raylen52](https://forum.bpmn.io/user_avatar/forum.bpmn.io/raylen52/32/3487_2.png) [@Raylen52](https://forum.bpmn.io/u/Raylen52)\
**Post date:** [March 10, 2022, 2:22pm UTC](https://forum.bpmn.io/t/why-bpmn-io-project-doesnt-provide-an-auto-layouting-feature/7318/5 "2022-03-10T14:22:38Z")

</div>

> [@philippfromme](#):
>
> Is the data structure related to BPMN?

No. We only need 4 shapes shown on the image: Start Event, End Event, Task and Exclusive gateway.

---

<div class="post-metadata">

**Author:** ![philippfromme](https://forum.bpmn.io/user_avatar/forum.bpmn.io/philippfromme/32/2803_2.png) [@philippfromme](https://forum.bpmn.io/u/philippfromme)\
**Post date:** [March 10, 2022, 2:26pm UTC](https://forum.bpmn.io/t/why-bpmn-io-project-doesnt-provide-an-auto-layouting-feature/7318/6 "2022-03-10T14:26:43Z")

</div>

> [@Raylen52](#):
>
> No. We only need 4 shapes shown on the image: Start Event, End Event, Task and Exclusive gateway.

In that case, I’d argue that using bpmn-js for something that isn’t BPMN isn’t a good idea. You could use [diagram-js](https://github.com/bpmn-io/diagram-js) instead which is the toolkit bpmn-js is built on top of. diagram-js is a generic diagram toolkit that you could use to implement your domain-specific diagram viewer/modeler.

---

<div class="post-metadata">

**Author:** ![nikku](https://forum.bpmn.io/user_avatar/forum.bpmn.io/nikku/32/5130_2.png) [@nikku](https://forum.bpmn.io/u/nikku)\
**Post date:** [March 10, 2022, 2:52pm UTC](https://forum.bpmn.io/t/why-bpmn-io-project-doesnt-provide-an-auto-layouting-feature/7318/7 "2022-03-10T14:52:23Z")

</div>

Thanks, that helps me to better understand your use-case.

If you believe BPMN is the right choice for you and [bpmn-auto-layouter](https://github.com/bpmn-io/bpmn-auto-layout) helps you, please consider contributing to improve the tool. We are happy to help in the process.

---

<div class="post-metadata">

**Author:** ![barmac](https://forum.bpmn.io/user_avatar/forum.bpmn.io/barmac/32/974_2.png) [@barmac](https://forum.bpmn.io/u/barmac)\
**Post date:** [July 9, 2025, 10:17am UTC](https://forum.bpmn.io/t/why-bpmn-io-project-doesnt-provide-an-auto-layouting-feature/7318/8 "2025-07-09T10:17:28Z")

</div>

Closed on July 9, 2025, 10:17am UTC

Closing old topics.
