Model Process and Create XML in Javascript

Dear community,

I would like to create an XML file from a process that I have modeled in Node.js.
The following library is exactly, what I need, but it is written in Java:
[Create a Model | docs.camunda.org]
How can a process be modeled without a frontend and then exported using Node.js?

I am looking forward to recieving your suggestions :slight_smile:

Hi @PetersProblem, welcome!

You can check out bpmn-js-cli which might already be what you need.

@Niklas_Kiefer thank you very much for the answer. In principle it goes into the right direction. But I need a solution that works on Node.js only. As I understand the CLI needs to run Javascript in the browser.

Unfortunately, if I import: BpmnModeler = require('bpmn-js/lib/Modeler'),
I get an error because it uses ES2015 module syntax, but node.js uses CommonJS.
So it seems not to be made for node.

Are there any additional suggestions?

Lower level you could use bpmn-moddle, albeit with a little less convenient API than the Java one you found.