Currently, dynamic workflows are created with a unique identifier. This means that every dynamic workflow invocation gets a new workflow, which can lead to (performance) issues if there is a workflow creating many (duplicate) dynamic workflows. This change fixes this by forcing the id of these dynamic workflows to be equal to the hash of the workflow specification. It then checks if there isn't yet a workflow with the hash in the event store. If so, it is a duplicate, and no new workflow is created - instead the id of the existing workflow is returned.
[ ] add an integration test to verify that this hashing works consistently
Currently, dynamic workflows are created with a unique identifier. This means that every dynamic workflow invocation gets a new workflow, which can lead to (performance) issues if there is a workflow creating many (duplicate) dynamic workflows. This change fixes this by forcing the id of these dynamic workflows to be equal to the hash of the workflow specification. It then checks if there isn't yet a workflow with the hash in the event store. If so, it is a duplicate, and no new workflow is created - instead the id of the existing workflow is returned.