Programatically edit or create flows

I want to build an abstraction layer to adapt various devices to siematic s7.
I would like to avoid having to have like 10 copies of the same Nodes (one set per device).
If you want more information about my project, I would love to share it with you.

So is it possible to have one set of nodes for a number of values?
I heard rumors that it could be possible to have a template flow that i could serialize to json and programatically edit and import into an empty flow?
Is there a better way and is what i want to do even possible at all?

It sounds like Subflows may be the way to do it. If you can share more details on what the flow you want to duplicate is, and what part of it you'd need to modify for each instance, we can give you some pointers for how to do it with Subflows.

There is an addon that allows node red to communicate with an siemens s7 plc.
Plcs have things that are called data-modules that are similar to c struts or Javascript objects.
I want to map a data-module to a device.

the data module has 4 integers, 1 bool. 3 are for color, 1 is for brightness and the bool is for power.
If the plc writes to the bool, a message is transmitted.

I need to change at least the data module from the s7-in and the s7-out nodes. And the topic for the tasmota node.

And I need to have new dashboard nodes per tasmota device.