Fixes an issue where in rare cases the setmetadata coming from the workflow would insert the same record again (thus adding two records with the same values)