public void UpdateMetadata(string flowNodeInstanceId, string key, string value)
        {
            var evt = new MetadataUpdatedEvent(Guid.NewGuid().ToString(), AggregateId, Version + 1, flowNodeInstanceId, key, value, DateTime.UtcNow);

            Handle(evt);
            DomainEvents.Add(evt);
        }
        private void Handle(MetadataUpdatedEvent evt)
        {
            var instance = GetInstance(evt.FlowNodeInstanceId);

            instance.Metadata.Add(evt.Key, evt.Value);
        }