# Programmatically creating a process

**URL:** <https://forum.bpmn.io/t/programmatically-creating-a-process/1521>\
**Category:** General\
**Created:** [May 10, 2017, 11:23am UTC](https://forum.bpmn.io/t/programmatically-creating-a-process/1521 "2017-05-10T11:23:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diogo\_Cardoso](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Diogo\_Cardoso](https://forum.bpmn.io/u/Diogo_Cardoso)\
**Post date:** [May 10, 2017, 11:23am UTC](https://forum.bpmn.io/t/programmatically-creating-a-process/1521/1 "2017-05-10T11:23:03Z")

</div>

Hi,

I want to design a business process diagram in BPMN 2.0 using Javascript. Does [BPMN.io](http://BPMN.io) have some sort of API that I can call to create BPMN elements and connections, setting their position and, at the end, generate a BPMN 2.0 XML?

Thanks in advance,

Diogo Cardoso

---

<div class="post-metadata">

**Author:** ![pedesen](https://forum.bpmn.io/user_avatar/forum.bpmn.io/pedesen/32/107_2.png) [@pedesen](https://forum.bpmn.io/u/pedesen)\
**Post date:** [May 10, 2017, 12:18pm UTC](https://forum.bpmn.io/t/programmatically-creating-a-process/1521/2 "2017-05-10T12:18:44Z")

</div>

Hi,

is the bpmn-js command line interface an option for you?  
You can check it out here: [https://github.com/bpmn-io/bpmn-js-cli](https://github.com/bpmn-io/bpmn-js-cli)

---

<div class="post-metadata">

**Author:** ![Diogo\_Cardoso](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Diogo\_Cardoso](https://forum.bpmn.io/u/Diogo_Cardoso)\
**Post date:** [May 20, 2017, 1:48am UTC](https://forum.bpmn.io/t/programmatically-creating-a-process/1521/3 "2017-05-20T01:48:01Z")

</div>

Yes, that looks very nice. However, I am only able to use the CLI in the web browser console. How can I use it inside my own JS code?

Thanks.

---

<div class="post-metadata">

**Author:** ![Diogo\_Cardoso](https://forum.bpmn.io/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Diogo\_Cardoso](https://forum.bpmn.io/u/Diogo_Cardoso)\
**Post date:** [May 24, 2017, 12:17pm UTC](https://forum.bpmn.io/t/programmatically-creating-a-process/1521/4 "2017-05-24T12:17:00Z")

</div>

Hi,

Can anyone help me?

---

<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:** [June 8, 2017, 11:51am UTC](https://forum.bpmn.io/t/programmatically-creating-a-process/1521/5 "2017-06-08T11:51:55Z")

</div>

Have a look at the [unit tests](https://github.com/bpmn-io/bpmn-js/tree/master/test/spec/features/modeling) for modeling. They serve as documentation, too.

---

<div class="post-metadata">

**Author:** ![SimonSteinruecken](https://forum.bpmn.io/user_avatar/forum.bpmn.io/simonsteinruecken/32/6531_2.png) [@SimonSteinruecken](https://forum.bpmn.io/u/SimonSteinruecken)\
**Post date:** [July 15, 2025, 10:32am UTC](https://forum.bpmn.io/t/programmatically-creating-a-process/1521/6 "2025-07-15T10:32:11Z")

</div>

Closed on July 15, 2025, 10:32am UTC


