State machines: how to trigger an action on field value updated, but not while a record is created

When I create a statemachine on desired field and then create an event on ValueUpdated fot that field, then it triggers an action also anytime a new record is created which is not the desired behavior for my specific use case.

To solve that use case I created a ‘state machine’ for whole entity and event ‘RecordUpdated’, then I sent original and current values of desired field to WF action. In WF I tested whether original != value (which itself is very difficult to do, becouse the values are in two contextstores) and if not equal I triggered finally an action.

This is very cumbersome solution and I am wondering whether I missed some easier one.

There is currently no other solution. We should probably rename this event to ValueCreatedUpdated and create another event ValueUpdated which will only trigger on a real update (not when creating a new record).

The current use case works well with scenarios for changing e.g. an “Assigned User” field. When this field changes we might want to send an e-mail notification. The notification should be also sent the first time the user is assigned (when creating a record). This event supports this use case well.