Hello Jan,
Constructors are used whenever someone attempts to create a new instance using the New buttons of a class that declares a constructor. You need to implement the actual logic in JavaScript. (If you are not familiar with that, TQ can help you with professional services).
Keep in mind though that relying on a specific numbering order may be fragile, e.g. if two people are working in parallel on workflows and instances get added without knowing about each other. That's why some customers prefer using UUIDs to create unique identifiers.
Holger